| 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/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
| 10 #include "ash/system/bluetooth/bluetooth_observer.h" | 10 #include "ash/system/bluetooth/bluetooth_observer.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); | 222 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); |
| 223 if (crosnet) { | 223 if (crosnet) { |
| 224 crosnet->RemoveNetworkManagerObserver(this); | 224 crosnet->RemoveNetworkManagerObserver(this); |
| 225 crosnet->RemoveCellularDataPlanObserver(this); | 225 crosnet->RemoveCellularDataPlanObserver(this); |
| 226 } | 226 } |
| 227 input_method::InputMethodManager::GetInstance()->RemoveObserver(this); | 227 input_method::InputMethodManager::GetInstance()->RemoveObserver(this); |
| 228 system::TimezoneSettings::GetInstance()->RemoveObserver(this); | 228 system::TimezoneSettings::GetInstance()->RemoveObserver(this); |
| 229 if (SystemKeyEventListener::GetInstance()) | 229 if (SystemKeyEventListener::GetInstance()) |
| 230 SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this); | 230 SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this); |
| 231 bluetooth_adapter_->RemoveObserver(this); | 231 bluetooth_adapter_->RemoveObserver(this); |
| 232 |
| 233 // Stop observing gdata operations. |
| 234 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 235 if (gdata::util::IsGDataAvailable(profile)) { |
| 236 GDataSystemService* system_service = |
| 237 GDataSystemServiceFactory::FindForProfile(profile); |
| 238 if (system_service && system_service->file_system()) { |
| 239 system_service->file_system()->GetOperationRegistry()-> |
| 240 RemoveObserver(this); |
| 241 } |
| 242 } |
| 232 } | 243 } |
| 233 | 244 |
| 234 // Overridden from ash::SystemTrayDelegate: | 245 // Overridden from ash::SystemTrayDelegate: |
| 235 virtual bool GetTrayVisibilityOnStartup() OVERRIDE { | 246 virtual bool GetTrayVisibilityOnStartup() OVERRIDE { |
| 236 return !chromeos::KioskModeSettings::Get()->IsKioskModeEnabled(); | 247 return !chromeos::KioskModeSettings::Get()->IsKioskModeEnabled(); |
| 237 } | 248 } |
| 238 | 249 |
| 239 virtual const string16 GetUserDisplayName() const OVERRIDE { | 250 virtual const string16 GetUserDisplayName() const OVERRIDE { |
| 240 return UserManager::Get()->GetLoggedInUser().GetDisplayName(); | 251 return UserManager::Get()->GetLoggedInUser().GetDisplayName(); |
| 241 } | 252 } |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1235 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1225 }; | 1236 }; |
| 1226 | 1237 |
| 1227 } // namespace | 1238 } // namespace |
| 1228 | 1239 |
| 1229 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 1240 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
| 1230 return new chromeos::SystemTrayDelegate(tray); | 1241 return new chromeos::SystemTrayDelegate(tray); |
| 1231 } | 1242 } |
| 1232 | 1243 |
| 1233 } // namespace chromeos | 1244 } // namespace chromeos |
| OLD | NEW |