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"
9 #include "base/command_line.h"
10 #include "base/linux_util.h"
11 #include "base/prefs/pref_service.h"
12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/metrics/metrics_service.h"
14 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/env_vars.h"
16 #include "chrome/common/pref_names.h"
17 #include "components/breakpad/app/breakpad_linux.h"
19 #if !defined(OS_CHROMEOS)
20 #include "chrome/browser/storage_monitor/storage_monitor_linux.h"
21 #include "chrome/browser/sxs_linux.h"
22 #include "content/public/browser/browser_thread.h"
27 #if !defined(OS_CHROMEOS)
28 void GetLinuxDistroCallback() {
29 base::GetLinuxDistro(); // Initialize base::linux_distro if needed.
35 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux(
36 const content::MainFunctionParams
& parameters
)
37 : ChromeBrowserMainPartsPosix(parameters
) {
40 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() {
43 void ChromeBrowserMainPartsLinux::PreProfileInit() {
44 #if !defined(OS_CHROMEOS)
45 // Needs to be called after we have chrome::DIR_USER_DATA and
46 // g_browser_process. This happens in PreCreateThreads.
47 content::BrowserThread::PostTask(content::BrowserThread::FILE,
49 base::Bind(&GetLinuxDistroCallback
));
51 content::BrowserThread::PostTask(
52 content::BrowserThread::FILE,
54 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir
));
57 ChromeBrowserMainPartsPosix::PreProfileInit();
60 void ChromeBrowserMainPartsLinux::PostProfileInit() {
61 ChromeBrowserMainPartsPosix::PostProfileInit();
63 g_browser_process
->metrics_service()->RecordBreakpadRegistration(
64 breakpad::IsCrashReporterEnabled());