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

Side by Side Diff: chrome/browser/tab_contents/tab_contents.h

Issue 274057: Add histogram for how tab closing time. Did some cleanup along the way. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <map> 10 #include <map>
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 // We want to time how long it takes to create a new tab page. This method 616 // We want to time how long it takes to create a new tab page. This method
617 // gets called as parts of the new tab page have loaded. 617 // gets called as parts of the new tab page have loaded.
618 void LogNewTabTime(const std::string& event_name); 618 void LogNewTabTime(const std::string& event_name);
619 619
620 // Set the time when we started to create the new tab page. This time is 620 // Set the time when we started to create the new tab page. This time is
621 // from before we created this TabContents. 621 // from before we created this TabContents.
622 void set_new_tab_start_time(const base::TimeTicks& time) { 622 void set_new_tab_start_time(const base::TimeTicks& time) {
623 new_tab_start_time_ = time; 623 new_tab_start_time_ = time;
624 } 624 }
625 625
626 // Notification that tab closing has started. This can be called multiple
627 // times, subsequent calls are ignored.
628 void OnCloseStarted();
629
626 private: 630 private:
627 friend class NavigationController; 631 friend class NavigationController;
628 // Used to access the child_windows_ (ConstrainedWindowList) for testing 632 // Used to access the child_windows_ (ConstrainedWindowList) for testing
629 // automation purposes. 633 // automation purposes.
630 friend class AutomationProvider; 634 friend class AutomationProvider;
631 friend class BlockedPopupContainerTest; 635 friend class BlockedPopupContainerTest;
632 friend class BlockedPopupContainerControllerTest; 636 friend class BlockedPopupContainerControllerTest;
633 637
634 FRIEND_TEST(BlockedPopupContainerTest, TestReposition); 638 FRIEND_TEST(BlockedPopupContainerTest, TestReposition);
635 FRIEND_TEST(TabContentsTest, NoJSMessageOnInterstitials); 639 FRIEND_TEST(TabContentsTest, NoJSMessageOnInterstitials);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 const std::wstring& title); 863 const std::wstring& title);
860 virtual void UpdateEncoding(RenderViewHost* render_view_host, 864 virtual void UpdateEncoding(RenderViewHost* render_view_host,
861 const std::string& encoding); 865 const std::string& encoding);
862 virtual void UpdateTargetURL(int32 page_id, const GURL& url); 866 virtual void UpdateTargetURL(int32 page_id, const GURL& url);
863 virtual void UpdateThumbnail(const GURL& url, 867 virtual void UpdateThumbnail(const GURL& url,
864 const SkBitmap& bitmap, 868 const SkBitmap& bitmap,
865 const ThumbnailScore& score); 869 const ThumbnailScore& score);
866 virtual void UpdateInspectorSettings(const std::string& raw_settings); 870 virtual void UpdateInspectorSettings(const std::string& raw_settings);
867 virtual void Close(RenderViewHost* render_view_host); 871 virtual void Close(RenderViewHost* render_view_host);
868 virtual void RequestMove(const gfx::Rect& new_bounds); 872 virtual void RequestMove(const gfx::Rect& new_bounds);
869 virtual void DidStartLoading(RenderViewHost* render_view_host); 873 virtual void DidStartLoading();
870 virtual void DidStopLoading(RenderViewHost* render_view_host); 874 virtual void DidStopLoading();
871 virtual void RequestOpenURL(const GURL& url, const GURL& referrer, 875 virtual void RequestOpenURL(const GURL& url, const GURL& referrer,
872 WindowOpenDisposition disposition); 876 WindowOpenDisposition disposition);
873 virtual void DomOperationResponse(const std::string& json_string, 877 virtual void DomOperationResponse(const std::string& json_string,
874 int automation_id); 878 int automation_id);
875 virtual void ProcessDOMUIMessage(const std::string& message, 879 virtual void ProcessDOMUIMessage(const std::string& message,
876 const Value* content, 880 const Value* content,
877 int request_id, 881 int request_id,
878 bool has_callback); 882 bool has_callback);
879 virtual void ProcessExternalHostMessage(const std::string& message, 883 virtual void ProcessExternalHostMessage(const std::string& message,
880 const std::string& origin, 884 const std::string& origin,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 void* params); 925 void* params);
922 virtual void FileSelectionCanceled(void* params); 926 virtual void FileSelectionCanceled(void* params);
923 927
924 // RenderViewHostManager::Delegate ------------------------------------------- 928 // RenderViewHostManager::Delegate -------------------------------------------
925 929
926 virtual void BeforeUnloadFiredFromRenderManager( 930 virtual void BeforeUnloadFiredFromRenderManager(
927 bool proceed, 931 bool proceed,
928 bool* proceed_to_fire_unload); 932 bool* proceed_to_fire_unload);
929 virtual void DidStartLoadingFromRenderManager( 933 virtual void DidStartLoadingFromRenderManager(
930 RenderViewHost* render_view_host) { 934 RenderViewHost* render_view_host) {
931 DidStartLoading(render_view_host); 935 DidStartLoading();
932 } 936 }
933 virtual void RenderViewGoneFromRenderManager( 937 virtual void RenderViewGoneFromRenderManager(
934 RenderViewHost* render_view_host) { 938 RenderViewHost* render_view_host) {
935 RenderViewGone(render_view_host); 939 RenderViewGone(render_view_host);
936 } 940 }
937 virtual void UpdateRenderViewSizeForRenderManager(); 941 virtual void UpdateRenderViewSizeForRenderManager();
938 virtual void NotifySwappedFromRenderManager() { 942 virtual void NotifySwappedFromRenderManager() {
939 NotifySwapped(); 943 NotifySwapped();
940 } 944 }
941 virtual NavigationController& GetControllerForRenderManager() { 945 virtual NavigationController& GetControllerForRenderManager() {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 ScopedHandle message_box_active_; 1143 ScopedHandle message_box_active_;
1140 #endif 1144 #endif
1141 1145
1142 // The time that the last javascript message was dismissed. 1146 // The time that the last javascript message was dismissed.
1143 base::TimeTicks last_javascript_message_dismissal_; 1147 base::TimeTicks last_javascript_message_dismissal_;
1144 1148
1145 // True if the user has decided to block future javascript messages. This is 1149 // True if the user has decided to block future javascript messages. This is
1146 // reset on navigations to false on navigations. 1150 // reset on navigations to false on navigations.
1147 bool suppress_javascript_messages_; 1151 bool suppress_javascript_messages_;
1148 1152
1153 // Set to true when there is an active "before unload" dialog. When true,
1154 // we've forced the throbber to start in Navigate, and we need to remember to
1155 // turn it off in OnJavaScriptMessageBoxClosed if the navigation is canceled.
1156 bool is_showing_before_unload_dialog_;
1157
1149 // Shows an info-bar to users when they search from a known search engine and 1158 // Shows an info-bar to users when they search from a known search engine and
1150 // have never used the monibox for search before. 1159 // have never used the monibox for search before.
1151 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; 1160 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_;
1152 1161
1153 // Settings that get passed to the renderer process. 1162 // Settings that get passed to the renderer process.
1154 RendererPreferences renderer_preferences_; 1163 RendererPreferences renderer_preferences_;
1155 1164
1156 // If this tab was created from a renderer using window.open, this will be 1165 // If this tab was created from a renderer using window.open, this will be
1157 // non-NULL and represent the DOMUI of the opening renderer. 1166 // non-NULL and represent the DOMUI of the opening renderer.
1158 DOMUITypeID opener_dom_ui_type_; 1167 DOMUITypeID opener_dom_ui_type_;
1159 1168
1160 // The time that we started to create the new tab page. 1169 // The time that we started to create the new tab page.
1161 base::TimeTicks new_tab_start_time_; 1170 base::TimeTicks new_tab_start_time_;
1162 1171
1172 // The time that we started to close the tab.
1173 base::TimeTicks tab_close_start_time_;
1174
1163 // --------------------------------------------------------------------------- 1175 // ---------------------------------------------------------------------------
1164 1176
1165 DISALLOW_COPY_AND_ASSIGN(TabContents); 1177 DISALLOW_COPY_AND_ASSIGN(TabContents);
1166 }; 1178 };
1167 1179
1168 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 1180 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698