Introduce ProfilerMetricsProvider
[chromium-blink-merge.git] / chrome / browser / chrome_browser_main_linux.cc
blobdba10a3cbad56ceb615b7263d03a142003dc24fa
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
3 // found in the LICENSE file.
5 #include "chrome/browser/chrome_browser_main_linux.h"
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/metrics/metrics_service.h"
9 #include "components/breakpad/app/breakpad_linux.h"
11 #if !defined(OS_CHROMEOS)
12 #include "base/linux_util.h"
13 #include "chrome/browser/sxs_linux.h"
14 #include "content/public/browser/browser_thread.h"
15 #endif
17 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux(
18 const content::MainFunctionParams& parameters)
19 : ChromeBrowserMainPartsPosix(parameters) {
22 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() {
25 void ChromeBrowserMainPartsLinux::PreProfileInit() {
26 #if !defined(OS_CHROMEOS)
27 // Needs to be called after we have chrome::DIR_USER_DATA and
28 // g_browser_process. This happens in PreCreateThreads.
29 // base::GetLinuxDistro() will initialize its value if needed.
30 content::BrowserThread::PostBlockingPoolTask(
31 FROM_HERE,
32 base::Bind(base::IgnoreResult(&base::GetLinuxDistro)));
34 content::BrowserThread::PostBlockingPoolTask(
35 FROM_HERE,
36 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir));
37 #endif
39 ChromeBrowserMainPartsPosix::PreProfileInit();
42 void ChromeBrowserMainPartsLinux::PostProfileInit() {
43 ChromeBrowserMainPartsPosix::PostProfileInit();
45 g_browser_process->metrics_service()->RecordBreakpadRegistration(
46 breakpad::IsCrashReporterEnabled());