Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Side by Side Diff: content/public/browser/web_contents.h

Issue 10830337: Add IPC::Sender and GetRoutingID() to WebContents for convenience and safety. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback_forward.h" 9 #include "base/callback_forward.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/public/browser/navigation_controller.h" 13 #include "content/public/browser/navigation_controller.h"
14 #include "content/public/browser/page_navigator.h" 14 #include "content/public/browser/page_navigator.h"
15 #include "content/public/browser/save_page_type.h" 15 #include "content/public/browser/save_page_type.h"
16 #include "content/public/browser/web_ui.h" 16 #include "content/public/browser/web_ui.h"
17 #include "ipc/ipc_sender.h"
17 #include "third_party/skia/include/core/SkColor.h" 18 #include "third_party/skia/include/core/SkColor.h"
18 #include "ui/gfx/native_widget_types.h" 19 #include "ui/gfx/native_widget_types.h"
19 #include "webkit/glue/window_open_disposition.h" 20 #include "webkit/glue/window_open_disposition.h"
20 21
21 namespace base { 22 namespace base {
22 class PropertyBag; 23 class PropertyBag;
23 class TimeTicks; 24 class TimeTicks;
24 } 25 }
25 26
26 namespace gfx { 27 namespace gfx {
(...skipping 11 matching lines...) Expand all
38 class InterstitialPage; 39 class InterstitialPage;
39 class RenderProcessHost; 40 class RenderProcessHost;
40 class RenderViewHost; 41 class RenderViewHost;
41 class RenderWidgetHostView; 42 class RenderWidgetHostView;
42 class SiteInstance; 43 class SiteInstance;
43 class WebContentsDelegate; 44 class WebContentsDelegate;
44 class WebContentsView; 45 class WebContentsView;
45 struct RendererPreferences; 46 struct RendererPreferences;
46 47
47 // Describes what goes in the main content area of a tab. 48 // Describes what goes in the main content area of a tab.
48 class WebContents : public PageNavigator { 49 class WebContents : public PageNavigator, IPC::Sender {
jam 2012/08/15 16:22:02 nit: I think the convention is another public befo
Jói 2012/08/15 19:13:24 Done.
49 public: 50 public:
50 // |base_web_contents| is used if we want to size the new WebContents's view 51 // |base_web_contents| is used if we want to size the new WebContents's view
51 // based on the view of an existing WebContents. This can be NULL if not 52 // based on the view of an existing WebContents. This can be NULL if not
52 // needed. 53 // needed.
53 CONTENT_EXPORT static WebContents* Create( 54 CONTENT_EXPORT static WebContents* Create(
54 BrowserContext* browser_context, 55 BrowserContext* browser_context,
55 SiteInstance* site_instance, 56 SiteInstance* site_instance,
56 int routing_id, 57 int routing_id,
57 const WebContents* base_web_contents); 58 const WebContents* base_web_contents);
58 59
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // Gets the URL that is currently being displayed, if there is one. 104 // Gets the URL that is currently being displayed, if there is one.
104 virtual const GURL& GetURL() const = 0; 105 virtual const GURL& GetURL() const = 0;
105 106
106 // Return the currently active RenderProcessHost and RenderViewHost. Each of 107 // Return the currently active RenderProcessHost and RenderViewHost. Each of
107 // these may change over time. 108 // these may change over time.
108 virtual RenderProcessHost* GetRenderProcessHost() const = 0; 109 virtual RenderProcessHost* GetRenderProcessHost() const = 0;
109 110
110 // Gets the current RenderViewHost for this tab. 111 // Gets the current RenderViewHost for this tab.
111 virtual RenderViewHost* GetRenderViewHost() const = 0; 112 virtual RenderViewHost* GetRenderViewHost() const = 0;
112 113
114 // For convenience, returns MSG_ROUTING_NONE when there is no RenderViewHost.
jam 2012/08/15 16:22:02 nit: to be extra clear (since there could be multi
Jói 2012/08/15 19:13:24 Done.
115 virtual int GetRoutingID() const = 0;
116
113 // Returns the currently active RenderWidgetHostView. This may change over 117 // Returns the currently active RenderWidgetHostView. This may change over
114 // time and can be NULL (during setup and teardown). 118 // time and can be NULL (during setup and teardown).
115 virtual content::RenderWidgetHostView* GetRenderWidgetHostView() const = 0; 119 virtual content::RenderWidgetHostView* GetRenderWidgetHostView() const = 0;
116 120
117 // The WebContentsView will never change and is guaranteed non-NULL. 121 // The WebContentsView will never change and is guaranteed non-NULL.
118 virtual WebContentsView* GetView() const = 0; 122 virtual WebContentsView* GetView() const = 0;
119 123
120 // Create a WebUI page for the given url. In most cases, this doesn't need to 124 // Create a WebUI page for the given url. In most cases, this doesn't need to
121 // be called by embedders since content will create its own WebUI objects as 125 // be called by embedders since content will create its own WebUI objects as
122 // necessary. However if the embedder wants to create its own WebUI object and 126 // necessary. However if the embedder wants to create its own WebUI object and
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 // Focuses the location bar. 392 // Focuses the location bar.
389 virtual void SetFocusToLocationBar(bool select_all) = 0; 393 virtual void SetFocusToLocationBar(bool select_all) = 0;
390 394
391 // Does this have an opener associated with it? 395 // Does this have an opener associated with it?
392 virtual bool HasOpener() const = 0; 396 virtual bool HasOpener() const = 0;
393 }; 397 };
394 398
395 } // namespace content 399 } // namespace content
396 400
397 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ 401 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698