| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profile_startup.h" | 5 #include "chrome/browser/chromeos/profile_startup.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 10 #include "chrome/browser/chromeos/cros/network_library.h" | 10 #include "chrome/browser/chromeos/cros/network_library.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Initialize Chrome OS preferences like touch pad sensitivity. For the | 26 // Initialize Chrome OS preferences like touch pad sensitivity. For the |
| 27 // preferences to work in the guest mode, the initialization has to be | 27 // preferences to work in the guest mode, the initialization has to be |
| 28 // done after |profile| is switched to the incognito profile (which | 28 // done after |profile| is switched to the incognito profile (which |
| 29 // is actually GuestSessionProfile in the guest mode). See the | 29 // is actually GuestSessionProfile in the guest mode). See the |
| 30 // GetOffTheRecordProfile() call above. | 30 // GetOffTheRecordProfile() call above. |
| 31 profile->InitChromeOSPreferences(); | 31 profile->InitChromeOSPreferences(); |
| 32 | 32 |
| 33 if (process_startup) { | 33 if (process_startup) { |
| 34 // These observers are singletons. They are never deleted but the pointers | 34 // These observers are singletons. They are never deleted but the pointers |
| 35 // are kept in a statics so that they are not reported as leaks. | 35 // are kept in a statics so that they are not reported as leaks. |
| 36 if (CommandLine::ForCurrentProcess()->HasSwitch( | 36 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 37 ash::switches::kAshNotifyDisabled)) { | 37 ash::switches::kAshNotify)) { |
| 38 static chromeos::LowBatteryObserver* low_battery_observer = | 38 static chromeos::LowBatteryObserver* low_battery_observer = |
| 39 new chromeos::LowBatteryObserver(profile); | 39 new chromeos::LowBatteryObserver(profile); |
| 40 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( | 40 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( |
| 41 low_battery_observer); | 41 low_battery_observer); |
| 42 } | 42 } |
| 43 | 43 |
| 44 static chromeos::NetworkMessageObserver* network_message_observer = | 44 static chromeos::NetworkMessageObserver* network_message_observer = |
| 45 new chromeos::NetworkMessageObserver(profile); | 45 new chromeos::NetworkMessageObserver(profile); |
| 46 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 46 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
| 47 AddNetworkManagerObserver(network_message_observer); | 47 AddNetworkManagerObserver(network_message_observer); |
| 48 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 48 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
| 49 AddCellularDataPlanObserver(network_message_observer); | 49 AddCellularDataPlanObserver(network_message_observer); |
| 50 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 50 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
| 51 AddUserActionObserver(network_message_observer); | 51 AddUserActionObserver(network_message_observer); |
| 52 | 52 |
| 53 static chromeos::SmsObserver* sms_observer = | 53 static chromeos::SmsObserver* sms_observer = |
| 54 new chromeos::SmsObserver(profile); | 54 new chromeos::SmsObserver(profile); |
| 55 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 55 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
| 56 AddNetworkManagerObserver(sms_observer); | 56 AddNetworkManagerObserver(sms_observer); |
| 57 | 57 |
| 58 profile->SetupChromeOSEnterpriseExtensionObserver(); | 58 profile->SetupChromeOSEnterpriseExtensionObserver(); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace chromeos | 62 } // namespace chromeos |
| OLD | NEW |