Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 1545973002: Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed issue with tests Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 void RenderFrameForInterstitialPageCreated( 696 void RenderFrameForInterstitialPageCreated(
697 RenderFrameHost* render_frame_host) override; 697 RenderFrameHost* render_frame_host) override;
698 698
699 // Sets the passed interstitial as the currently showing interstitial. 699 // Sets the passed interstitial as the currently showing interstitial.
700 // No interstitial page should already be attached. 700 // No interstitial page should already be attached.
701 void AttachInterstitialPage(InterstitialPageImpl* interstitial_page) override; 701 void AttachInterstitialPage(InterstitialPageImpl* interstitial_page) override;
702 702
703 // Unsets the currently showing interstitial. 703 // Unsets the currently showing interstitial.
704 void DetachInterstitialPage() override; 704 void DetachInterstitialPage() override;
705 705
706 // Changes the IsLoading state and notifies the delegate as needed. 706 // Unpause the throbber if it was paused.
707 // |details| is used to provide details on the load that just finished 707 void DidProceedOnInterstitial() override;
708 // (but can be null if not applicable).
709 void SetIsLoading(bool is_loading,
710 bool to_different_document,
711 LoadNotificationDetails* details) override;
712 708
713 typedef base::Callback<void(WebContents*)> CreatedCallback; 709 typedef base::Callback<void(WebContents*)> CreatedCallback;
714 710
715 // Forces overscroll to be disabled (used by touch emulation). 711 // Forces overscroll to be disabled (used by touch emulation).
716 void SetForceDisableOverscrollContent(bool force_disable); 712 void SetForceDisableOverscrollContent(bool force_disable);
717 713
718 AudioStreamMonitor* audio_stream_monitor() { 714 AudioStreamMonitor* audio_stream_monitor() {
719 return &audio_stream_monitor_; 715 return &audio_stream_monitor_;
720 } 716 }
721 717
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 // |preferred_size_for_capture_| changes, to propagate the new value to the 1002 // |preferred_size_for_capture_| changes, to propagate the new value to the
1007 // |delegate_|. 1003 // |delegate_|.
1008 void OnPreferredSizeChanged(const gfx::Size& old_size); 1004 void OnPreferredSizeChanged(const gfx::Size& old_size);
1009 1005
1010 // Internal helper to create WebUI objects associated with |this|. |url| is 1006 // Internal helper to create WebUI objects associated with |this|. |url| is
1011 // used to determine which WebUI should be created (if any). |frame_name| 1007 // used to determine which WebUI should be created (if any). |frame_name|
1012 // corresponds to the name of a frame that the WebUI should be created for (or 1008 // corresponds to the name of a frame that the WebUI should be created for (or
1013 // the main frame if empty). 1009 // the main frame if empty).
1014 WebUI* CreateWebUI(const GURL& url, const std::string& frame_name); 1010 WebUI* CreateWebUI(const GURL& url, const std::string& frame_name);
1015 1011
1012 // Notifies the delegate of a change in loading state.
1013 // |details| is used to provide details on the load that just finished
1014 // (but can be null if not applicable).
1015 // |pause_throbber_for_interstitial_| will be used to update
1016 // pause_throbber_for_interstitial_.
1017 void LoadingStateChanged(bool is_loading,
1018 bool to_different_document,
1019 bool pause_throbber_for_interstitial,
1020 LoadNotificationDetails* details);
1021
1016 // Data for core operation --------------------------------------------------- 1022 // Data for core operation ---------------------------------------------------
1017 1023
1018 // Delegate for notifying our owner about stuff. Not owned by us. 1024 // Delegate for notifying our owner about stuff. Not owned by us.
1019 WebContentsDelegate* delegate_; 1025 WebContentsDelegate* delegate_;
1020 1026
1021 // Handles the back/forward list and loading. 1027 // Handles the back/forward list and loading.
1022 NavigationControllerImpl controller_; 1028 NavigationControllerImpl controller_;
1023 1029
1024 // The corresponding view. 1030 // The corresponding view.
1025 scoped_ptr<WebContentsView> view_; 1031 scoped_ptr<WebContentsView> view_;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 1069
1064 // If this WebContents is part of a "tree of WebContents", then this contains 1070 // If this WebContents is part of a "tree of WebContents", then this contains
1065 // information about the structure. 1071 // information about the structure.
1066 scoped_ptr<WebContentsTreeNode> node_; 1072 scoped_ptr<WebContentsTreeNode> node_;
1067 1073
1068 // SavePackage, lazily created. 1074 // SavePackage, lazily created.
1069 scoped_refptr<SavePackage> save_package_; 1075 scoped_refptr<SavePackage> save_package_;
1070 1076
1071 // Data for loading state ---------------------------------------------------- 1077 // Data for loading state ----------------------------------------------------
1072 1078
1073 // Indicates whether we're currently loading a resource.
1074 bool is_loading_;
1075
1076 // Indicates whether the current load is to a different document. Only valid 1079 // Indicates whether the current load is to a different document. Only valid
1077 // if is_loading_ is true. 1080 // if is_loading_ is true.
1078 bool is_load_to_different_document_; 1081 bool is_load_to_different_document_;
1079 1082
1080 // Indicates if the tab is considered crashed. 1083 // Indicates if the tab is considered crashed.
1081 base::TerminationStatus crashed_status_; 1084 base::TerminationStatus crashed_status_;
1082 int crashed_error_code_; 1085 int crashed_error_code_;
1083 1086
1084 // Whether this WebContents is waiting for a first-response for the 1087 // Whether this WebContents is waiting for a first-response for the
1085 // main resource of the page. This controls whether the throbber state is 1088 // main resource of the page. This controls whether the throbber state is
(...skipping 13 matching lines...) Expand all
1099 1102
1100 // Upload progress, for displaying in the status bar. 1103 // Upload progress, for displaying in the status bar.
1101 // Set to zero when there is no significant upload happening. 1104 // Set to zero when there is no significant upload happening.
1102 uint64_t upload_size_; 1105 uint64_t upload_size_;
1103 uint64_t upload_position_; 1106 uint64_t upload_position_;
1104 1107
1105 // Tracks that this WebContents needs to unblock requests to the renderer. 1108 // Tracks that this WebContents needs to unblock requests to the renderer.
1106 // See ResumeLoadingCreatedWebContents. 1109 // See ResumeLoadingCreatedWebContents.
1107 bool is_resume_pending_; 1110 bool is_resume_pending_;
1108 1111
1112 // Whether the throbber is suspended while an interstial page is showing.
1113 // This is set to false when the user proceeds in the interstitial.
1114 bool paused_throbber_for_interstitial_;
1115
1109 // Data for current page ----------------------------------------------------- 1116 // Data for current page -----------------------------------------------------
1110 1117
1111 // When a title cannot be taken from any entry, this title will be used. 1118 // When a title cannot be taken from any entry, this title will be used.
1112 base::string16 page_title_when_no_navigation_entry_; 1119 base::string16 page_title_when_no_navigation_entry_;
1113 1120
1114 // When a navigation occurs, we record its contents MIME type. It can be 1121 // When a navigation occurs, we record its contents MIME type. It can be
1115 // used to check whether we can do something for some special contents. 1122 // used to check whether we can do something for some special contents.
1116 std::string contents_mime_type_; 1123 std::string contents_mime_type_;
1117 1124
1118 // The last reported character encoding, not canonicalized. 1125 // The last reported character encoding, not canonicalized.
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 // Adds/removes a callback called on creation of each new WebContents. 1327 // Adds/removes a callback called on creation of each new WebContents.
1321 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1328 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1322 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1329 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1323 1330
1324 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1331 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1325 }; 1332 };
1326 1333
1327 } // namespace content 1334 } // namespace content
1328 1335
1329 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1336 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698