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_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/containers/scoped_ptr_hash_map.h" | 13 #include "base/containers/scoped_ptr_hash_map.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 #include "base/process/process.h" | 17 #include "base/process/process.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 #include "content/browser/frame_host/frame_tree.h" | 19 #include "content/browser/frame_host/frame_tree.h" |
20 #include "content/browser/frame_host/navigation_controller_delegate.h" | 20 #include "content/browser/frame_host/navigation_controller_delegate.h" |
21 #include "content/browser/frame_host/navigation_controller_impl.h" | 21 #include "content/browser/frame_host/navigation_controller_impl.h" |
22 #include "content/browser/frame_host/navigator_delegate.h" | 22 #include "content/browser/frame_host/navigator_delegate.h" |
23 #include "content/browser/frame_host/render_frame_host_delegate.h" | 23 #include "content/browser/frame_host/render_frame_host_delegate.h" |
24 #include "content/browser/frame_host/render_frame_host_manager.h" | 24 #include "content/browser/frame_host/render_frame_host_manager.h" |
25 #include "content/browser/media/audio_state_provider.h" | 25 #include "content/browser/media/audio_state_provider.h" |
26 #include "content/browser/renderer_host/render_view_host_delegate.h" | 26 #include "content/browser/renderer_host/render_view_host_delegate.h" |
27 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 27 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
28 #include "content/browser/web_contents/web_contents_node.h" | |
28 #include "content/common/accessibility_mode_enums.h" | 29 #include "content/common/accessibility_mode_enums.h" |
29 #include "content/common/content_export.h" | 30 #include "content/common/content_export.h" |
30 #include "content/public/browser/color_chooser.h" | 31 #include "content/public/browser/color_chooser.h" |
31 #include "content/public/browser/notification_observer.h" | 32 #include "content/public/browser/notification_observer.h" |
32 #include "content/public/browser/notification_registrar.h" | 33 #include "content/public/browser/notification_registrar.h" |
33 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
34 #include "content/public/common/renderer_preferences.h" | 35 #include "content/public/common/renderer_preferences.h" |
35 #include "content/public/common/resource_type.h" | 36 #include "content/public/common/resource_type.h" |
36 #include "content/public/common/three_d_api_types.h" | 37 #include "content/public/common/three_d_api_types.h" |
37 #include "net/base/load_states.h" | 38 #include "net/base/load_states.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 // Creates a swapped out RenderView. This is used by the browser plugin to | 118 // Creates a swapped out RenderView. This is used by the browser plugin to |
118 // create a swapped out RenderView in the embedder render process for the | 119 // create a swapped out RenderView in the embedder render process for the |
119 // guest, to expose the guest's window object to the embedder. | 120 // guest, to expose the guest's window object to the embedder. |
120 // This returns the routing ID of the newly created swapped out RenderView. | 121 // This returns the routing ID of the newly created swapped out RenderView. |
121 int CreateSwappedOutRenderView(SiteInstance* instance); | 122 int CreateSwappedOutRenderView(SiteInstance* instance); |
122 | 123 |
123 // Complex initialization here. Specifically needed to avoid having | 124 // Complex initialization here. Specifically needed to avoid having |
124 // members call back into our virtual functions in the constructor. | 125 // members call back into our virtual functions in the constructor. |
125 virtual void Init(const WebContents::CreateParams& params); | 126 virtual void Init(const WebContents::CreateParams& params); |
126 | 127 |
128 int AttachLocalFrameToGuest(WebContents* embedder_web_contents, | |
Charlie Reis
2015/04/08 23:42:11
This belongs with the WebContents overrides below.
lazyboy
2015/04/14 01:38:04
Done.
| |
129 int embedder_frame_routing_id) override; | |
130 | |
127 // Returns the SavePackage which manages the page saving job. May be NULL. | 131 // Returns the SavePackage which manages the page saving job. May be NULL. |
128 SavePackage* save_package() const { return save_package_.get(); } | 132 SavePackage* save_package() const { return save_package_.get(); } |
129 | 133 |
130 #if defined(OS_ANDROID) | 134 #if defined(OS_ANDROID) |
131 // In Android WebView, the RenderView needs created even there is no | 135 // In Android WebView, the RenderView needs created even there is no |
132 // navigation entry, this allows Android WebViews to use | 136 // navigation entry, this allows Android WebViews to use |
133 // javascript: URLs that load into the DOMWindow before the first page | 137 // javascript: URLs that load into the DOMWindow before the first page |
134 // load. This is not safe to do in any context that a web page could get a | 138 // load. This is not safe to do in any context that a web page could get a |
135 // reference to the DOMWindow before the first page load. | 139 // reference to the DOMWindow before the first page load. |
136 bool CreateRenderViewForInitialEmptyDocument(); | 140 bool CreateRenderViewForInitialEmptyDocument(); |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
583 void NotifyMainFrameSwappedFromRenderManager( | 587 void NotifyMainFrameSwappedFromRenderManager( |
584 RenderViewHost* old_host, | 588 RenderViewHost* old_host, |
585 RenderViewHost* new_host) override; | 589 RenderViewHost* new_host) override; |
586 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; | 590 int CreateOpenerRenderViewsForRenderManager(SiteInstance* instance) override; |
587 NavigationControllerImpl& GetControllerForRenderManager() override; | 591 NavigationControllerImpl& GetControllerForRenderManager() override; |
588 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; | 592 scoped_ptr<WebUIImpl> CreateWebUIForRenderManager(const GURL& url) override; |
589 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; | 593 NavigationEntry* GetLastCommittedNavigationEntryForRenderManager() override; |
590 bool FocusLocationBarByDefault() override; | 594 bool FocusLocationBarByDefault() override; |
591 void SetFocusToLocationBar(bool select_all) override; | 595 void SetFocusToLocationBar(bool select_all) override; |
592 bool IsHidden() override; | 596 bool IsHidden() override; |
597 int64 GetParentFrameTreeNodeID() override; | |
593 | 598 |
594 // NotificationObserver ------------------------------------------------------ | 599 // NotificationObserver ------------------------------------------------------ |
595 | 600 |
596 void Observe(int type, | 601 void Observe(int type, |
597 const NotificationSource& source, | 602 const NotificationSource& source, |
598 const NotificationDetails& details) override; | 603 const NotificationDetails& details) override; |
599 | 604 |
600 // NavigationControllerDelegate ---------------------------------------------- | 605 // NavigationControllerDelegate ---------------------------------------------- |
601 | 606 |
602 WebContents* GetWebContents() override; | 607 WebContents* GetWebContents() override; |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1252 | 1257 |
1253 // The accessibility mode for all frames. This is queried when each frame | 1258 // The accessibility mode for all frames. This is queried when each frame |
1254 // is created, and broadcast to all frames when it changes. | 1259 // is created, and broadcast to all frames when it changes. |
1255 AccessibilityMode accessibility_mode_; | 1260 AccessibilityMode accessibility_mode_; |
1256 | 1261 |
1257 // Created on-demand to mute all audio output from this WebContents. | 1262 // Created on-demand to mute all audio output from this WebContents. |
1258 scoped_ptr<WebContentsAudioMuter> audio_muter_; | 1263 scoped_ptr<WebContentsAudioMuter> audio_muter_; |
1259 | 1264 |
1260 bool virtual_keyboard_requested_; | 1265 bool virtual_keyboard_requested_; |
1261 | 1266 |
1267 WebContentsNode node_; | |
1268 | |
1262 #if defined(ENABLE_BROWSER_CDMS) | 1269 #if defined(ENABLE_BROWSER_CDMS) |
1263 // Manages all the media player and CDM managers and forwards IPCs to them. | 1270 // Manages all the media player and CDM managers and forwards IPCs to them. |
1264 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; | 1271 scoped_ptr<MediaWebContentsObserver> media_web_contents_observer_; |
1265 #endif | 1272 #endif |
1266 | 1273 |
1267 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_; | 1274 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_; |
1268 | 1275 |
1269 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 1276 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
1270 }; | 1277 }; |
1271 | 1278 |
(...skipping 10 matching lines...) Expand all Loading... | |
1282 // Adds/removes a callback called on creation of each new WebContents. | 1289 // Adds/removes a callback called on creation of each new WebContents. |
1283 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1290 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
1284 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1291 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
1285 | 1292 |
1286 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1293 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
1287 }; | 1294 }; |
1288 | 1295 |
1289 } // namespace content | 1296 } // namespace content |
1290 | 1297 |
1291 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1298 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |