OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chrome_browser_main_linux.h" | 5 #include "chrome/browser/chrome_browser_main_linux.h" |
6 | 6 |
7 #include <fontconfig/fontconfig.h> | 7 #include <fontconfig/fontconfig.h> |
8 | 8 |
9 #include <string> | |
10 | |
11 #include "build/build_config.h" | 9 #include "build/build_config.h" |
12 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
13 #include "chrome/grit/chromium_strings.h" | 11 #include "chrome/grit/chromium_strings.h" |
14 #include "components/crash/content/app/breakpad_linux.h" | 12 #include "components/crash/content/app/breakpad_linux.h" |
15 #include "components/metrics/metrics_service.h" | 13 #include "components/metrics/metrics_service.h" |
16 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 14 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
17 #include "device/bluetooth/dbus/dbus_thread_manager_linux.h" | 15 #include "device/bluetooth/dbus/dbus_thread_manager_linux.h" |
18 #include "media/audio/audio_manager.h" | 16 #include "media/audio/audio_manager.h" |
19 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
20 | 18 |
21 #if !defined(OS_CHROMEOS) | 19 #if !defined(OS_CHROMEOS) |
22 #include "base/command_line.h" | |
23 #include "base/linux_util.h" | 20 #include "base/linux_util.h" |
24 #include "chrome/common/chrome_switches.h" | |
25 #include "components/os_crypt/os_crypt.h" | |
26 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
27 #endif | 22 #endif |
28 | 23 |
29 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( | 24 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( |
30 const content::MainFunctionParams& parameters) | 25 const content::MainFunctionParams& parameters) |
31 : ChromeBrowserMainPartsPosix(parameters) { | 26 : ChromeBrowserMainPartsPosix(parameters) { |
32 } | 27 } |
33 | 28 |
34 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { | 29 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { |
35 } | 30 } |
(...skipping 21 matching lines...) Expand all Loading... |
57 l10n_util::GetStringUTF8(IDS_SHORT_PRODUCT_NAME)); | 52 l10n_util::GetStringUTF8(IDS_SHORT_PRODUCT_NAME)); |
58 | 53 |
59 ChromeBrowserMainPartsPosix::PreProfileInit(); | 54 ChromeBrowserMainPartsPosix::PreProfileInit(); |
60 } | 55 } |
61 | 56 |
62 void ChromeBrowserMainPartsLinux::PostProfileInit() { | 57 void ChromeBrowserMainPartsLinux::PostProfileInit() { |
63 ChromeBrowserMainPartsPosix::PostProfileInit(); | 58 ChromeBrowserMainPartsPosix::PostProfileInit(); |
64 | 59 |
65 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 60 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
66 breakpad::IsCrashReporterEnabled()); | 61 breakpad::IsCrashReporterEnabled()); |
67 | |
68 #if !defined(OS_CHROMEOS) | |
69 // Forward to os_crypt the flag to use a specific password store. | |
70 std::string password_store = | |
71 parsed_command_line().GetSwitchValueASCII(switches::kPasswordStore); | |
72 OSCrypt::SetStore(password_store); | |
73 #endif | |
74 } | 62 } |
75 | 63 |
76 void ChromeBrowserMainPartsLinux::PostMainMessageLoopStart() { | 64 void ChromeBrowserMainPartsLinux::PostMainMessageLoopStart() { |
77 #if !defined(OS_CHROMEOS) | 65 #if !defined(OS_CHROMEOS) |
78 bluez::DBusThreadManagerLinux::Initialize(); | 66 bluez::DBusThreadManagerLinux::Initialize(); |
79 bluez::BluezDBusManager::Initialize( | 67 bluez::BluezDBusManager::Initialize( |
80 bluez::DBusThreadManagerLinux::Get()->GetSystemBus(), false); | 68 bluez::DBusThreadManagerLinux::Get()->GetSystemBus(), false); |
81 #endif | 69 #endif |
82 | 70 |
83 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); | 71 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); |
84 } | 72 } |
85 | 73 |
86 void ChromeBrowserMainPartsLinux::PostDestroyThreads() { | 74 void ChromeBrowserMainPartsLinux::PostDestroyThreads() { |
87 #if !defined(OS_CHROMEOS) | 75 #if !defined(OS_CHROMEOS) |
88 bluez::BluezDBusManager::Shutdown(); | 76 bluez::BluezDBusManager::Shutdown(); |
89 bluez::DBusThreadManagerLinux::Shutdown(); | 77 bluez::DBusThreadManagerLinux::Shutdown(); |
90 #endif | 78 #endif |
91 | 79 |
92 ChromeBrowserMainPartsPosix::PostDestroyThreads(); | 80 ChromeBrowserMainPartsPosix::PostDestroyThreads(); |
93 } | 81 } |
OLD | NEW |