| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "chromeos/dbus/dbus_thread_manager.h" | 69 #include "chromeos/dbus/dbus_thread_manager.h" |
| 70 #include "chromeos/dbus/power_manager_client.h" | 70 #include "chromeos/dbus/power_manager_client.h" |
| 71 #include "chromeos/dbus/session_manager_client.h" | 71 #include "chromeos/dbus/session_manager_client.h" |
| 72 #include "content/public/browser/browser_thread.h" | 72 #include "content/public/browser/browser_thread.h" |
| 73 #include "content/public/browser/notification_observer.h" | 73 #include "content/public/browser/notification_observer.h" |
| 74 #include "content/public/browser/notification_service.h" | 74 #include "content/public/browser/notification_service.h" |
| 75 #include "content/public/browser/user_metrics.h" | 75 #include "content/public/browser/user_metrics.h" |
| 76 #include "grit/generated_resources.h" | 76 #include "grit/generated_resources.h" |
| 77 #include "ui/base/l10n/l10n_util.h" | 77 #include "ui/base/l10n/l10n_util.h" |
| 78 | 78 |
| 79 using gdata::DriveSystemService; | 79 using drive::DriveSystemService; |
| 80 using gdata::DriveSystemServiceFactory; | 80 using drive::DriveSystemServiceFactory; |
| 81 | 81 |
| 82 namespace chromeos { | 82 namespace chromeos { |
| 83 | 83 |
| 84 namespace { | 84 namespace { |
| 85 | 85 |
| 86 // Time delay for rechecking gdata operation when we suspect that there will | 86 // Time delay for rechecking gdata operation when we suspect that there will |
| 87 // be no upcoming activity notifications that need to be pushed to UI. | 87 // be no upcoming activity notifications that need to be pushed to UI. |
| 88 const int kGDataOperationRecheckDelayMs = 5000; | 88 const int kGDataOperationRecheckDelayMs = 5000; |
| 89 | 89 |
| 90 ash::NetworkIconInfo CreateNetworkIconInfo(const Network* network, | 90 ash::NetworkIconInfo CreateNetworkIconInfo(const Network* network, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 class SystemTrayDelegate : public ash::SystemTrayDelegate, | 145 class SystemTrayDelegate : public ash::SystemTrayDelegate, |
| 146 public AudioHandler::VolumeObserver, | 146 public AudioHandler::VolumeObserver, |
| 147 public PowerManagerClient::Observer, | 147 public PowerManagerClient::Observer, |
| 148 public SessionManagerClient::Observer, | 148 public SessionManagerClient::Observer, |
| 149 public NetworkMenuIcon::Delegate, | 149 public NetworkMenuIcon::Delegate, |
| 150 public NetworkMenu::Delegate, | 150 public NetworkMenu::Delegate, |
| 151 public NetworkLibrary::NetworkManagerObserver, | 151 public NetworkLibrary::NetworkManagerObserver, |
| 152 public NetworkLibrary::NetworkObserver, | 152 public NetworkLibrary::NetworkObserver, |
| 153 public NetworkLibrary::CellularDataPlanObserver, | 153 public NetworkLibrary::CellularDataPlanObserver, |
| 154 public gdata::DriveServiceObserver, | 154 public drive::DriveServiceObserver, |
| 155 public content::NotificationObserver, | 155 public content::NotificationObserver, |
| 156 public input_method::InputMethodManager::Observer, | 156 public input_method::InputMethodManager::Observer, |
| 157 public system::TimezoneSettings::Observer, | 157 public system::TimezoneSettings::Observer, |
| 158 public BluetoothAdapter::Observer, | 158 public BluetoothAdapter::Observer, |
| 159 public SystemKeyEventListener::CapsLockObserver, | 159 public SystemKeyEventListener::CapsLockObserver, |
| 160 public ash::NetworkTrayDelegate { | 160 public ash::NetworkTrayDelegate { |
| 161 public: | 161 public: |
| 162 explicit SystemTrayDelegate(ash::SystemTray* tray) | 162 explicit SystemTrayDelegate(ash::SystemTray* tray) |
| 163 : tray_(tray), | 163 : tray_(tray), |
| 164 ui_weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST( | 164 ui_weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST( |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 void RecheckGDataOperations() { | 1136 void RecheckGDataOperations() { |
| 1137 DriveSystemService* system_service = FindDriveSystemService(); | 1137 DriveSystemService* system_service = FindDriveSystemService(); |
| 1138 if (!system_service) | 1138 if (!system_service) |
| 1139 return; | 1139 return; |
| 1140 | 1140 |
| 1141 OnProgressUpdate(system_service->drive_service()->GetProgressStatusList()); | 1141 OnProgressUpdate(system_service->drive_service()->GetProgressStatusList()); |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 DriveSystemService* FindDriveSystemService() { | 1144 DriveSystemService* FindDriveSystemService() { |
| 1145 Profile* profile = ProfileManager::GetDefaultProfile(); | 1145 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 1146 if (!gdata::DriveSystemService::IsDriveEnabled(profile)) | 1146 if (!drive::DriveSystemService::IsDriveEnabled(profile)) |
| 1147 return NULL; | 1147 return NULL; |
| 1148 return DriveSystemServiceFactory::FindForProfile(profile); | 1148 return DriveSystemServiceFactory::FindForProfile(profile); |
| 1149 } | 1149 } |
| 1150 | 1150 |
| 1151 // Overridden from system::TimezoneSettings::Observer. | 1151 // Overridden from system::TimezoneSettings::Observer. |
| 1152 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE { | 1152 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE { |
| 1153 NotifyRefreshClock(); | 1153 NotifyRefreshClock(); |
| 1154 } | 1154 } |
| 1155 | 1155 |
| 1156 // Overridden from BluetoothAdapter::Observer. | 1156 // Overridden from BluetoothAdapter::Observer. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1261 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1262 }; | 1262 }; |
| 1263 | 1263 |
| 1264 } // namespace | 1264 } // namespace |
| 1265 | 1265 |
| 1266 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 1266 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
| 1267 return new chromeos::SystemTrayDelegate(tray); | 1267 return new chromeos::SystemTrayDelegate(tray); |
| 1268 } | 1268 } |
| 1269 | 1269 |
| 1270 } // namespace chromeos | 1270 } // namespace chromeos |
| OLD | NEW |