Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chrome_browser_main_linux.cc
blob9ae5ec058f9b40dce42f11f52c04fbf3c41929c5
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 <stdlib.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"
23 #endif
25 namespace {
27 #if !defined(OS_CHROMEOS)
28 void GetLinuxDistroCallback() {
29 base::GetLinuxDistro(); // Initialize base::linux_distro if needed.
31 #endif
33 } // namespace
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,
48 FROM_HERE,
49 base::Bind(&GetLinuxDistroCallback));
51 content::BrowserThread::PostTask(
52 content::BrowserThread::FILE,
53 FROM_HERE,
54 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir));
55 #endif
57 ChromeBrowserMainPartsPosix::PreProfileInit();
60 void ChromeBrowserMainPartsLinux::PostProfileInit() {
61 ChromeBrowserMainPartsPosix::PostProfileInit();
63 g_browser_process->metrics_service()->RecordBreakpadRegistration(
64 breakpad::IsCrashReporterEnabled());