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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.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/page_navigator.h" | 13 #include "content/public/browser/page_navigator.h" |
14 #include "content/public/browser/save_page_type.h" | 14 #include "content/public/browser/save_page_type.h" |
15 #include "content/public/browser/web_ui.h" | 15 #include "content/public/browser/web_ui.h" |
16 #include "content/public/common/view_type.h" | 16 #include "content/public/common/view_type.h" |
17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
18 #include "webkit/glue/window_open_disposition.h" | 18 #include "webkit/glue/window_open_disposition.h" |
19 | 19 |
20 class InterstitialPage; | 20 class InterstitialPage; |
21 class RenderViewHost; | 21 class RenderViewHost; |
22 class RenderWidgetHostView; | 22 class RenderWidgetHostView; |
23 class SessionStorageNamespace; | 23 class SessionStorageNamespace; |
24 class SiteInstance; | |
25 | 24 |
26 namespace base { | 25 namespace base { |
27 class PropertyBag; | 26 class PropertyBag; |
28 class TimeTicks; | 27 class TimeTicks; |
29 } | 28 } |
30 | 29 |
31 namespace gfx { | 30 namespace gfx { |
32 class Rect; | 31 class Rect; |
33 class Size; | 32 class Size; |
34 } | 33 } |
35 | 34 |
36 namespace net { | 35 namespace net { |
37 struct LoadStateWithParam; | 36 struct LoadStateWithParam; |
38 } | 37 } |
39 | 38 |
40 namespace content { | 39 namespace content { |
41 | 40 |
42 class BrowserContext; | 41 class BrowserContext; |
43 class NavigationController; | 42 class NavigationController; |
44 class RenderProcessHost; | 43 class RenderProcessHost; |
45 class WebContentsDelegate; | 44 class WebContentsDelegate; |
46 struct RendererPreferences; | 45 struct RendererPreferences; |
46 class SiteInstance; | |
47 struct SSLStatus; | 47 struct SSLStatus; |
48 // TODO(jam): of course we will have to rename WebContentsView etc to use | 48 // TODO(jam): of course we will have to rename WebContentsView etc to use |
49 // WebContents. | 49 // WebContents. |
50 class WebContentsView; | 50 class WebContentsView; |
51 | 51 |
52 // Describes what goes in the main content area of a tab. | 52 // Describes what goes in the main content area of a tab. |
53 class WebContents : public PageNavigator { | 53 class WebContents : public PageNavigator { |
54 public: | 54 public: |
55 // |base_tab_contents| is used if we want to size the new tab contents view | 55 // |base_tab_contents| is used if we want to size the new tab contents view |
56 // based on an existing tab contents view. This can be NULL if not needed. | 56 // based on an existing tab contents view. This can be NULL if not needed. |
57 // | 57 // |
58 // The session storage namespace parameter allows multiple render views and | 58 // The session storage namespace parameter allows multiple render views and |
59 // tab contentses to share the same session storage (part of the WebStorage | 59 // tab contentses to share the same session storage (part of the WebStorage |
60 // spec) space. This is useful when restoring tabs, but most callers should | 60 // spec) space. This is useful when restoring tabs, but most callers should |
61 // pass in NULL which will cause a new SessionStorageNamespace to be created. | 61 // pass in NULL which will cause a new SessionStorageNamespace to be created. |
62 CONTENT_EXPORT static WebContents* Create( | 62 CONTENT_EXPORT static WebContents* Create( |
63 BrowserContext* browser_context, | 63 BrowserContext* browser_context, |
64 SiteInstance* site_instance, | 64 content::SiteInstance* site_instance, |
jam
2012/01/24 03:29:33
nit: here and below, no need for the "content::" s
ananta
2012/01/24 23:46:26
Done.
| |
65 int routing_id, | 65 int routing_id, |
66 const WebContents* base_tab_contents, | 66 const WebContents* base_tab_contents, |
67 SessionStorageNamespace* session_storage_namespace); | 67 SessionStorageNamespace* session_storage_namespace); |
68 | 68 |
69 virtual ~WebContents() {} | 69 virtual ~WebContents() {} |
70 | 70 |
71 // Intrinsic tab state ------------------------------------------------------- | 71 // Intrinsic tab state ------------------------------------------------------- |
72 | 72 |
73 // Returns the property bag for this tab contents, where callers can add | 73 // Returns the property bag for this tab contents, where callers can add |
74 // extra data they may wish to associate with the tab. Returns a pointer | 74 // extra data they may wish to associate with the tab. Returns a pointer |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 virtual const string16& GetTitle() const = 0; | 129 virtual const string16& GetTitle() const = 0; |
130 | 130 |
131 // The max page ID for any page that the current SiteInstance has loaded in | 131 // The max page ID for any page that the current SiteInstance has loaded in |
132 // this TabContents. Page IDs are specific to a given SiteInstance and | 132 // this TabContents. Page IDs are specific to a given SiteInstance and |
133 // TabContents, corresponding to a specific RenderView in the renderer. | 133 // TabContents, corresponding to a specific RenderView in the renderer. |
134 // Page IDs increase with each new page that is loaded by a tab. | 134 // Page IDs increase with each new page that is loaded by a tab. |
135 virtual int32 GetMaxPageID() = 0; | 135 virtual int32 GetMaxPageID() = 0; |
136 | 136 |
137 // The max page ID for any page that the given SiteInstance has loaded in | 137 // The max page ID for any page that the given SiteInstance has loaded in |
138 // this TabContents. | 138 // this TabContents. |
139 virtual int32 GetMaxPageIDForSiteInstance(SiteInstance* site_instance) = 0; | 139 virtual int32 GetMaxPageIDForSiteInstance( |
140 content::SiteInstance* site_instance) = 0; | |
140 | 141 |
141 // Returns the SiteInstance associated with the current page. | 142 // Returns the SiteInstance associated with the current page. |
142 virtual SiteInstance* GetSiteInstance() const = 0; | 143 virtual content::SiteInstance* GetSiteInstance() const = 0; |
143 | 144 |
144 // Returns the SiteInstance for the pending navigation, if any. Otherwise | 145 // Returns the SiteInstance for the pending navigation, if any. Otherwise |
145 // returns the current SiteInstance. | 146 // returns the current SiteInstance. |
146 virtual SiteInstance* GetPendingSiteInstance() const = 0; | 147 virtual content::SiteInstance* GetPendingSiteInstance() const = 0; |
147 | 148 |
148 // Return whether this tab contents is loading a resource. | 149 // Return whether this tab contents is loading a resource. |
149 virtual bool IsLoading() const = 0; | 150 virtual bool IsLoading() const = 0; |
150 | 151 |
151 // Returns whether this tab contents is waiting for a first-response for the | 152 // Returns whether this tab contents is waiting for a first-response for the |
152 // main resource of the page. | 153 // main resource of the page. |
153 virtual bool IsWaitingForResponse() const = 0; | 154 virtual bool IsWaitingForResponse() const = 0; |
154 | 155 |
155 // Return the current load state and the URL associated with it. | 156 // Return the current load state and the URL associated with it. |
156 virtual const net::LoadStateWithParam& GetLoadState() const = 0; | 157 virtual const net::LoadStateWithParam& GetLoadState() const = 0; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 // to see what it should do. | 363 // to see what it should do. |
363 virtual bool FocusLocationBarByDefault() = 0; | 364 virtual bool FocusLocationBarByDefault() = 0; |
364 | 365 |
365 // Focuses the location bar. | 366 // Focuses the location bar. |
366 virtual void SetFocusToLocationBar(bool select_all) = 0; | 367 virtual void SetFocusToLocationBar(bool select_all) = 0; |
367 }; | 368 }; |
368 | 369 |
369 } // namespace content | 370 } // namespace content |
370 | 371 |
371 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 372 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |