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

Side by Side Diff: chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc

Issue 532623003: Remove MetricsServiceObserver in favor of MetricsProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN build. Created 6 years, 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/metrics/chrome_browser_main_extra_parts_metrics.h" 5 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/cpu.h" 11 #include "base/cpu.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/metrics/sparse_histogram.h" 13 #include "base/metrics/sparse_histogram.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "base/threading/sequenced_worker_pool.h" 15 #include "base/threading/sequenced_worker_pool.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/about_flags.h" 17 #include "chrome/browser/about_flags.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/chrome_browser_main.h" 19 #include "chrome/browser/chrome_browser_main.h"
20 #include "chrome/browser/chrome_browser_metrics_service_observer.h"
21 #include "chrome/browser/mac/bluetooth_utility.h" 20 #include "chrome/browser/mac/bluetooth_utility.h"
22 #include "chrome/browser/pref_service_flags_storage.h" 21 #include "chrome/browser/pref_service_flags_storage.h"
23 #include "chrome/browser/shell_integration.h" 22 #include "chrome/browser/shell_integration.h"
24 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
25 #include "ui/base/touch/touch_device.h" 24 #include "ui/base/touch/touch_device.h"
26 #include "ui/base/ui_base_switches.h" 25 #include "ui/base/ui_base_switches.h"
27 #include "ui/events/event_switches.h" 26 #include "ui/events/event_switches.h"
28 27
29 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 28 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
30 #include <gnu/libc-version.h> 29 #include <gnu/libc-version.h>
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() { 226 void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() {
228 RecordLinuxGlibcVersion(); 227 RecordLinuxGlibcVersion();
229 RecordLinuxWindowManager(); 228 RecordLinuxWindowManager();
230 RecordTouchEventState(); 229 RecordTouchEventState();
231 230
232 const int kStartupMetricsGatheringDelaySeconds = 45; 231 const int kStartupMetricsGatheringDelaySeconds = 45;
233 content::BrowserThread::GetBlockingPool()->PostDelayedTask( 232 content::BrowserThread::GetBlockingPool()->PostDelayedTask(
234 FROM_HERE, 233 FROM_HERE,
235 base::Bind(&RecordStartupMetricsOnBlockingPool), 234 base::Bind(&RecordStartupMetricsOnBlockingPool),
236 base::TimeDelta::FromSeconds(kStartupMetricsGatheringDelaySeconds)); 235 base::TimeDelta::FromSeconds(kStartupMetricsGatheringDelaySeconds));
237
238 // Create the metrics log observer.
239 // We only need this for Android for now.
240 #if defined(ANDROID)
241 metrics_service_observer_.reset(new ChromeBrowserMetricsServiceObserver());
242 #endif
243 } 236 }
244 237
245 namespace chrome { 238 namespace chrome {
246 239
247 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { 240 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) {
248 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); 241 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics());
249 } 242 }
250 243
251 } // namespace chrome 244 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698