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

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

Issue 17571018: Reland fast tab closure behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, 2nd attempt to land. Created 7 years, 5 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) 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 CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/browser/web_contents_user_data.h" 10 #include "content/public/browser/web_contents_user_data.h"
(...skipping 13 matching lines...) Expand all
24 string16 GetStatusText() const; 24 string16 GetStatusText() const;
25 25
26 // Notification that tab closing has started. This can be called multiple 26 // Notification that tab closing has started. This can be called multiple
27 // times, subsequent calls are ignored. 27 // times, subsequent calls are ignored.
28 void OnCloseStarted(); 28 void OnCloseStarted();
29 29
30 // Notification that tab closing was cancelled. This can happen when a user 30 // Notification that tab closing was cancelled. This can happen when a user
31 // cancels a window close via another tab's beforeunload dialog. 31 // cancels a window close via another tab's beforeunload dialog.
32 void OnCloseCanceled(); 32 void OnCloseCanceled();
33 33
34 // Set the time during close when unload is started. Normally, this is set
35 // after the beforeunload dialog. However, for a window close, it is set
36 // after all the beforeunload dialogs have finished.
37 void OnUnloadStarted();
38
39 // Set the time during close when the tab is no longer visible.
40 void OnUnloadDetachedStarted();
41
34 CoreTabHelperDelegate* delegate() const { return delegate_; } 42 CoreTabHelperDelegate* delegate() const { return delegate_; }
35 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } 43 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; }
36 44
37 void set_new_tab_start_time(const base::TimeTicks& time) { 45 void set_new_tab_start_time(const base::TimeTicks& time) {
38 new_tab_start_time_ = time; 46 new_tab_start_time_ = time;
39 } 47 }
40 48
41 base::TimeTicks new_tab_start_time() const { return new_tab_start_time_; } 49 base::TimeTicks new_tab_start_time() const { return new_tab_start_time_; }
42 50
43 private: 51 private:
(...skipping 13 matching lines...) Expand all
57 // The time when we started to create the new tab page. This time is from 65 // The time when we started to create the new tab page. This time is from
58 // before we created this WebContents. 66 // before we created this WebContents.
59 base::TimeTicks new_tab_start_time_; 67 base::TimeTicks new_tab_start_time_;
60 68
61 // The time that we started to close this WebContents. 69 // The time that we started to close this WebContents.
62 base::TimeTicks close_start_time_; 70 base::TimeTicks close_start_time_;
63 71
64 // The time when onbeforeunload ended. 72 // The time when onbeforeunload ended.
65 base::TimeTicks before_unload_end_time_; 73 base::TimeTicks before_unload_end_time_;
66 74
75 // The time when the tab was removed from view during close.
76 base::TimeTicks unload_detached_start_time_;
77
67 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); 78 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper);
68 }; 79 };
69 80
70 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ 81 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698