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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 class WebContentsDelegate; | 49 class WebContentsDelegate; |
50 class WebContentsView; | 50 class WebContentsView; |
51 struct RendererPreferences; | 51 struct RendererPreferences; |
52 | 52 |
53 // WebContents is the core class in content/. A WebContents renders web content | 53 // WebContents is the core class in content/. A WebContents renders web content |
54 // (usually HTML) in a rectangular area. | 54 // (usually HTML) in a rectangular area. |
55 // | 55 // |
56 // Instantiating one is simple: | 56 // Instantiating one is simple: |
57 // scoped_ptr<content::WebContents> web_contents( | 57 // scoped_ptr<content::WebContents> web_contents( |
58 // content::WebContents::Create( | 58 // content::WebContents::Create( |
59 // content::WebContents::CreateParams(browser_context))); | 59 // content::WebContents::CreateParams(browser_context), NULL)); |
60 // gfx::NativeView view = web_contents->GetView()->GetNativeView(); | 60 // gfx::NativeView view = web_contents->GetView()->GetNativeView(); |
61 // // |view| is an HWND, NSView*, GtkWidget*, etc.; insert it into the view | 61 // // |view| is an HWND, NSView*, GtkWidget*, etc.; insert it into the view |
62 // // hierarchy wherever it needs to go. | 62 // // hierarchy wherever it needs to go. |
63 // | 63 // |
64 // That's it; go to your kitchen, grab a scone, and chill. WebContents will do | 64 // That's it; go to your kitchen, grab a scone, and chill. WebContents will do |
65 // all the multi-process stuff behind the scenes. More details are at | 65 // all the multi-process stuff behind the scenes. More details are at |
66 // http://www.chromium.org/developers/design-documents/multi-process-architectur e . | 66 // http://www.chromium.org/developers/design-documents/multi-process-architectur e . |
67 // | 67 // |
68 // Each WebContents has exactly one NavigationController; each | 68 // Each WebContents has exactly one NavigationController; each |
69 // NavigationController belongs to one WebContents. The NavigationController can | 69 // NavigationController belongs to one WebContents. The NavigationController can |
(...skipping 14 matching lines...) Expand all Loading... | |
84 int main_frame_routing_id; | 84 int main_frame_routing_id; |
85 | 85 |
86 // Initial size of the new WebContent's view. Can be (0, 0) if not needed. | 86 // Initial size of the new WebContent's view. Can be (0, 0) if not needed. |
87 gfx::Size initial_size; | 87 gfx::Size initial_size; |
88 | 88 |
89 // Used to specify the location context which display the new view should | 89 // Used to specify the location context which display the new view should |
90 // belong. This can be NULL if not needed. | 90 // belong. This can be NULL if not needed. |
91 gfx::NativeView context; | 91 gfx::NativeView context; |
92 }; | 92 }; |
93 | 93 |
94 // Creates a new WebContents. | 94 // Creates a new WebContents. If |opener| is non-NULL, it will be set as the |
95 CONTENT_EXPORT static WebContents* Create(const CreateParams& params); | 95 // WebContent's opener. |
96 CONTENT_EXPORT static WebContents* Create(const CreateParams& params, | |
97 WebContents* opener = NULL); | |
awong
2013/07/31 20:21:42
default args aren't allowed by style guide. Maybe
jochen (gone - plz use gerrit)
2013/07/31 20:23:44
The default arg is just there to make it possible
| |
96 | 98 |
97 // Similar to Create() above but should be used when you need to prepopulate | 99 // Similar to Create() above but should be used when you need to prepopulate |
98 // the SessionStorageNamespaceMap of the WebContents. This can happen if | 100 // the SessionStorageNamespaceMap of the WebContents. This can happen if |
99 // you duplicate a WebContents, try to reconstitute it from a saved state, | 101 // you duplicate a WebContents, try to reconstitute it from a saved state, |
100 // or when you create a new WebContents based on another one (eg., when | 102 // or when you create a new WebContents based on another one (eg., when |
101 // servicing a window.open() call). | 103 // servicing a window.open() call). |
102 // | 104 // |
103 // You do not want to call this. If you think you do, make sure you completely | 105 // You do not want to call this. If you think you do, make sure you completely |
104 // understand when SessionStorageNamespace objects should be cloned, why | 106 // understand when SessionStorageNamespace objects should be cloned, why |
105 // they should not be shared by multiple WebContents, and what bad things | 107 // they should not be shared by multiple WebContents, and what bad things |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
452 | 454 |
453 private: | 455 private: |
454 // This interface should only be implemented inside content. | 456 // This interface should only be implemented inside content. |
455 friend class WebContentsImpl; | 457 friend class WebContentsImpl; |
456 WebContents() {} | 458 WebContents() {} |
457 }; | 459 }; |
458 | 460 |
459 } // namespace content | 461 } // namespace content |
460 | 462 |
461 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 463 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |