OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
Georges Khalil
2016/09/14 16:10:17
nit: 2016.
Patrick Monette
2016/09/16 00:14:00
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_METRICS_TAB_USAGE_RECORDER_H_ | |
6 #define CHROME_BROWSER_METRICS_TAB_USAGE_RECORDER_H_ | |
7 | |
8 #include <map> | |
9 #include <memory> | |
10 | |
11 #include "chrome/browser/ui/browser_list_observer.h" | |
12 | |
13 namespace metrics { | |
14 | |
15 // This class is used to record metrics about tab reactivation. Specifically, | |
16 // it records the number of time a tab is deactivated and reactivated. The | |
Georges Khalil
2016/09/14 16:10:17
nit: s/time/times.
Patrick Monette
2016/09/16 00:14:00
Done.
| |
17 // ratio of both can be calculated for tabs with different properties (e.g. If | |
18 // the tab is pinned to the tab strip) to see if they are correlated with higher | |
19 // probability of tab reactivation. | |
20 class TabUsageRecorder : public chrome::BrowserListObserver { | |
21 public: | |
22 static void Initialize(); | |
23 | |
24 TabUsageRecorder(); | |
Georges Khalil
2016/09/14 16:10:17
Make this private?
Patrick Monette
2016/09/16 00:14:00
Done.
| |
25 ~TabUsageRecorder(); | |
Georges Khalil
2016/09/14 16:10:17
Add override.
Patrick Monette
2016/09/16 00:14:00
Done.
| |
26 | |
27 // chrome::BrowserListObserver: | |
28 void OnBrowserAdded(Browser* browser) override; | |
29 void OnBrowserRemoved(Browser* browser) override; | |
Georges Khalil
2016/09/14 16:10:17
Use BrowserTabStripTracker instead.
Patrick Monette
2016/09/16 00:14:00
Done.
I needed to change the TabStripModelObserve
Georges Khalil
2016/09/16 18:58:35
AFAIK, the tracker should be a drop in replacement
Patrick Monette
2016/09/19 17:47:12
I meant adding a TabStripModel* parameter to the i
| |
30 | |
31 private: | |
32 class TabStripObserver; | |
33 | |
34 std::map<Browser*, std::unique_ptr<TabStripObserver>> tab_strip_observer_map_; | |
Georges Khalil
2016/09/14 16:10:17
Comment this member. I don't see its usefulness, w
Patrick Monette
2016/09/16 00:14:00
No longer applicable as I removed it.
| |
35 }; | |
Georges Khalil
2016/09/14 16:10:17
Disallow copy.
Patrick Monette
2016/09/16 00:14:00
Done.
| |
36 | |
37 } // namespace metrics | |
38 | |
39 #endif // CHROME_BROWSER_METRICS_TAB_USAGE_RECORDER_H_ | |
OLD | NEW |