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/shell.h" | 10 #include "ash/shell.h" |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 // Add observers for WallpaperManager. This depends on PowerManagerClient, | 537 // Add observers for WallpaperManager. This depends on PowerManagerClient, |
538 // TimezoneSettings and CrosSettings. | 538 // TimezoneSettings and CrosSettings. |
539 WallpaperManager::Get()->AddObservers(); | 539 WallpaperManager::Get()->AddObservers(); |
540 | 540 |
541 #if defined(USE_LINUX_BREAKPAD) | 541 #if defined(USE_LINUX_BREAKPAD) |
542 cros_version_loader_.GetVersion(VersionLoader::VERSION_FULL, | 542 cros_version_loader_.GetVersion(VersionLoader::VERSION_FULL, |
543 base::Bind(&ChromeOSVersionCallback), | 543 base::Bind(&ChromeOSVersionCallback), |
544 &tracker_); | 544 &tracker_); |
545 #endif | 545 #endif |
546 | 546 |
| 547 storage_monitor_ = new StorageMonitorCros(); |
| 548 |
547 // In Aura builds this will initialize ash::Shell. | 549 // In Aura builds this will initialize ash::Shell. |
548 ChromeBrowserMainPartsLinux::PreProfileInit(); | 550 ChromeBrowserMainPartsLinux::PreProfileInit(); |
549 } | 551 } |
550 | 552 |
551 void ChromeBrowserMainPartsChromeos::PostProfileInit() { | 553 void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
552 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 554 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
553 // -- just after CreateProfile(). | 555 // -- just after CreateProfile(). |
554 | 556 |
555 if (parsed_command_line().HasSwitch(::switches::kLoginUser) && | 557 if (parsed_command_line().HasSwitch(::switches::kLoginUser) && |
556 !parsed_command_line().HasSwitch(::switches::kLoginPassword)) { | 558 !parsed_command_line().HasSwitch(::switches::kLoginPassword)) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 switches::kEnableScreensaverExtensions)) { | 614 switches::kEnableScreensaverExtensions)) { |
613 screensaver_controller_.reset(new ScreensaverController()); | 615 screensaver_controller_.reset(new ScreensaverController()); |
614 } | 616 } |
615 suspend_observer_.reset(new SuspendObserver()); | 617 suspend_observer_.reset(new SuspendObserver()); |
616 if (KioskModeSettings::Get()->IsKioskModeEnabled()) { | 618 if (KioskModeSettings::Get()->IsKioskModeEnabled()) { |
617 power_state_override_ = new PowerStateOverride( | 619 power_state_override_ = new PowerStateOverride( |
618 PowerStateOverride::BLOCK_DISPLAY_SLEEP); | 620 PowerStateOverride::BLOCK_DISPLAY_SLEEP); |
619 } | 621 } |
620 chromeos::accessibility::Initialize(); | 622 chromeos::accessibility::Initialize(); |
621 | 623 |
622 storage_monitor_ = new StorageMonitorCros(); | 624 storage_monitor_->Init(); |
623 | 625 |
624 // Initialize the network portal detector for Chrome OS. The network | 626 // Initialize the network portal detector for Chrome OS. The network |
625 // portal detector starts to listen for notifications from | 627 // portal detector starts to listen for notifications from |
626 // NetworkLibrary about changes in the NetworkManager and initiates | 628 // NetworkLibrary about changes in the NetworkManager and initiates |
627 // captive portal detection for active networks. | 629 // captive portal detection for active networks. |
628 if (NetworkPortalDetector::IsEnabled() && | 630 if (NetworkPortalDetector::IsEnabled() && |
629 NetworkPortalDetector::GetInstance()) { | 631 NetworkPortalDetector::GetInstance()) { |
630 NetworkPortalDetector::GetInstance()->Init(); | 632 NetworkPortalDetector::GetInstance()->Init(); |
631 } | 633 } |
632 | 634 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 return; | 853 return; |
852 | 854 |
853 // If failed to launch, go back to login screen. | 855 // If failed to launch, go back to login screen. |
854 LOG(ERROR) << "Failed to launch kiosk app. Fall back to login screen"; | 856 LOG(ERROR) << "Failed to launch kiosk app. Fall back to login screen"; |
855 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile()); | 857 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile()); |
856 | 858 |
857 // TODO(xiyuan): Show error message. | 859 // TODO(xiyuan): Show error message. |
858 } | 860 } |
859 | 861 |
860 } // namespace chromeos | 862 } // namespace chromeos |
OLD | NEW |