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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <functional> | 10 #include <functional> |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "content/common/content_export.h" | 34 #include "content/common/content_export.h" |
35 #include "content/public/browser/color_chooser.h" | 35 #include "content/public/browser/color_chooser.h" |
36 #include "content/public/browser/notification_observer.h" | 36 #include "content/public/browser/notification_observer.h" |
37 #include "content/public/browser/notification_registrar.h" | 37 #include "content/public/browser/notification_registrar.h" |
38 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
39 #include "content/public/browser/web_contents_observer.h" | 39 #include "content/public/browser/web_contents_observer.h" |
40 #include "content/public/common/page_importance_signals.h" | 40 #include "content/public/common/page_importance_signals.h" |
41 #include "content/public/common/renderer_preferences.h" | 41 #include "content/public/common/renderer_preferences.h" |
42 #include "content/public/common/resource_type.h" | 42 #include "content/public/common/resource_type.h" |
43 #include "content/public/common/three_d_api_types.h" | 43 #include "content/public/common/three_d_api_types.h" |
| 44 #include "device/wake_lock/public/interfaces/wake_lock_service_context.mojom.h" |
44 #include "net/base/load_states.h" | 45 #include "net/base/load_states.h" |
45 #include "net/http/http_response_headers.h" | 46 #include "net/http/http_response_headers.h" |
46 #include "ppapi/features/features.h" | 47 #include "ppapi/features/features.h" |
47 #include "third_party/WebKit/public/platform/WebDragOperation.h" | 48 #include "third_party/WebKit/public/platform/WebDragOperation.h" |
48 #include "ui/base/page_transition_types.h" | 49 #include "ui/base/page_transition_types.h" |
49 #include "ui/gfx/geometry/rect_f.h" | 50 #include "ui/gfx/geometry/rect_f.h" |
50 #include "ui/gfx/geometry/size.h" | 51 #include "ui/gfx/geometry/size.h" |
51 | 52 |
52 struct ViewHostMsg_DateTimeDialogValue_Params; | 53 struct ViewHostMsg_DateTimeDialogValue_Params; |
53 | 54 |
(...skipping 15 matching lines...) Expand all Loading... |
69 class PluginContentOriginWhitelist; | 70 class PluginContentOriginWhitelist; |
70 class RenderViewHost; | 71 class RenderViewHost; |
71 class RenderViewHostDelegateView; | 72 class RenderViewHostDelegateView; |
72 class RenderWidgetHostImpl; | 73 class RenderWidgetHostImpl; |
73 class RenderWidgetHostInputEventRouter; | 74 class RenderWidgetHostInputEventRouter; |
74 class SavePackage; | 75 class SavePackage; |
75 class ScreenOrientationProvider; | 76 class ScreenOrientationProvider; |
76 class SiteInstance; | 77 class SiteInstance; |
77 class TestWebContents; | 78 class TestWebContents; |
78 class TextInputManager; | 79 class TextInputManager; |
79 class WakeLockServiceContext; | |
80 class WebContentsAudioMuter; | 80 class WebContentsAudioMuter; |
81 class WebContentsBindingSet; | 81 class WebContentsBindingSet; |
82 class WebContentsDelegate; | 82 class WebContentsDelegate; |
83 class WebContentsImpl; | 83 class WebContentsImpl; |
84 class WebContentsView; | 84 class WebContentsView; |
85 class WebContentsViewDelegate; | 85 class WebContentsViewDelegate; |
86 struct AXEventNotificationDetails; | 86 struct AXEventNotificationDetails; |
87 struct ColorSuggestion; | 87 struct ColorSuggestion; |
88 struct FaviconURL; | 88 struct FaviconURL; |
89 struct LoadNotificationDetails; | 89 struct LoadNotificationDetails; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // Adds a new binding set to the WebContents. Returns a closure which may be | 255 // Adds a new binding set to the WebContents. Returns a closure which may be |
256 // used to remove the binding set at any time. The closure is safe to call | 256 // used to remove the binding set at any time. The closure is safe to call |
257 // even after WebContents destruction. | 257 // even after WebContents destruction. |
258 // | 258 // |
259 // |binding_set| is not owned and must either outlive this WebContents or be | 259 // |binding_set| is not owned and must either outlive this WebContents or be |
260 // explicitly removed before being destroyed. | 260 // explicitly removed before being destroyed. |
261 base::Closure AddBindingSet(const std::string& interface_name, | 261 base::Closure AddBindingSet(const std::string& interface_name, |
262 WebContentsBindingSet* binding_set); | 262 WebContentsBindingSet* binding_set); |
263 | 263 |
264 // WebContents ------------------------------------------------------ | 264 // WebContents ------------------------------------------------------ |
| 265 int GetId() override; |
265 WebContentsDelegate* GetDelegate() override; | 266 WebContentsDelegate* GetDelegate() override; |
266 void SetDelegate(WebContentsDelegate* delegate) override; | 267 void SetDelegate(WebContentsDelegate* delegate) override; |
267 NavigationControllerImpl& GetController() override; | 268 NavigationControllerImpl& GetController() override; |
268 const NavigationControllerImpl& GetController() const override; | 269 const NavigationControllerImpl& GetController() const override; |
269 BrowserContext* GetBrowserContext() const override; | 270 BrowserContext* GetBrowserContext() const override; |
270 const GURL& GetURL() const override; | 271 const GURL& GetURL() const override; |
271 const GURL& GetVisibleURL() const override; | 272 const GURL& GetVisibleURL() const override; |
272 const GURL& GetLastCommittedURL() const override; | 273 const GURL& GetLastCommittedURL() const override; |
273 RenderProcessHost* GetRenderProcessHost() const override; | 274 RenderProcessHost* GetRenderProcessHost() const override; |
274 RenderFrameHostImpl* GetMainFrame() override; | 275 RenderFrameHostImpl* GetMainFrame() override; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 WebContents* GetAsWebContents() override; | 475 WebContents* GetAsWebContents() override; |
475 bool IsNeverVisible() override; | 476 bool IsNeverVisible() override; |
476 AccessibilityMode GetAccessibilityMode() const override; | 477 AccessibilityMode GetAccessibilityMode() const override; |
477 void AccessibilityEventReceived( | 478 void AccessibilityEventReceived( |
478 const std::vector<AXEventNotificationDetails>& details) override; | 479 const std::vector<AXEventNotificationDetails>& details) override; |
479 void AccessibilityLocationChangesReceived( | 480 void AccessibilityLocationChangesReceived( |
480 const std::vector<AXLocationChangeNotificationDetails>& details) override; | 481 const std::vector<AXLocationChangeNotificationDetails>& details) override; |
481 RenderFrameHost* GetGuestByInstanceID( | 482 RenderFrameHost* GetGuestByInstanceID( |
482 RenderFrameHost* render_frame_host, | 483 RenderFrameHost* render_frame_host, |
483 int browser_plugin_instance_id) override; | 484 int browser_plugin_instance_id) override; |
| 485 static gfx::NativeView GetNativeViewForWebContents(int web_contents_id); |
484 device::GeolocationServiceContext* GetGeolocationServiceContext() override; | 486 device::GeolocationServiceContext* GetGeolocationServiceContext() override; |
485 device::WakeLockServiceContext* GetWakeLockServiceContext() override; | 487 device::mojom::WakeLockServiceContext* GetWakeLockServiceContext() override; |
486 void EnterFullscreenMode(const GURL& origin) override; | 488 void EnterFullscreenMode(const GURL& origin) override; |
487 void ExitFullscreenMode(bool will_cause_resize) override; | 489 void ExitFullscreenMode(bool will_cause_resize) override; |
488 bool ShouldRouteMessageEvent( | 490 bool ShouldRouteMessageEvent( |
489 RenderFrameHost* target_rfh, | 491 RenderFrameHost* target_rfh, |
490 SiteInstance* source_site_instance) const override; | 492 SiteInstance* source_site_instance) const override; |
491 void EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) override; | 493 void EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) override; |
492 std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( | 494 std::unique_ptr<WebUIImpl> CreateWebUIForRenderFrameHost( |
493 const GURL& url) override; | 495 const GURL& url) override; |
494 void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) override; | 496 void SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) override; |
495 void OnFocusedElementChangedInFrame( | 497 void OnFocusedElementChangedInFrame( |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 // Prints a console warning when visiting a localhost site with a bad | 1183 // Prints a console warning when visiting a localhost site with a bad |
1182 // certificate via --allow-insecure-localhost. | 1184 // certificate via --allow-insecure-localhost. |
1183 void ShowInsecureLocalhostWarningIfNeeded(); | 1185 void ShowInsecureLocalhostWarningIfNeeded(); |
1184 | 1186 |
1185 // Notify this WebContents that the preferences have changed. This will send | 1187 // Notify this WebContents that the preferences have changed. This will send |
1186 // an IPC to all the renderer process associated with this WebContents. | 1188 // an IPC to all the renderer process associated with this WebContents. |
1187 void NotifyPreferencesChanged(); | 1189 void NotifyPreferencesChanged(); |
1188 | 1190 |
1189 // Data for core operation --------------------------------------------------- | 1191 // Data for core operation --------------------------------------------------- |
1190 | 1192 |
| 1193 // This instance's ID. |
| 1194 int id_; |
| 1195 |
1191 // Delegate for notifying our owner about stuff. Not owned by us. | 1196 // Delegate for notifying our owner about stuff. Not owned by us. |
1192 WebContentsDelegate* delegate_; | 1197 WebContentsDelegate* delegate_; |
1193 | 1198 |
1194 // Handles the back/forward list and loading. | 1199 // Handles the back/forward list and loading. |
1195 NavigationControllerImpl controller_; | 1200 NavigationControllerImpl controller_; |
1196 | 1201 |
1197 // The corresponding view. | 1202 // The corresponding view. |
1198 std::unique_ptr<WebContentsView> view_; | 1203 std::unique_ptr<WebContentsView> view_; |
1199 | 1204 |
1200 // The view of the RVHD. Usually this is our WebContentsView implementation, | 1205 // The view of the RVHD. Usually this is our WebContentsView implementation, |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 | 1454 |
1450 // Whether overscroll should be unconditionally disabled. | 1455 // Whether overscroll should be unconditionally disabled. |
1451 bool force_disable_overscroll_content_; | 1456 bool force_disable_overscroll_content_; |
1452 | 1457 |
1453 // Whether the last JavaScript dialog shown was suppressed. Used for testing. | 1458 // Whether the last JavaScript dialog shown was suppressed. Used for testing. |
1454 bool last_dialog_suppressed_; | 1459 bool last_dialog_suppressed_; |
1455 | 1460 |
1456 std::unique_ptr<device::GeolocationServiceContext> | 1461 std::unique_ptr<device::GeolocationServiceContext> |
1457 geolocation_service_context_; | 1462 geolocation_service_context_; |
1458 | 1463 |
1459 std::unique_ptr<device::WakeLockServiceContext> wake_lock_service_context_; | 1464 device::mojom::WakeLockServiceContextPtr wake_lock_service_context_; |
1460 | 1465 |
1461 std::unique_ptr<ScreenOrientationProvider> screen_orientation_provider_; | 1466 std::unique_ptr<ScreenOrientationProvider> screen_orientation_provider_; |
1462 | 1467 |
1463 std::unique_ptr<ManifestManagerHost> manifest_manager_host_; | 1468 std::unique_ptr<ManifestManagerHost> manifest_manager_host_; |
1464 | 1469 |
1465 // The accessibility mode for all frames. This is queried when each frame | 1470 // The accessibility mode for all frames. This is queried when each frame |
1466 // is created, and broadcast to all frames when it changes. | 1471 // is created, and broadcast to all frames when it changes. |
1467 AccessibilityMode accessibility_mode_; | 1472 AccessibilityMode accessibility_mode_; |
1468 | 1473 |
1469 // Monitors power levels for audio streams associated with this WebContents. | 1474 // Monitors power levels for audio streams associated with this WebContents. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 // Adds/removes a callback called on creation of each new WebContents. | 1542 // Adds/removes a callback called on creation of each new WebContents. |
1538 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1543 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
1539 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1544 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
1540 | 1545 |
1541 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1546 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
1542 }; | 1547 }; |
1543 | 1548 |
1544 } // namespace content | 1549 } // namespace content |
1545 | 1550 |
1546 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1551 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |