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 // |pause_throbber_for_interstitial_| will be used to update | |
| 1020 // pause_throbber_for_interstitial_. | |
| 1021 void LoadingStateChanged(bool is_loading, | |
| 1022 bool to_different_document, | |
| 1023 bool pause_throbber_for_interstitial, | |
| 1024 LoadNotificationDetails* details); | |
| 1025 | |
| 1020 // Data for core operation --------------------------------------------------- | 1026 // Data for core operation --------------------------------------------------- |
| 1021 | 1027 |
| 1022 // Delegate for notifying our owner about stuff. Not owned by us. | 1028 // Delegate for notifying our owner about stuff. Not owned by us. |
| 1023 WebContentsDelegate* delegate_; | 1029 WebContentsDelegate* delegate_; |
| 1024 | 1030 |
| 1025 // Handles the back/forward list and loading. | 1031 // Handles the back/forward list and loading. |
| 1026 NavigationControllerImpl controller_; | 1032 NavigationControllerImpl controller_; |
| 1027 | 1033 |
| 1028 // The corresponding view. | 1034 // The corresponding view. |
| 1029 scoped_ptr<WebContentsView> view_; | 1035 scoped_ptr<WebContentsView> view_; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1067 | 1073 |
| 1068 // If this WebContents is part of a "tree of WebContents", then this contains | 1074 // If this WebContents is part of a "tree of WebContents", then this contains |
| 1069 // information about the structure. | 1075 // information about the structure. |
| 1070 scoped_ptr<WebContentsTreeNode> node_; | 1076 scoped_ptr<WebContentsTreeNode> node_; |
| 1071 | 1077 |
| 1072 // SavePackage, lazily created. | 1078 // SavePackage, lazily created. |
| 1073 scoped_refptr<SavePackage> save_package_; | 1079 scoped_refptr<SavePackage> save_package_; |
| 1074 | 1080 |
| 1075 // Data for loading state ---------------------------------------------------- | 1081 // Data for loading state ---------------------------------------------------- |
| 1076 | 1082 |
| 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 | 1083 // Indicates whether the current load is to a different document. Only valid |
| 1081 // if is_loading_ is true. | 1084 // if is_loading_ is true. |
| 1082 bool is_load_to_different_document_; | 1085 bool is_load_to_different_document_; |
| 1083 | 1086 |
| 1084 // Indicates if the tab is considered crashed. | 1087 // Indicates if the tab is considered crashed. |
| 1085 base::TerminationStatus crashed_status_; | 1088 base::TerminationStatus crashed_status_; |
| 1086 int crashed_error_code_; | 1089 int crashed_error_code_; |
| 1087 | 1090 |
| 1088 // Whether this WebContents is waiting for a first-response for the | 1091 // Whether this WebContents is waiting for a first-response for the |
| 1089 // main resource of the page. This controls whether the throbber state is | 1092 // main resource of the page. This controls whether the throbber state is |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 1103 | 1106 |
| 1104 // Upload progress, for displaying in the status bar. | 1107 // Upload progress, for displaying in the status bar. |
| 1105 // Set to zero when there is no significant upload happening. | 1108 // Set to zero when there is no significant upload happening. |
| 1106 uint64_t upload_size_; | 1109 uint64_t upload_size_; |
| 1107 uint64_t upload_position_; | 1110 uint64_t upload_position_; |
| 1108 | 1111 |
| 1109 // Tracks that this WebContents needs to unblock requests to the renderer. | 1112 // Tracks that this WebContents needs to unblock requests to the renderer. |
| 1110 // See ResumeLoadingCreatedWebContents. | 1113 // See ResumeLoadingCreatedWebContents. |
| 1111 bool is_resume_pending_; | 1114 bool is_resume_pending_; |
| 1112 | 1115 |
| 1116 // Whether the throbber is suspended while an interstial page is showing. | |
| 1117 // This is set to false when the user proceeds in the interstitial. | |
| 1118 bool paused_throbber_for_interstitial_; | |
|
Charlie Reis
2016/02/17 05:15:28
Again, I'm not sure if this is an improvement. is
clamy
2016/02/17 14:42:06
Now that I think about it, it should be possible t
Charlie Reis
2016/02/17 23:34:26
Yes, that sounds a bit nicer.
clamy
2016/02/18 17:20:26
Done.
| |
| 1119 | |
| 1113 // Data for current page ----------------------------------------------------- | 1120 // Data for current page ----------------------------------------------------- |
| 1114 | 1121 |
| 1115 // When a title cannot be taken from any entry, this title will be used. | 1122 // When a title cannot be taken from any entry, this title will be used. |
| 1116 base::string16 page_title_when_no_navigation_entry_; | 1123 base::string16 page_title_when_no_navigation_entry_; |
| 1117 | 1124 |
| 1118 // When a navigation occurs, we record its contents MIME type. It can be | 1125 // When a navigation occurs, we record its contents MIME type. It can be |
| 1119 // used to check whether we can do something for some special contents. | 1126 // used to check whether we can do something for some special contents. |
| 1120 std::string contents_mime_type_; | 1127 std::string contents_mime_type_; |
| 1121 | 1128 |
| 1122 // The last reported character encoding, not canonicalized. | 1129 // The last reported character encoding, not canonicalized. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1327 // Adds/removes a callback called on creation of each new WebContents. | 1334 // Adds/removes a callback called on creation of each new WebContents. |
| 1328 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1335 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1329 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1336 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
| 1330 | 1337 |
| 1331 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1338 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
| 1332 }; | 1339 }; |
| 1333 | 1340 |
| 1334 } // namespace content | 1341 } // namespace content |
| 1335 | 1342 |
| 1336 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1343 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
| OLD | NEW |