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 |
9 #include "build/build_config.h" | 11 #include "build/build_config.h" |
10 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
11 #include "chrome/grit/chromium_strings.h" | 13 #include "chrome/grit/chromium_strings.h" |
12 #include "components/crash/content/app/breakpad_linux.h" | 14 #include "components/crash/content/app/breakpad_linux.h" |
13 #include "components/metrics/metrics_service.h" | 15 #include "components/metrics/metrics_service.h" |
14 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 16 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
15 #include "device/bluetooth/dbus/dbus_thread_manager_linux.h" | 17 #include "device/bluetooth/dbus/dbus_thread_manager_linux.h" |
16 #include "media/audio/audio_manager.h" | 18 #include "media/audio/audio_manager.h" |
17 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
18 | 20 |
19 #if !defined(OS_CHROMEOS) | 21 #if !defined(OS_CHROMEOS) |
| 22 #include "base/command_line.h" |
20 #include "base/linux_util.h" | 23 #include "base/linux_util.h" |
| 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "components/os_crypt/os_crypt.h" |
21 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
22 #endif | 27 #endif |
23 | 28 |
24 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( | 29 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( |
25 const content::MainFunctionParams& parameters) | 30 const content::MainFunctionParams& parameters) |
26 : ChromeBrowserMainPartsPosix(parameters) { | 31 : ChromeBrowserMainPartsPosix(parameters) { |
27 } | 32 } |
28 | 33 |
29 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { | 34 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { |
30 } | 35 } |
(...skipping 21 matching lines...) Expand all Loading... |
52 l10n_util::GetStringUTF8(IDS_SHORT_PRODUCT_NAME)); | 57 l10n_util::GetStringUTF8(IDS_SHORT_PRODUCT_NAME)); |
53 | 58 |
54 ChromeBrowserMainPartsPosix::PreProfileInit(); | 59 ChromeBrowserMainPartsPosix::PreProfileInit(); |
55 } | 60 } |
56 | 61 |
57 void ChromeBrowserMainPartsLinux::PostProfileInit() { | 62 void ChromeBrowserMainPartsLinux::PostProfileInit() { |
58 ChromeBrowserMainPartsPosix::PostProfileInit(); | 63 ChromeBrowserMainPartsPosix::PostProfileInit(); |
59 | 64 |
60 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 65 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
61 breakpad::IsCrashReporterEnabled()); | 66 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 // !defined(OS_CHROMEOS) |
62 } | 74 } |
63 | 75 |
64 void ChromeBrowserMainPartsLinux::PostMainMessageLoopStart() { | 76 void ChromeBrowserMainPartsLinux::PostMainMessageLoopStart() { |
65 #if !defined(OS_CHROMEOS) | 77 #if !defined(OS_CHROMEOS) |
66 bluez::DBusThreadManagerLinux::Initialize(); | 78 bluez::DBusThreadManagerLinux::Initialize(); |
67 bluez::BluezDBusManager::Initialize( | 79 bluez::BluezDBusManager::Initialize( |
68 bluez::DBusThreadManagerLinux::Get()->GetSystemBus(), false); | 80 bluez::DBusThreadManagerLinux::Get()->GetSystemBus(), false); |
69 #endif | 81 #endif |
70 | 82 |
71 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); | 83 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); |
72 } | 84 } |
73 | 85 |
74 void ChromeBrowserMainPartsLinux::PostDestroyThreads() { | 86 void ChromeBrowserMainPartsLinux::PostDestroyThreads() { |
75 #if !defined(OS_CHROMEOS) | 87 #if !defined(OS_CHROMEOS) |
76 bluez::BluezDBusManager::Shutdown(); | 88 bluez::BluezDBusManager::Shutdown(); |
77 bluez::DBusThreadManagerLinux::Shutdown(); | 89 bluez::DBusThreadManagerLinux::Shutdown(); |
78 #endif | 90 #endif |
79 | 91 |
80 ChromeBrowserMainPartsPosix::PostDestroyThreads(); | 92 ChromeBrowserMainPartsPosix::PostDestroyThreads(); |
81 } | 93 } |
OLD | NEW |