| 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> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" |
| 11 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 12 #include "base/task_scheduler/post_task.h" | 13 #include "base/task_scheduler/post_task.h" |
| 13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/grit/chromium_strings.h" | 16 #include "chrome/grit/chromium_strings.h" |
| 16 #include "components/crash/content/app/breakpad_linux.h" | 17 #include "components/crash/content/app/breakpad_linux.h" |
| 17 #include "components/metrics/metrics_service.h" | 18 #include "components/metrics/metrics_service.h" |
| 18 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 19 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
| 19 #include "device/bluetooth/dbus/dbus_thread_manager_linux.h" | 20 #include "device/bluetooth/dbus/dbus_thread_manager_linux.h" |
| 20 #include "media/audio/audio_manager.h" | 21 #include "media/audio/audio_manager.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 22 | 23 |
| 23 #if !defined(OS_CHROMEOS) | 24 #if !defined(OS_CHROMEOS) |
| 24 #include "base/command_line.h" | 25 #include "base/command_line.h" |
| 25 #include "base/linux_util.h" | 26 #include "base/linux_util.h" |
| 27 #include "chrome/common/chrome_paths_internal.h" |
| 26 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 27 #include "components/os_crypt/os_crypt.h" | 29 #include "components/os_crypt/os_crypt.h" |
| 28 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
| 29 #endif | 31 #endif |
| 30 | 32 |
| 31 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( | 33 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( |
| 32 const content::MainFunctionParams& parameters) | 34 const content::MainFunctionParams& parameters) |
| 33 : ChromeBrowserMainPartsPosix(parameters) { | 35 : ChromeBrowserMainPartsPosix(parameters) { |
| 34 } | 36 } |
| 35 | 37 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 62 // Forward to os_crypt the flag to use a specific password store. | 64 // Forward to os_crypt the flag to use a specific password store. |
| 63 OSCrypt::SetStore( | 65 OSCrypt::SetStore( |
| 64 parsed_command_line().GetSwitchValueASCII(switches::kPasswordStore)); | 66 parsed_command_line().GetSwitchValueASCII(switches::kPasswordStore)); |
| 65 // Forward the product name | 67 // Forward the product name |
| 66 OSCrypt::SetProductName(l10n_util::GetStringUTF8(IDS_PRODUCT_NAME)); | 68 OSCrypt::SetProductName(l10n_util::GetStringUTF8(IDS_PRODUCT_NAME)); |
| 67 // OSCrypt may target keyring, which requires calls from the main thread. | 69 // OSCrypt may target keyring, which requires calls from the main thread. |
| 68 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner( | 70 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner( |
| 69 content::BrowserThread::GetTaskRunnerForThread( | 71 content::BrowserThread::GetTaskRunnerForThread( |
| 70 content::BrowserThread::UI)); | 72 content::BrowserThread::UI)); |
| 71 OSCrypt::SetMainThreadRunner(main_thread_runner); | 73 OSCrypt::SetMainThreadRunner(main_thread_runner); |
| 74 // OSCrypt can be disabled in a special settings file. |
| 75 OSCrypt::ShouldUsePreference( |
| 76 parsed_command_line().HasSwitch(switches::kEnableEncryptionSelection)); |
| 77 base::FilePath user_data_dir; |
| 78 chrome::GetDefaultUserDataDirectory(&user_data_dir); |
| 79 OSCrypt::SetUserDataPath(user_data_dir); |
| 72 #endif | 80 #endif |
| 73 | 81 |
| 74 ChromeBrowserMainPartsPosix::PreProfileInit(); | 82 ChromeBrowserMainPartsPosix::PreProfileInit(); |
| 75 } | 83 } |
| 76 | 84 |
| 77 void ChromeBrowserMainPartsLinux::PostProfileInit() { | 85 void ChromeBrowserMainPartsLinux::PostProfileInit() { |
| 78 ChromeBrowserMainPartsPosix::PostProfileInit(); | 86 ChromeBrowserMainPartsPosix::PostProfileInit(); |
| 79 | 87 |
| 80 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 88 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
| 81 breakpad::IsCrashReporterEnabled()); | 89 breakpad::IsCrashReporterEnabled()); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 92 } | 100 } |
| 93 | 101 |
| 94 void ChromeBrowserMainPartsLinux::PostDestroyThreads() { | 102 void ChromeBrowserMainPartsLinux::PostDestroyThreads() { |
| 95 #if !defined(OS_CHROMEOS) | 103 #if !defined(OS_CHROMEOS) |
| 96 bluez::BluezDBusManager::Shutdown(); | 104 bluez::BluezDBusManager::Shutdown(); |
| 97 bluez::DBusThreadManagerLinux::Shutdown(); | 105 bluez::DBusThreadManagerLinux::Shutdown(); |
| 98 #endif | 106 #endif |
| 99 | 107 |
| 100 ChromeBrowserMainPartsPosix::PostDestroyThreads(); | 108 ChromeBrowserMainPartsPosix::PostDestroyThreads(); |
| 101 } | 109 } |
| OLD | NEW |