Chromium Code Reviews| 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 <map> | 10 #include <map> |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 700 void RenderFrameForInterstitialPageCreated( | 700 void RenderFrameForInterstitialPageCreated( |
| 701 RenderFrameHost* render_frame_host) override; | 701 RenderFrameHost* render_frame_host) override; |
| 702 | 702 |
| 703 // Sets the passed interstitial as the currently showing interstitial. | 703 // Sets the passed interstitial as the currently showing interstitial. |
| 704 // No interstitial page should already be attached. | 704 // No interstitial page should already be attached. |
| 705 void AttachInterstitialPage(InterstitialPageImpl* interstitial_page) override; | 705 void AttachInterstitialPage(InterstitialPageImpl* interstitial_page) override; |
| 706 | 706 |
| 707 // Unsets the currently showing interstitial. | 707 // Unsets the currently showing interstitial. |
| 708 void DetachInterstitialPage() override; | 708 void DetachInterstitialPage() override; |
| 709 | 709 |
| 710 // Changes the IsLoading state and notifies the delegate as needed. | 710 // Unpause the throbber if it was paused. |
| 711 // |details| is used to provide details on the load that just finished | 711 void DidProceedOnInterstitial() override; |
| 712 // (but can be null if not applicable). | |
| 713 void SetIsLoading(bool is_loading, | |
| 714 bool to_different_document, | |
| 715 LoadNotificationDetails* details) override; | |
| 716 | 712 |
| 717 typedef base::Callback<void(WebContents*)> CreatedCallback; | 713 typedef base::Callback<void(WebContents*)> CreatedCallback; |
| 718 | 714 |
| 719 // Forces overscroll to be disabled (used by touch emulation). | 715 // Forces overscroll to be disabled (used by touch emulation). |
| 720 void SetForceDisableOverscrollContent(bool force_disable); | 716 void SetForceDisableOverscrollContent(bool force_disable); |
| 721 | 717 |
| 722 AudioStreamMonitor* audio_stream_monitor() { | 718 AudioStreamMonitor* audio_stream_monitor() { |
| 723 return &audio_stream_monitor_; | 719 return &audio_stream_monitor_; |
| 724 } | 720 } |
| 725 | 721 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1010 // |preferred_size_for_capture_| changes, to propagate the new value to the | 1006 // |preferred_size_for_capture_| changes, to propagate the new value to the |
| 1011 // |delegate_|. | 1007 // |delegate_|. |
| 1012 void OnPreferredSizeChanged(const gfx::Size& old_size); | 1008 void OnPreferredSizeChanged(const gfx::Size& old_size); |
| 1013 | 1009 |
| 1014 // Internal helper to create WebUI objects associated with |this|. |url| is | 1010 // Internal helper to create WebUI objects associated with |this|. |url| is |
| 1015 // used to determine which WebUI should be created (if any). |frame_name| | 1011 // used to determine which WebUI should be created (if any). |frame_name| |
| 1016 // corresponds to the name of a frame that the WebUI should be created for (or | 1012 // corresponds to the name of a frame that the WebUI should be created for (or |
| 1017 // the main frame if empty). | 1013 // the main frame if empty). |
| 1018 WebUI* CreateWebUI(const GURL& url, const std::string& frame_name); | 1014 WebUI* CreateWebUI(const GURL& url, const std::string& frame_name); |
| 1019 | 1015 |
| 1016 // Notifies the delegate of a change in loading state. | |
| 1017 // |details| is used to provide details on the load that just finished | |
| 1018 // (but can be null if not applicable). | |
| 1019 // |due_to_interstitial| is true if the change in load state occurred because | |
| 1020 // an interstitial page started showing/proceeded. | |
| 1021 void LoadingStateChanged(bool to_different_document, | |
|
Charlie Reis
2016/02/19 05:24:54
Maybe this belongs in the "Tracking loading progre
clamy
2016/02/19 12:02:05
Done.
| |
| 1022 bool due_to_interstitial, | |
| 1023 LoadNotificationDetails* details); | |
| 1024 | |
| 1020 // Data for core operation --------------------------------------------------- | 1025 // Data for core operation --------------------------------------------------- |
| 1021 | 1026 |
| 1022 // Delegate for notifying our owner about stuff. Not owned by us. | 1027 // Delegate for notifying our owner about stuff. Not owned by us. |
| 1023 WebContentsDelegate* delegate_; | 1028 WebContentsDelegate* delegate_; |
| 1024 | 1029 |
| 1025 // Handles the back/forward list and loading. | 1030 // Handles the back/forward list and loading. |
| 1026 NavigationControllerImpl controller_; | 1031 NavigationControllerImpl controller_; |
| 1027 | 1032 |
| 1028 // The corresponding view. | 1033 // The corresponding view. |
| 1029 scoped_ptr<WebContentsView> view_; | 1034 scoped_ptr<WebContentsView> view_; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1067 | 1072 |
| 1068 // If this WebContents is part of a "tree of WebContents", then this contains | 1073 // If this WebContents is part of a "tree of WebContents", then this contains |
| 1069 // information about the structure. | 1074 // information about the structure. |
| 1070 scoped_ptr<WebContentsTreeNode> node_; | 1075 scoped_ptr<WebContentsTreeNode> node_; |
| 1071 | 1076 |
| 1072 // SavePackage, lazily created. | 1077 // SavePackage, lazily created. |
| 1073 scoped_refptr<SavePackage> save_package_; | 1078 scoped_refptr<SavePackage> save_package_; |
| 1074 | 1079 |
| 1075 // Data for loading state ---------------------------------------------------- | 1080 // Data for loading state ---------------------------------------------------- |
| 1076 | 1081 |
| 1077 // Indicates whether we're currently loading a resource. | |
| 1078 bool is_loading_; | |
| 1079 | |
| 1080 // Indicates whether the current load is to a different document. Only valid | 1082 // Indicates whether the current load is to a different document. Only valid |
| 1081 // if is_loading_ is true. | 1083 // if is_loading_ is true. |
| 1082 bool is_load_to_different_document_; | 1084 bool is_load_to_different_document_; |
| 1083 | 1085 |
| 1084 // Indicates if the tab is considered crashed. | 1086 // Indicates if the tab is considered crashed. |
| 1085 base::TerminationStatus crashed_status_; | 1087 base::TerminationStatus crashed_status_; |
| 1086 int crashed_error_code_; | 1088 int crashed_error_code_; |
| 1087 | 1089 |
| 1088 // Whether this WebContents is waiting for a first-response for the | 1090 // Whether this WebContents is waiting for a first-response for the |
| 1089 // main resource of the page. This controls whether the throbber state is | 1091 // main resource of the page. This controls whether the throbber state is |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1327 // Adds/removes a callback called on creation of each new WebContents. | 1329 // Adds/removes a callback called on creation of each new WebContents. |
| 1328 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1330 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1329 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1331 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1330 | 1332 |
| 1331 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1333 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1332 }; | 1334 }; |
| 1333 | 1335 |
| 1334 } // namespace content | 1336 } // namespace content |
| 1335 | 1337 |
| 1336 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1338 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |