OLD | NEW |
1 // Copyright (c) 2012 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" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // Disable Num Lock on X start up for http://crosbug.com/29169. | 272 // Disable Num Lock on X start up for http://crosbug.com/29169. |
273 input_method::GetInputMethodManager()->GetXKeyboard()-> | 273 input_method::GetInputMethodManager()->GetXKeyboard()-> |
274 SetNumLockEnabled(false); | 274 SetNumLockEnabled(false); |
275 } | 275 } |
276 | 276 |
277 // Initialize the device settings service so that we'll take actions per | 277 // Initialize the device settings service so that we'll take actions per |
278 // signals sent from the session manager. | 278 // signals sent from the session manager. |
279 DeviceSettingsService::Get()->Initialize( | 279 DeviceSettingsService::Get()->Initialize( |
280 DBusThreadManager::Get()->GetSessionManagerClient(), | 280 DBusThreadManager::Get()->GetSessionManagerClient(), |
281 OwnerKeyUtil::Create()); | 281 OwnerKeyUtil::Create()); |
282 | |
283 // Add observers for WallpaperManager. This depends on PowerManagerClient(). | |
284 WallpaperManager::Get()->AddObservers(); | |
285 } | 282 } |
286 | 283 |
287 // TODO(stevenjb): Move this into DBusServices() once the switch is no | 284 // TODO(stevenjb): Move this into DBusServices() once the switch is no |
288 // longer required. (Switch is set in about_flags.cc and not applied until | 285 // longer required. (Switch is set in about_flags.cc and not applied until |
289 // after DBusServices() is called). | 286 // after DBusServices() is called). |
290 void InitializeNetworkHandlers() { | 287 void InitializeNetworkHandlers() { |
291 network_handlers_initialized_ = true; | 288 network_handlers_initialized_ = true; |
292 | 289 |
293 // Always initialize these handlers which should not conflict with | 290 // Always initialize these handlers which should not conflict with |
294 // NetworkLibrary. | 291 // NetworkLibrary. |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 529 |
533 if (!app_order_loader_) { | 530 if (!app_order_loader_) { |
534 app_order_loader_.reset( | 531 app_order_loader_.reset( |
535 new default_app_order::ExternalLoader(true /* async */)); | 532 new default_app_order::ExternalLoader(true /* async */)); |
536 } | 533 } |
537 | 534 |
538 // Initialize magnification manager before ash tray is created. And this must | 535 // Initialize magnification manager before ash tray is created. And this must |
539 // be placed after UserManager::SessionStarted(); | 536 // be placed after UserManager::SessionStarted(); |
540 chromeos::MagnificationManager::Initialize(); | 537 chromeos::MagnificationManager::Initialize(); |
541 | 538 |
| 539 // Add observers for WallpaperManager. This depends on PowerManagerClient, |
| 540 // TimezoneSettings and CrosSettings. |
| 541 WallpaperManager::Get()->AddObservers(); |
| 542 |
542 #if defined(USE_LINUX_BREAKPAD) | 543 #if defined(USE_LINUX_BREAKPAD) |
543 cros_version_loader_.GetVersion(VersionLoader::VERSION_FULL, | 544 cros_version_loader_.GetVersion(VersionLoader::VERSION_FULL, |
544 base::Bind(&ChromeOSVersionCallback), | 545 base::Bind(&ChromeOSVersionCallback), |
545 &tracker_); | 546 &tracker_); |
546 #endif | 547 #endif |
547 | 548 |
548 // In Aura builds this will initialize ash::Shell. | 549 // In Aura builds this will initialize ash::Shell. |
549 ChromeBrowserMainPartsLinux::PreProfileInit(); | 550 ChromeBrowserMainPartsLinux::PreProfileInit(); |
550 } | 551 } |
551 | 552 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 | 722 |
722 // Detach D-Bus clients before DBusThreadManager is shut down. | 723 // Detach D-Bus clients before DBusThreadManager is shut down. |
723 power_button_observer_.reset(); | 724 power_button_observer_.reset(); |
724 screen_dimming_observer_.reset(); | 725 screen_dimming_observer_.reset(); |
725 | 726 |
726 // Delete ContactManager while |g_browser_process| is still alive. | 727 // Delete ContactManager while |g_browser_process| is still alive. |
727 contact_manager_.reset(); | 728 contact_manager_.reset(); |
728 | 729 |
729 chromeos::MagnificationManager::Shutdown(); | 730 chromeos::MagnificationManager::Shutdown(); |
730 | 731 |
731 // Let the UserManager unregister itself as an observer of the CrosSettings | 732 // Let the UserManager and WallpaperManager unregister itself as an observer |
732 // singleton before it is destroyed. | 733 // of the CrosSettings singleton before it is destroyed. |
733 UserManager::Get()->Shutdown(); | 734 UserManager::Get()->Shutdown(); |
| 735 WallpaperManager::Get()->Shutdown(); |
734 | 736 |
735 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 737 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
736 } | 738 } |
737 | 739 |
738 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { | 740 void ChromeBrowserMainPartsChromeos::SetupPlatformFieldTrials() { |
739 SetupLowMemoryHeadroomFieldTrial(); | 741 SetupLowMemoryHeadroomFieldTrial(); |
740 SetupZramFieldTrial(); | 742 SetupZramFieldTrial(); |
741 } | 743 } |
742 | 744 |
743 void ChromeBrowserMainPartsChromeos::SetupLowMemoryHeadroomFieldTrial() { | 745 void ChromeBrowserMainPartsChromeos::SetupLowMemoryHeadroomFieldTrial() { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 trial->AppendGroup("2GB_RAM_3GB_swap", zram_group == '2' ? 1 : 0); | 825 trial->AppendGroup("2GB_RAM_3GB_swap", zram_group == '2' ? 1 : 0); |
824 trial->AppendGroup("4GB_RAM_no_swap", zram_group == '3' ? 1 : 0); | 826 trial->AppendGroup("4GB_RAM_no_swap", zram_group == '3' ? 1 : 0); |
825 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); | 827 trial->AppendGroup("4GB_RAM_4GB_swap", zram_group == '4' ? 1 : 0); |
826 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); | 828 trial->AppendGroup("4GB_RAM_6GB_swap", zram_group == '5' ? 1 : 0); |
827 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); | 829 trial->AppendGroup("snow_no_swap", zram_group == '6' ? 1 : 0); |
828 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); | 830 trial->AppendGroup("snow_1GB_swap", zram_group == '7' ? 1 : 0); |
829 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); | 831 trial->AppendGroup("snow_2GB_swap", zram_group == '8' ? 1 : 0); |
830 } | 832 } |
831 | 833 |
832 } // namespace chromeos | 834 } // namespace chromeos |
OLD | NEW |