OLD | NEW |
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 Loading... |
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, public IPC::Sender { |
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 Loading... |
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 // Gets the current RenderViewHost's routing id. Returns |
| 115 // MSG_ROUTING_NONE when there is no RenderViewHost. |
| 116 virtual int GetRoutingID() const = 0; |
| 117 |
113 // Returns the currently active RenderWidgetHostView. This may change over | 118 // Returns the currently active RenderWidgetHostView. This may change over |
114 // time and can be NULL (during setup and teardown). | 119 // time and can be NULL (during setup and teardown). |
115 virtual content::RenderWidgetHostView* GetRenderWidgetHostView() const = 0; | 120 virtual content::RenderWidgetHostView* GetRenderWidgetHostView() const = 0; |
116 | 121 |
117 // The WebContentsView will never change and is guaranteed non-NULL. | 122 // The WebContentsView will never change and is guaranteed non-NULL. |
118 virtual WebContentsView* GetView() const = 0; | 123 virtual WebContentsView* GetView() const = 0; |
119 | 124 |
120 // Create a WebUI page for the given url. In most cases, this doesn't need to | 125 // 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 | 126 // 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 | 127 // 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 Loading... |
388 // Focuses the location bar. | 393 // Focuses the location bar. |
389 virtual void SetFocusToLocationBar(bool select_all) = 0; | 394 virtual void SetFocusToLocationBar(bool select_all) = 0; |
390 | 395 |
391 // Does this have an opener associated with it? | 396 // Does this have an opener associated with it? |
392 virtual bool HasOpener() const = 0; | 397 virtual bool HasOpener() const = 0; |
393 }; | 398 }; |
394 | 399 |
395 } // namespace content | 400 } // namespace content |
396 | 401 |
397 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 402 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |