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