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 <fontconfig/fontconfig.h>
9 #include "chrome/browser/browser_process.h"
10 #include "components/crash/app/breakpad_linux.h"
11 #include "components/metrics/metrics_service.h"
13 #if !defined(OS_CHROMEOS)
14 #include "base/linux_util.h"
15 #include "chrome/browser/sxs_linux.h"
16 #include "content/public/browser/browser_thread.h"
19 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux(
20 const content::MainFunctionParams
& parameters
)
21 : ChromeBrowserMainPartsPosix(parameters
) {
24 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() {
27 void ChromeBrowserMainPartsLinux::ToolkitInitialized() {
28 // Explicitly initialize Fontconfig early on to prevent races later due to
29 // implicit initialization in response to threads' first calls to Fontconfig:
30 // http://crbug.com/404311
33 ChromeBrowserMainPartsPosix::ToolkitInitialized();
36 void ChromeBrowserMainPartsLinux::PreProfileInit() {
37 #if !defined(OS_CHROMEOS)
38 // Needs to be called after we have chrome::DIR_USER_DATA and
39 // g_browser_process. This happens in PreCreateThreads.
40 // base::GetLinuxDistro() will initialize its value if needed.
41 content::BrowserThread::PostBlockingPoolTask(
43 base::Bind(base::IgnoreResult(&base::GetLinuxDistro
)));
45 content::BrowserThread::PostBlockingPoolTask(
47 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir
));
50 ChromeBrowserMainPartsPosix::PreProfileInit();
53 void ChromeBrowserMainPartsLinux::PostProfileInit() {
54 ChromeBrowserMainPartsPosix::PostProfileInit();
56 g_browser_process
->metrics_service()->RecordBreakpadRegistration(
57 breakpad::IsCrashReporterEnabled());