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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 void RenderFrameForInterstitialPageCreated( | 699 void RenderFrameForInterstitialPageCreated( |
700 RenderFrameHost* render_frame_host) override; | 700 RenderFrameHost* render_frame_host) override; |
701 | 701 |
702 // Sets the passed interstitial as the currently showing interstitial. | 702 // Sets the passed interstitial as the currently showing interstitial. |
703 // No interstitial page should already be attached. | 703 // No interstitial page should already be attached. |
704 void AttachInterstitialPage(InterstitialPageImpl* interstitial_page) override; | 704 void AttachInterstitialPage(InterstitialPageImpl* interstitial_page) override; |
705 | 705 |
706 // Unsets the currently showing interstitial. | 706 // Unsets the currently showing interstitial. |
707 void DetachInterstitialPage() override; | 707 void DetachInterstitialPage() override; |
708 | 708 |
709 // Changes the IsLoading state and notifies the delegate as needed. | 709 // Unpause the throbber if it was paused. |
710 // |details| is used to provide details on the load that just finished | 710 void DidProceedOnInterstitial() override; |
711 // (but can be null if not applicable). | |
712 void SetIsLoading(bool is_loading, | |
713 bool to_different_document, | |
714 LoadNotificationDetails* details) override; | |
715 | 711 |
716 typedef base::Callback<void(WebContents*)> CreatedCallback; | 712 typedef base::Callback<void(WebContents*)> CreatedCallback; |
717 | 713 |
718 // Forces overscroll to be disabled (used by touch emulation). | 714 // Forces overscroll to be disabled (used by touch emulation). |
719 void SetForceDisableOverscrollContent(bool force_disable); | 715 void SetForceDisableOverscrollContent(bool force_disable); |
720 | 716 |
721 AudioStreamMonitor* audio_stream_monitor() { | 717 AudioStreamMonitor* audio_stream_monitor() { |
722 return &audio_stream_monitor_; | 718 return &audio_stream_monitor_; |
723 } | 719 } |
724 | 720 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 // |preferred_size_for_capture_| changes, to propagate the new value to the | 1005 // |preferred_size_for_capture_| changes, to propagate the new value to the |
1010 // |delegate_|. | 1006 // |delegate_|. |
1011 void OnPreferredSizeChanged(const gfx::Size& old_size); | 1007 void OnPreferredSizeChanged(const gfx::Size& old_size); |
1012 | 1008 |
1013 // Internal helper to create WebUI objects associated with |this|. |url| is | 1009 // Internal helper to create WebUI objects associated with |this|. |url| is |
1014 // used to determine which WebUI should be created (if any). |frame_name| | 1010 // used to determine which WebUI should be created (if any). |frame_name| |
1015 // corresponds to the name of a frame that the WebUI should be created for (or | 1011 // corresponds to the name of a frame that the WebUI should be created for (or |
1016 // the main frame if empty). | 1012 // the main frame if empty). |
1017 WebUI* CreateWebUI(const GURL& url, const std::string& frame_name); | 1013 WebUI* CreateWebUI(const GURL& url, const std::string& frame_name); |
1018 | 1014 |
| 1015 // Notifies the delegate of a change in loading state. |
| 1016 // |details| is used to provide details on the load that just finished |
| 1017 // (but can be null if not applicable). |
| 1018 // |pause_throbber_for_interstitial_| will be used to update |
| 1019 // pause_throbber_for_interstitial_. |
| 1020 void LoadingStateChanged(bool is_loading, |
| 1021 bool to_different_document, |
| 1022 bool pause_throbber_for_interstitial, |
| 1023 LoadNotificationDetails* details); |
| 1024 |
1019 // Data for core operation --------------------------------------------------- | 1025 // Data for core operation --------------------------------------------------- |
1020 | 1026 |
1021 // Delegate for notifying our owner about stuff. Not owned by us. | 1027 // Delegate for notifying our owner about stuff. Not owned by us. |
1022 WebContentsDelegate* delegate_; | 1028 WebContentsDelegate* delegate_; |
1023 | 1029 |
1024 // Handles the back/forward list and loading. | 1030 // Handles the back/forward list and loading. |
1025 NavigationControllerImpl controller_; | 1031 NavigationControllerImpl controller_; |
1026 | 1032 |
1027 // The corresponding view. | 1033 // The corresponding view. |
1028 scoped_ptr<WebContentsView> view_; | 1034 scoped_ptr<WebContentsView> view_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 | 1072 |
1067 // 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 |
1068 // information about the structure. | 1074 // information about the structure. |
1069 scoped_ptr<WebContentsTreeNode> node_; | 1075 scoped_ptr<WebContentsTreeNode> node_; |
1070 | 1076 |
1071 // SavePackage, lazily created. | 1077 // SavePackage, lazily created. |
1072 scoped_refptr<SavePackage> save_package_; | 1078 scoped_refptr<SavePackage> save_package_; |
1073 | 1079 |
1074 // Data for loading state ---------------------------------------------------- | 1080 // Data for loading state ---------------------------------------------------- |
1075 | 1081 |
1076 // Indicates whether we're currently loading a resource. | |
1077 bool is_loading_; | |
1078 | |
1079 // 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 |
1080 // if is_loading_ is true. | 1083 // if is_loading_ is true. |
1081 bool is_load_to_different_document_; | 1084 bool is_load_to_different_document_; |
1082 | 1085 |
1083 // Indicates if the tab is considered crashed. | 1086 // Indicates if the tab is considered crashed. |
1084 base::TerminationStatus crashed_status_; | 1087 base::TerminationStatus crashed_status_; |
1085 int crashed_error_code_; | 1088 int crashed_error_code_; |
1086 | 1089 |
1087 // Whether this WebContents is waiting for a first-response for the | 1090 // Whether this WebContents is waiting for a first-response for the |
1088 // 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 13 matching lines...) Expand all Loading... |
1102 | 1105 |
1103 // Upload progress, for displaying in the status bar. | 1106 // Upload progress, for displaying in the status bar. |
1104 // Set to zero when there is no significant upload happening. | 1107 // Set to zero when there is no significant upload happening. |
1105 uint64_t upload_size_; | 1108 uint64_t upload_size_; |
1106 uint64_t upload_position_; | 1109 uint64_t upload_position_; |
1107 | 1110 |
1108 // Tracks that this WebContents needs to unblock requests to the renderer. | 1111 // Tracks that this WebContents needs to unblock requests to the renderer. |
1109 // See ResumeLoadingCreatedWebContents. | 1112 // See ResumeLoadingCreatedWebContents. |
1110 bool is_resume_pending_; | 1113 bool is_resume_pending_; |
1111 | 1114 |
| 1115 // Whether the throbber is suspended while an interstial page is showing. |
| 1116 // This is set to false when the user proceeds in the interstitial. |
| 1117 bool paused_throbber_for_interstitial_; |
| 1118 |
1112 // Data for current page ----------------------------------------------------- | 1119 // Data for current page ----------------------------------------------------- |
1113 | 1120 |
1114 // When a title cannot be taken from any entry, this title will be used. | 1121 // When a title cannot be taken from any entry, this title will be used. |
1115 base::string16 page_title_when_no_navigation_entry_; | 1122 base::string16 page_title_when_no_navigation_entry_; |
1116 | 1123 |
1117 // When a navigation occurs, we record its contents MIME type. It can be | 1124 // When a navigation occurs, we record its contents MIME type. It can be |
1118 // used to check whether we can do something for some special contents. | 1125 // used to check whether we can do something for some special contents. |
1119 std::string contents_mime_type_; | 1126 std::string contents_mime_type_; |
1120 | 1127 |
1121 // The last reported character encoding, not canonicalized. | 1128 // The last reported character encoding, not canonicalized. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 // Adds/removes a callback called on creation of each new WebContents. | 1333 // Adds/removes a callback called on creation of each new WebContents. |
1327 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); | 1334 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); |
1328 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); | 1335 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); |
1329 | 1336 |
1330 DISALLOW_COPY_AND_ASSIGN(FriendZone); | 1337 DISALLOW_COPY_AND_ASSIGN(FriendZone); |
1331 }; | 1338 }; |
1332 | 1339 |
1333 } // namespace content | 1340 } // namespace content |
1334 | 1341 |
1335 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ | 1342 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ |
OLD | NEW |