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/page_navigator.h" | 14 #include "content/public/browser/page_navigator.h" |
14 #include "content/public/browser/save_page_type.h" | 15 #include "content/public/browser/save_page_type.h" |
15 #include "content/public/browser/web_ui.h" | 16 #include "content/public/browser/web_ui.h" |
16 #include "third_party/skia/include/core/SkColor.h" | 17 #include "third_party/skia/include/core/SkColor.h" |
17 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
18 #include "webkit/glue/window_open_disposition.h" | 19 #include "webkit/glue/window_open_disposition.h" |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class PropertyBag; | 22 class PropertyBag; |
22 class TimeTicks; | 23 class TimeTicks; |
23 } | 24 } |
24 | 25 |
25 namespace gfx { | 26 namespace gfx { |
26 class Rect; | 27 class Rect; |
27 class Size; | 28 class Size; |
28 } | 29 } |
29 | 30 |
30 namespace net { | 31 namespace net { |
31 struct LoadStateWithParam; | 32 struct LoadStateWithParam; |
32 } | 33 } |
33 | 34 |
34 namespace content { | 35 namespace content { |
35 | 36 |
36 class BrowserContext; | 37 class BrowserContext; |
37 class InterstitialPage; | 38 class InterstitialPage; |
38 class NavigationController; | |
39 class RenderProcessHost; | 39 class RenderProcessHost; |
40 class RenderViewHost; | 40 class RenderViewHost; |
41 class RenderWidgetHostView; | 41 class RenderWidgetHostView; |
42 class SessionStorageNamespace; | |
43 class SiteInstance; | 42 class SiteInstance; |
44 class WebContentsDelegate; | 43 class WebContentsDelegate; |
45 class WebContentsView; | 44 class WebContentsView; |
46 struct RendererPreferences; | 45 struct RendererPreferences; |
47 | 46 |
48 // Describes what goes in the main content area of a tab. | 47 // Describes what goes in the main content area of a tab. |
49 class WebContents : public PageNavigator { | 48 class WebContents : public PageNavigator { |
50 public: | 49 public: |
51 // |base_web_contents| is used if we want to size the new WebContents's view | 50 // |base_web_contents| is used if we want to size the new WebContents's view |
52 // based on the view of an existing WebContents. This can be NULL if not | 51 // based on the view of an existing WebContents. This can be NULL if not |
53 // needed. | 52 // needed. |
54 // | |
55 // The session storage namespace parameter allows multiple render views and | |
56 // web contentses to share the same session storage (part of the WebStorage | |
57 // spec) space. This is useful when restoring tabs, but most callers should | |
58 // pass in NULL which will cause a new SessionStorageNamespace to be created. | |
59 CONTENT_EXPORT static WebContents* Create( | 53 CONTENT_EXPORT static WebContents* Create( |
60 BrowserContext* browser_context, | 54 BrowserContext* browser_context, |
61 SiteInstance* site_instance, | 55 SiteInstance* site_instance, |
62 int routing_id, | 56 int routing_id, |
57 const WebContents* base_web_contents); | |
58 | |
59 CONTENT_EXPORT static WebContents* CreateWithSessionStorage( | |
Charlie Reis
2012/08/02 23:06:47
Please add a comment saying when callers should us
awong
2012/08/03 00:31:04
Done.
| |
60 BrowserContext* browser_context, | |
61 SiteInstance* site_instance, | |
62 int routing_id, | |
63 const WebContents* base_web_contents, | 63 const WebContents* base_web_contents, |
64 SessionStorageNamespace* session_storage_namespace); | 64 const SessionStorageNamespaceMap& session_storage_namespace_map); |
65 | 65 |
66 // Returns a WebContents that wraps the RenderViewHost, or NULL if the | 66 // Returns a WebContents that wraps the RenderViewHost, or NULL if the |
67 // render view host's delegate isn't a WebContents. | 67 // render view host's delegate isn't a WebContents. |
68 CONTENT_EXPORT static WebContents* FromRenderViewHost( | 68 CONTENT_EXPORT static WebContents* FromRenderViewHost( |
69 const RenderViewHost* rvh); | 69 const RenderViewHost* rvh); |
70 | 70 |
71 virtual ~WebContents() {} | 71 virtual ~WebContents() {} |
72 | 72 |
73 // Intrinsic tab state ------------------------------------------------------- | 73 // Intrinsic tab state ------------------------------------------------------- |
74 | 74 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 // Focuses the location bar. | 378 // Focuses the location bar. |
379 virtual void SetFocusToLocationBar(bool select_all) = 0; | 379 virtual void SetFocusToLocationBar(bool select_all) = 0; |
380 | 380 |
381 // Does this have an opener associated with it? | 381 // Does this have an opener associated with it? |
382 virtual bool HasOpener() const = 0; | 382 virtual bool HasOpener() const = 0; |
383 }; | 383 }; |
384 | 384 |
385 } // namespace content | 385 } // namespace content |
386 | 386 |
387 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 387 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |