| 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 SessionStorageNamespace* GetSessionStorageNamespace( | 565 SessionStorageNamespace* GetSessionStorageNamespace( |
| 566 SiteInstance* instance) override; | 566 SiteInstance* instance) override; |
| 567 SessionStorageNamespaceMap GetSessionStorageNamespaceMap() override; | 567 SessionStorageNamespaceMap GetSessionStorageNamespaceMap() override; |
| 568 double GetPendingPageZoomLevel() override; | 568 double GetPendingPageZoomLevel() override; |
| 569 FrameTree* GetFrameTree() override; | 569 FrameTree* GetFrameTree() override; |
| 570 void SetIsVirtualKeyboardRequested(bool requested) override; | 570 void SetIsVirtualKeyboardRequested(bool requested) override; |
| 571 bool IsVirtualKeyboardRequested() override; | 571 bool IsVirtualKeyboardRequested() override; |
| 572 bool IsOverridingUserAgent() override; | 572 bool IsOverridingUserAgent() override; |
| 573 bool IsJavaScriptDialogShowing() const override; | 573 bool IsJavaScriptDialogShowing() const override; |
| 574 bool HideDownloadUI() const override; | 574 bool HideDownloadUI() const override; |
| 575 bool HasPersistentVideo() const override; |
| 575 | 576 |
| 576 // NavigatorDelegate --------------------------------------------------------- | 577 // NavigatorDelegate --------------------------------------------------------- |
| 577 | 578 |
| 578 void DidStartNavigation(NavigationHandle* navigation_handle) override; | 579 void DidStartNavigation(NavigationHandle* navigation_handle) override; |
| 579 void DidRedirectNavigation(NavigationHandle* navigation_handle) override; | 580 void DidRedirectNavigation(NavigationHandle* navigation_handle) override; |
| 580 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; | 581 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; |
| 581 void DidFinishNavigation(NavigationHandle* navigation_handle) override; | 582 void DidFinishNavigation(NavigationHandle* navigation_handle) override; |
| 582 void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, | 583 void DidFailLoadWithError(RenderFrameHostImpl* render_frame_host, |
| 583 const GURL& url, | 584 const GURL& url, |
| 584 int error_code, | 585 int error_code, |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 void NotifyFindReply(int request_id, | 785 void NotifyFindReply(int request_id, |
| 785 int number_of_matches, | 786 int number_of_matches, |
| 786 const gfx::Rect& selection_rect, | 787 const gfx::Rect& selection_rect, |
| 787 int active_match_ordinal, | 788 int active_match_ordinal, |
| 788 bool final_update); | 789 bool final_update); |
| 789 | 790 |
| 790 // Modify the counter of connected devices for this WebContents. | 791 // Modify the counter of connected devices for this WebContents. |
| 791 void IncrementBluetoothConnectedDeviceCount(); | 792 void IncrementBluetoothConnectedDeviceCount(); |
| 792 void DecrementBluetoothConnectedDeviceCount(); | 793 void DecrementBluetoothConnectedDeviceCount(); |
| 793 | 794 |
| 795 // Called when the WebContents gains or loses a persistent video. |
| 796 void SetHasPersistentVideo(bool value); |
| 797 |
| 794 #if defined(OS_ANDROID) | 798 #if defined(OS_ANDROID) |
| 795 // Called by FindRequestManager when all of the find match rects are in. | 799 // Called by FindRequestManager when all of the find match rects are in. |
| 796 void NotifyFindMatchRectsReply(int version, | 800 void NotifyFindMatchRectsReply(int version, |
| 797 const std::vector<gfx::RectF>& rects, | 801 const std::vector<gfx::RectF>& rects, |
| 798 const gfx::RectF& active_rect); | 802 const gfx::RectF& active_rect); |
| 799 #endif | 803 #endif |
| 800 | 804 |
| 801 private: | 805 private: |
| 802 friend class WebContentsObserver; | 806 friend class WebContentsObserver; |
| 803 friend class WebContents; // To implement factory methods. | 807 friend class WebContents; // To implement factory methods. |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 // Returns the FindRequestManager, or creates one if it doesn't already exist. | 1169 // Returns the FindRequestManager, or creates one if it doesn't already exist. |
| 1166 FindRequestManager* GetOrCreateFindRequestManager(); | 1170 FindRequestManager* GetOrCreateFindRequestManager(); |
| 1167 | 1171 |
| 1168 // Removes a registered WebContentsBindingSet by interface name. | 1172 // Removes a registered WebContentsBindingSet by interface name. |
| 1169 void RemoveBindingSet(const std::string& interface_name); | 1173 void RemoveBindingSet(const std::string& interface_name); |
| 1170 | 1174 |
| 1171 // Prints a console warning when visiting a localhost site with a bad | 1175 // Prints a console warning when visiting a localhost site with a bad |
| 1172 // certificate via --allow-insecure-localhost. | 1176 // certificate via --allow-insecure-localhost. |
| 1173 void ShowInsecureLocalhostWarningIfNeeded(); | 1177 void ShowInsecureLocalhostWarningIfNeeded(); |
| 1174 | 1178 |
| 1179 // Notify this WebContents that the preferences have changed. This will send |
| 1180 // an IPC to all the renderer process associated with this WebContents. |
| 1181 void NotifyPreferencesChanged(); |
| 1182 |
| 1175 // Data for core operation --------------------------------------------------- | 1183 // Data for core operation --------------------------------------------------- |
| 1176 | 1184 |
| 1177 // Delegate for notifying our owner about stuff. Not owned by us. | 1185 // Delegate for notifying our owner about stuff. Not owned by us. |
| 1178 WebContentsDelegate* delegate_; | 1186 WebContentsDelegate* delegate_; |
| 1179 | 1187 |
| 1180 // Handles the back/forward list and loading. | 1188 // Handles the back/forward list and loading. |
| 1181 NavigationControllerImpl controller_; | 1189 NavigationControllerImpl controller_; |
| 1182 | 1190 |
| 1183 // The corresponding view. | 1191 // The corresponding view. |
| 1184 std::unique_ptr<WebContentsView> view_; | 1192 std::unique_ptr<WebContentsView> view_; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 | 1499 |
| 1492 #if defined(OS_ANDROID) | 1500 #if defined(OS_ANDROID) |
| 1493 std::unique_ptr<service_manager::InterfaceProvider> java_interfaces_; | 1501 std::unique_ptr<service_manager::InterfaceProvider> java_interfaces_; |
| 1494 #endif | 1502 #endif |
| 1495 | 1503 |
| 1496 // Whether this WebContents is for content overlay. | 1504 // Whether this WebContents is for content overlay. |
| 1497 bool is_overlay_content_; | 1505 bool is_overlay_content_; |
| 1498 | 1506 |
| 1499 int currently_playing_video_count_ = 0; | 1507 int currently_playing_video_count_ = 0; |
| 1500 | 1508 |
| 1509 bool has_persistent_video_ = false; |
| 1510 |
| 1501 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_; | 1511 base::WeakPtrFactory<WebContentsImpl> loading_weak_factory_; |
| 1502 base::WeakPtrFactory<WebContentsImpl> weak_factory_; | 1512 base::WeakPtrFactory<WebContentsImpl> weak_factory_; |
| 1503 | 1513 |
| 1504 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); | 1514 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); |
| 1505 }; | 1515 }; |
| 1506 | 1516 |
| 1507 // Dangerous methods which should never be made part of the public API, so we | 1517 // Dangerous methods which should never be made part of the public API, so we |
| 1508 // grant their use only to an explicit friend list (c++ attorney/client idiom). | 1518 // grant their use only to an explicit friend list (c++ attorney/client idiom). |
| 1509 class CONTENT_EXPORT WebContentsImpl::FriendZone { | 1519 class CONTENT_EXPORT WebContentsImpl::FriendZone { |
| 1510 private: | 1520 private: |
| 1511 friend class TestNavigationObserver; | 1521 friend class TestNavigationObserver; |
| 1512 friend class WebContentsAddedObserver; | 1522 friend class WebContentsAddedObserver; |
| 1513 friend class ContentBrowserSanityChecker; | 1523 friend class ContentBrowserSanityChecker; |
| 1514 | 1524 |
| 1515 FriendZone(); // Not instantiable. | 1525 FriendZone(); // Not instantiable. |
| 1516 | 1526 |
| 1517 // Adds/removes a callback called on creation of each new WebContents. | 1527 // Adds/removes a callback called on creation of each new WebContents. |
| 1518 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1528 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1519 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1529 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1520 | 1530 |
| 1521 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1531 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1522 }; | 1532 }; |
| 1523 | 1533 |
| 1524 } // namespace content | 1534 } // namespace content |
| 1525 | 1535 |
| 1526 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1536 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |