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

Side by Side Diff: chrome/browser/ui/uma_browsing_activity_observer.cc

Issue 12212120: Replace most BrowserList::empty() and BrowserList::size() calls by multi-desktop aware calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r182110 Created 7 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 | 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 #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_finder.h"
9 #include "chrome/browser/ui/browser_iterator.h" 10 #include "chrome/browser/ui/browser_iterator.h"
10 #include "chrome/browser/ui/browser_list.h"
11 #include "chrome/browser/ui/browser_window.h" 11 #include "chrome/browser/ui/browser_window.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" 12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "chrome/common/chrome_notification_types.h" 13 #include "chrome/common/chrome_notification_types.h"
14 #include "content/public/browser/navigation_details.h" 14 #include "content/public/browser/navigation_details.h"
15 #include "content/public/browser/notification_service.h" 15 #include "content/public/browser/notification_service.h"
16 #include "content/public/browser/render_process_host.h" 16 #include "content/public/browser/render_process_host.h"
17 17
18 namespace chrome { 18 namespace chrome {
19 namespace { 19 namespace {
20 20
21 UMABrowsingActivityObserver* g_instance = NULL; 21 UMABrowsingActivityObserver* g_instance = NULL;
22 22
23 } // namespace 23 } // namespace
24 24
25 // static 25 // static
26 void UMABrowsingActivityObserver::Init() { 26 void UMABrowsingActivityObserver::Init() {
27 DCHECK(!g_instance); 27 DCHECK(!g_instance);
28 DCHECK(BrowserList::empty()); // Must be created before any Browsers are. 28 // Must be created before any Browsers are.
29 DCHECK_EQ(0U, chrome::GetTotalBrowserCount());
29 g_instance = new UMABrowsingActivityObserver; 30 g_instance = new UMABrowsingActivityObserver;
30 } 31 }
31 32
32 UMABrowsingActivityObserver::UMABrowsingActivityObserver() { 33 UMABrowsingActivityObserver::UMABrowsingActivityObserver() {
33 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, 34 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
34 content::NotificationService::AllSources()); 35 content::NotificationService::AllSources());
35 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, 36 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
36 content::NotificationService::AllSources()); 37 content::NotificationService::AllSources());
37 } 38 }
38 39
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 app_window_count); 106 app_window_count);
106 UMA_HISTOGRAM_COUNTS_100("WindowManager.PanelWindowCountPerLoad", 107 UMA_HISTOGRAM_COUNTS_100("WindowManager.PanelWindowCountPerLoad",
107 panel_window_count); 108 panel_window_count);
108 UMA_HISTOGRAM_COUNTS_100("WindowManager.PopUpWindowCountPerLoad", 109 UMA_HISTOGRAM_COUNTS_100("WindowManager.PopUpWindowCountPerLoad",
109 popup_window_count); 110 popup_window_count);
110 UMA_HISTOGRAM_COUNTS_100("WindowManager.TabbedWindowCountPerLoad", 111 UMA_HISTOGRAM_COUNTS_100("WindowManager.TabbedWindowCountPerLoad",
111 tabbed_window_count); 112 tabbed_window_count);
112 } 113 }
113 114
114 } // namespace chrome 115 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698