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 #include "chrome/browser/ui/uma_browsing_activity_observer.h" | 5 #include "chrome/browser/ui/uma_browsing_activity_observer.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_iterator.h" |
9 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
13 #include "content/public/browser/navigation_details.h" | 14 #include "content/public/browser/navigation_details.h" |
14 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
15 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
16 | 17 |
17 namespace chrome { | 18 namespace chrome { |
18 namespace { | 19 namespace { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 UMA_HISTOGRAM_CUSTOM_COUNTS("MPArch.RPHCountPerLoad", hosts_count, | 66 UMA_HISTOGRAM_CUSTOM_COUNTS("MPArch.RPHCountPerLoad", hosts_count, |
66 1, 50, 50); | 67 1, 50, 50); |
67 } | 68 } |
68 | 69 |
69 void UMABrowsingActivityObserver::LogBrowserTabCount() const { | 70 void UMABrowsingActivityObserver::LogBrowserTabCount() const { |
70 int tab_count = 0; | 71 int tab_count = 0; |
71 int app_window_count = 0; | 72 int app_window_count = 0; |
72 int panel_window_count = 0; | 73 int panel_window_count = 0; |
73 int popup_window_count = 0; | 74 int popup_window_count = 0; |
74 int tabbed_window_count = 0; | 75 int tabbed_window_count = 0; |
75 for (BrowserList::const_iterator browser_iterator = BrowserList::begin(); | 76 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
76 browser_iterator != BrowserList::end(); ++browser_iterator) { | |
77 // Record how many tabs each window has open. | 77 // Record how many tabs each window has open. |
78 Browser* browser = (*browser_iterator); | 78 Browser* browser = *it; |
79 UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.TabCountPerWindow", | 79 UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.TabCountPerWindow", |
80 browser->tab_strip_model()->count(), | 80 browser->tab_strip_model()->count(), |
81 1, 200, 50); | 81 1, 200, 50); |
82 tab_count += browser->tab_strip_model()->count(); | 82 tab_count += browser->tab_strip_model()->count(); |
83 | 83 |
84 if (browser->window()->IsActive()) { | 84 if (browser->window()->IsActive()) { |
85 // Record how many tabs the active window has open. | 85 // Record how many tabs the active window has open. |
86 UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.TabCountActiveWindow", | 86 UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.TabCountActiveWindow", |
87 browser->tab_strip_model()->count(), | 87 browser->tab_strip_model()->count(), |
88 1, 200, 50); | 88 1, 200, 50); |
(...skipping 16 matching lines...) Expand all Loading... |
105 app_window_count); | 105 app_window_count); |
106 UMA_HISTOGRAM_COUNTS_100("WindowManager.PanelWindowCountPerLoad", | 106 UMA_HISTOGRAM_COUNTS_100("WindowManager.PanelWindowCountPerLoad", |
107 panel_window_count); | 107 panel_window_count); |
108 UMA_HISTOGRAM_COUNTS_100("WindowManager.PopUpWindowCountPerLoad", | 108 UMA_HISTOGRAM_COUNTS_100("WindowManager.PopUpWindowCountPerLoad", |
109 popup_window_count); | 109 popup_window_count); |
110 UMA_HISTOGRAM_COUNTS_100("WindowManager.TabbedWindowCountPerLoad", | 110 UMA_HISTOGRAM_COUNTS_100("WindowManager.TabbedWindowCountPerLoad", |
111 tabbed_window_count); | 111 tabbed_window_count); |
112 } | 112 } |
113 | 113 |
114 } // namespace chrome | 114 } // namespace chrome |
OLD | NEW |