| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 #include "base/nss_util.h" | 137 #include "base/nss_util.h" |
| 138 #endif | 138 #endif |
| 139 | 139 |
| 140 #if defined(TOOLKIT_VIEWS) | 140 #if defined(TOOLKIT_VIEWS) |
| 141 #include "chrome/browser/views/chrome_views_delegate.h" | 141 #include "chrome/browser/views/chrome_views_delegate.h" |
| 142 #include "views/focus/accelerator_handler.h" | 142 #include "views/focus/accelerator_handler.h" |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 #if defined(OS_CHROMEOS) | 145 #if defined(OS_CHROMEOS) |
| 146 #include "chrome/browser/chromeos/cros/cros_library.h" | 146 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 147 #include "chrome/browser/chromeos/cros/fake/fake_cryptohome_library.h" | |
| 148 #include "chrome/browser/chromeos/cros/fake/fake_input_method_library.h" | |
| 149 #include "chrome/browser/chromeos/cros/fake/fake_keyboard_library.h" | |
| 150 #include "chrome/browser/chromeos/cros/fake/fake_library_loader.h" | |
| 151 #include "chrome/browser/chromeos/cros/fake/fake_login_library.h" | |
| 152 #include "chrome/browser/chromeos/cros/fake/fake_mount_library.h" | |
| 153 #include "chrome/browser/chromeos/cros/fake/fake_network_library.h" | |
| 154 #include "chrome/browser/chromeos/cros/fake/fake_screen_lock_library.h" | |
| 155 #include "chrome/browser/chromeos/cros/fake/fake_synaptics_library.h" | |
| 156 #include "chrome/browser/chromeos/cros/fake/fake_system_library.h" | |
| 157 #include "chrome/browser/chromeos/cros/fake/fake_power_library.h" | |
| 158 #include "chrome/browser/chromeos/cros/fake/fake_update_library.h" | |
| 159 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 147 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| 160 #include "chrome/browser/chromeos/customization_document.h" | 148 #include "chrome/browser/chromeos/customization_document.h" |
| 161 #include "chrome/browser/chromeos/external_metrics.h" | 149 #include "chrome/browser/chromeos/external_metrics.h" |
| 162 #include "chrome/browser/chromeos/login/screen_locker.h" | 150 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 163 #include "chrome/browser/chromeos/login/user_manager.h" | 151 #include "chrome/browser/chromeos/login/user_manager.h" |
| 164 #include "chrome/browser/views/browser_dialogs.h" | 152 #include "chrome/browser/views/browser_dialogs.h" |
| 165 #endif | 153 #endif |
| 166 | 154 |
| 167 // BrowserMainParts ------------------------------------------------------------ | 155 // BrowserMainParts ------------------------------------------------------------ |
| 168 | 156 |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 "now to avoid profile corruption."; | 972 "now to avoid profile corruption."; |
| 985 return ResultCodes::PROFILE_IN_USE; | 973 return ResultCodes::PROFILE_IN_USE; |
| 986 | 974 |
| 987 default: | 975 default: |
| 988 NOTREACHED(); | 976 NOTREACHED(); |
| 989 } | 977 } |
| 990 #if !defined(OS_MACOSX) // closing brace for if | 978 #if !defined(OS_MACOSX) // closing brace for if |
| 991 } | 979 } |
| 992 #endif | 980 #endif |
| 993 | 981 |
| 994 #if defined(OS_CHROMEOS) | |
| 995 // Install a "fake" version of libcros if specified. | |
| 996 if (parsed_command_line.HasSwitch(switches::kUseFakeLibcros)) { | |
| 997 chromeos::CrosLibrary::TestApi* test_api = | |
| 998 chromeos::CrosLibrary::Get()->GetTestApi(); | |
| 999 test_api->SetLibraryLoader(new chromeos::FakeLibraryLoader, true); | |
| 1000 test_api->SetSynapticsLibrary(new chromeos::FakeSynapticsLibrary, true); | |
| 1001 test_api->SetInputMethodLibrary(new chromeos::FakeInputMethodLibrary, true); | |
| 1002 test_api->SetKeyboardLibrary(new chromeos::FakeKeyboardLibrary, true); | |
| 1003 test_api->SetNetworkLibrary(new chromeos::FakeNetworkLibrary, true); | |
| 1004 test_api->SetPowerLibrary(new chromeos::FakePowerLibrary, true); | |
| 1005 test_api->SetSystemLibrary(new chromeos::FakeSystemLibrary, true); | |
| 1006 test_api->SetLoginLibrary(new chromeos::FakeLoginLibrary, true); | |
| 1007 test_api->SetCryptohomeLibrary(new chromeos::FakeCryptohomeLibrary, true); | |
| 1008 test_api->SetScreenLockLibrary(new chromeos::FakeScreenLockLibrary, true); | |
| 1009 test_api->SetMountLibrary(new chromeos::FakeMountLibrary, true); | |
| 1010 test_api->SetUpdateLibrary(new chromeos::FakeUpdateLibrary, true); | |
| 1011 } | |
| 1012 #endif | |
| 1013 | |
| 1014 // Profile creation ---------------------------------------------------------- | 982 // Profile creation ---------------------------------------------------------- |
| 1015 | 983 |
| 1016 #if defined(OS_CHROMEOS) | 984 #if defined(OS_CHROMEOS) |
| 1017 // Initialize the screen locker now so that it can receive | 985 // Initialize the screen locker now so that it can receive |
| 1018 // LOGIN_USER_CHANGED notification from UserManager. | 986 // LOGIN_USER_CHANGED notification from UserManager. |
| 1019 chromeos::ScreenLocker::InitClass(); | 987 chromeos::ScreenLocker::InitClass(); |
| 1020 | 988 |
| 1021 // This forces the ProfileManager to be created and register for the | 989 // This forces the ProfileManager to be created and register for the |
| 1022 // notification it needs to track the logged in user. | 990 // notification it needs to track the logged in user. |
| 1023 g_browser_process->profile_manager()->GetDefaultProfile(); | 991 g_browser_process->profile_manager()->GetDefaultProfile(); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 | 1304 |
| 1337 metrics->Stop(); | 1305 metrics->Stop(); |
| 1338 | 1306 |
| 1339 // browser_shutdown takes care of deleting browser_process, so we need to | 1307 // browser_shutdown takes care of deleting browser_process, so we need to |
| 1340 // release it. | 1308 // release it. |
| 1341 ignore_result(browser_process.release()); | 1309 ignore_result(browser_process.release()); |
| 1342 browser_shutdown::Shutdown(); | 1310 browser_shutdown::Shutdown(); |
| 1343 | 1311 |
| 1344 return result_code; | 1312 return result_code; |
| 1345 } | 1313 } |
| OLD | NEW |