Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / chrome_browser_main_linux.cc
blob4f4e4abd69d6f68d8dd6d5ab9ac2268afa29a764
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 "chrome/grit/chromium_strings.h"
11 #include "components/crash/app/breakpad_linux.h"
12 #include "components/metrics/metrics_service.h"
13 #include "media/audio/audio_manager.h"
14 #include "ui/base/l10n/l10n_util.h"
16 #if !defined(OS_CHROMEOS)
17 #include "base/linux_util.h"
18 #include "chrome/browser/sxs_linux.h"
19 #include "content/public/browser/browser_thread.h"
20 #endif
22 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux(
23 const content::MainFunctionParams& parameters)
24 : ChromeBrowserMainPartsPosix(parameters) {
27 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() {
30 void ChromeBrowserMainPartsLinux::ToolkitInitialized() {
31 // Explicitly initialize Fontconfig early on to prevent races later due to
32 // implicit initialization in response to threads' first calls to Fontconfig:
33 // http://crbug.com/404311
34 FcInit();
36 ChromeBrowserMainPartsPosix::ToolkitInitialized();
39 void ChromeBrowserMainPartsLinux::PreProfileInit() {
40 #if !defined(OS_CHROMEOS)
41 // Needs to be called after we have chrome::DIR_USER_DATA and
42 // g_browser_process. This happens in PreCreateThreads.
43 // base::GetLinuxDistro() will initialize its value if needed.
44 content::BrowserThread::PostBlockingPoolTask(
45 FROM_HERE,
46 base::Bind(base::IgnoreResult(&base::GetLinuxDistro)));
48 content::BrowserThread::PostBlockingPoolTask(
49 FROM_HERE,
50 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir));
51 #endif
53 media::AudioManager::SetGlobalAppName(
54 l10n_util::GetStringUTF8(IDS_SHORT_PRODUCT_NAME));
56 ChromeBrowserMainPartsPosix::PreProfileInit();
59 void ChromeBrowserMainPartsLinux::PostProfileInit() {
60 ChromeBrowserMainPartsPosix::PostProfileInit();
62 g_browser_process->metrics_service()->RecordBreakpadRegistration(
63 breakpad::IsCrashReporterEnabled());