OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/chrome_browser_main_chromeos.h" | 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { | 269 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { |
270 // To be precise, logout (browser shutdown) is not yet done, but the | 270 // To be precise, logout (browser shutdown) is not yet done, but the |
271 // remaining work is negligible, hence we say LogoutDone here. | 271 // remaining work is negligible, hence we say LogoutDone here. |
272 BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", false); | 272 BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", false); |
273 BootTimesLoader::Get()->WriteLogoutTimes(); | 273 BootTimesLoader::Get()->WriteLogoutTimes(); |
274 } | 274 } |
275 | 275 |
276 // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides --------- | 276 // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides --------- |
277 | 277 |
278 void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() { | 278 void ChromeBrowserMainPartsChromeos::PreEarlyInitialization() { |
279 CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); | 279 base::CommandLine* singleton_command_line = |
| 280 base::CommandLine::ForCurrentProcess(); |
280 | 281 |
281 if (parsed_command_line().HasSwitch(switches::kGuestSession)) { | 282 if (parsed_command_line().HasSwitch(switches::kGuestSession)) { |
282 // Disable sync and extensions if we're in "browse without sign-in" mode. | 283 // Disable sync and extensions if we're in "browse without sign-in" mode. |
283 singleton_command_line->AppendSwitch(::switches::kDisableSync); | 284 singleton_command_line->AppendSwitch(::switches::kDisableSync); |
284 singleton_command_line->AppendSwitch(::switches::kDisableExtensions); | 285 singleton_command_line->AppendSwitch(::switches::kDisableExtensions); |
285 browser_defaults::bookmarks_enabled = false; | 286 browser_defaults::bookmarks_enabled = false; |
286 } | 287 } |
287 | 288 |
288 // If we're not running on real Chrome OS hardware (or under VM), and are not | 289 // If we're not running on real Chrome OS hardware (or under VM), and are not |
289 // showing the login manager or attempting a command line login, login with a | 290 // showing the login manager or attempting a command line login, login with a |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 // Guest user profile is never initialized with locale settings, | 588 // Guest user profile is never initialized with locale settings, |
588 // so we need special handling for Guest session. | 589 // so we need special handling for Guest session. |
589 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) | 590 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) |
590 SetGuestLocale(profile()); | 591 SetGuestLocale(profile()); |
591 | 592 |
592 peripheral_battery_observer_.reset(new PeripheralBatteryObserver()); | 593 peripheral_battery_observer_.reset(new PeripheralBatteryObserver()); |
593 | 594 |
594 renderer_freezer_.reset( | 595 renderer_freezer_.reset( |
595 new RendererFreezer(scoped_ptr<RendererFreezer::Delegate>( | 596 new RendererFreezer(scoped_ptr<RendererFreezer::Delegate>( |
596 new FreezerCgroupProcessManager()))); | 597 new FreezerCgroupProcessManager()))); |
597 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets)) | 598 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 599 switches::kWakeOnPackets)) |
598 light_bar_.reset(new LightBar()); | 600 light_bar_.reset(new LightBar()); |
599 | 601 |
600 g_browser_process->platform_part()->InitializeAutomaticRebootManager(); | 602 g_browser_process->platform_part()->InitializeAutomaticRebootManager(); |
601 g_browser_process->platform_part()->InitializeDeviceDisablingManager(); | 603 g_browser_process->platform_part()->InitializeDeviceDisablingManager(); |
602 | 604 |
603 // This observer cannot be created earlier because it requires the shell to be | 605 // This observer cannot be created earlier because it requires the shell to be |
604 // available. | 606 // available. |
605 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); | 607 idle_action_warning_observer_.reset(new IdleActionWarningObserver()); |
606 | 608 |
607 ChromeBrowserMainPartsLinux::PostProfileInit(); | 609 ChromeBrowserMainPartsLinux::PostProfileInit(); |
(...skipping 29 matching lines...) Expand all Loading... |
637 | 639 |
638 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 640 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
639 // -- immediately after ChildProcess::WaitForDebugger(). | 641 // -- immediately after ChildProcess::WaitForDebugger(). |
640 | 642 |
641 // Start the out-of-memory priority manager here so that we give the most | 643 // Start the out-of-memory priority manager here so that we give the most |
642 // amount of time for the other services to start up before we start | 644 // amount of time for the other services to start up before we start |
643 // adjusting the oom priority. | 645 // adjusting the oom priority. |
644 g_browser_process->platform_part()->oom_priority_manager()->Start(); | 646 g_browser_process->platform_part()->oom_priority_manager()->Start(); |
645 | 647 |
646 if (ui::ShouldDefaultToNaturalScroll()) { | 648 if (ui::ShouldDefaultToNaturalScroll()) { |
647 CommandLine::ForCurrentProcess()->AppendSwitch( | 649 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
648 chromeos::switches::kNaturalScrollDefault); | 650 chromeos::switches::kNaturalScrollDefault); |
649 system::InputDeviceSettings::Get()->SetTapToClick(true); | 651 system::InputDeviceSettings::Get()->SetTapToClick(true); |
650 } | 652 } |
651 | 653 |
652 ChromeBrowserMainPartsLinux::PreBrowserStart(); | 654 ChromeBrowserMainPartsLinux::PreBrowserStart(); |
653 } | 655 } |
654 | 656 |
655 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { | 657 void ChromeBrowserMainPartsChromeos::PostBrowserStart() { |
656 // These are dependent on the ash::Shell singleton already having been | 658 // These are dependent on the ash::Shell singleton already having been |
657 // initialized. | 659 // initialized. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 // Destroy DBus services immediately after threads are stopped. | 797 // Destroy DBus services immediately after threads are stopped. |
796 dbus_services_.reset(); | 798 dbus_services_.reset(); |
797 | 799 |
798 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 800 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
799 | 801 |
800 // Destroy DeviceSettingsService after g_browser_process. | 802 // Destroy DeviceSettingsService after g_browser_process. |
801 DeviceSettingsService::Shutdown(); | 803 DeviceSettingsService::Shutdown(); |
802 } | 804 } |
803 | 805 |
804 } // namespace chromeos | 806 } // namespace chromeos |
OLD | NEW |