| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 public NetworkMenu::Delegate, | 151 public NetworkMenu::Delegate, |
| 152 public NetworkLibrary::NetworkManagerObserver, | 152 public NetworkLibrary::NetworkManagerObserver, |
| 153 public NetworkLibrary::NetworkObserver, | 153 public NetworkLibrary::NetworkObserver, |
| 154 public NetworkLibrary::CellularDataPlanObserver, | 154 public NetworkLibrary::CellularDataPlanObserver, |
| 155 public gdata::OperationRegistry::Observer, | 155 public gdata::OperationRegistry::Observer, |
| 156 public content::NotificationObserver, | 156 public content::NotificationObserver, |
| 157 public input_method::InputMethodManager::Observer, | 157 public input_method::InputMethodManager::Observer, |
| 158 public system::TimezoneSettings::Observer, | 158 public system::TimezoneSettings::Observer, |
| 159 public BluetoothAdapter::Observer, | 159 public BluetoothAdapter::Observer, |
| 160 public SystemKeyEventListener::CapsLockObserver, | 160 public SystemKeyEventListener::CapsLockObserver, |
| 161 public MessageBubbleLinkListener { | 161 public ash::NetworkTrayDelegate { |
| 162 public: | 162 public: |
| 163 explicit SystemTrayDelegate(ash::SystemTray* tray) | 163 explicit SystemTrayDelegate(ash::SystemTray* tray) |
| 164 : tray_(tray), | 164 : tray_(tray), |
| 165 ui_weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST( | 165 ui_weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST( |
| 166 new base::WeakPtrFactory<SystemTrayDelegate>(this))), | 166 new base::WeakPtrFactory<SystemTrayDelegate>(this))), |
| 167 network_icon_(ALLOW_THIS_IN_INITIALIZER_LIST( | 167 network_icon_(ALLOW_THIS_IN_INITIALIZER_LIST( |
| 168 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), | 168 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), |
| 169 network_icon_dark_(ALLOW_THIS_IN_INITIALIZER_LIST( | 169 network_icon_dark_(ALLOW_THIS_IN_INITIALIZER_LIST( |
| 170 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), | 170 new NetworkMenuIcon(this, NetworkMenuIcon::MENU_MODE))), |
| 171 network_menu_(ALLOW_THIS_IN_INITIALIZER_LIST(new NetworkMenu(this))), | 171 network_menu_(ALLOW_THIS_IN_INITIALIZER_LIST(new NetworkMenu(this))), |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 bool search_mapped_to_caps_lock = false; | 1200 bool search_mapped_to_caps_lock = false; |
| 1201 if (!base::chromeos::IsRunningOnChromeOS() || | 1201 if (!base::chromeos::IsRunningOnChromeOS() || |
| 1202 search_key_mapped_to_ == input_method::kCapsLockKey) | 1202 search_key_mapped_to_ == input_method::kCapsLockKey) |
| 1203 search_mapped_to_caps_lock = true; | 1203 search_mapped_to_caps_lock = true; |
| 1204 | 1204 |
| 1205 ash::CapsLockObserver* observer = tray_->caps_lock_observer(); | 1205 ash::CapsLockObserver* observer = tray_->caps_lock_observer(); |
| 1206 if (observer) | 1206 if (observer) |
| 1207 observer->OnCapsLockChanged(enabled, search_mapped_to_caps_lock); | 1207 observer->OnCapsLockChanged(enabled, search_mapped_to_caps_lock); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 // Overridden from MessageBubbleLinkListener | 1210 // Overridden from ash::NetworkTrayDelegate |
| 1211 virtual void OnLinkActivated(size_t index) OVERRIDE { | 1211 virtual void NotificationLinkClicked(size_t index) OVERRIDE { |
| 1212 // If we have deal info URL defined that means that there're | 1212 // If we have deal info URL defined that means that there're |
| 1213 // 2 links in bubble. Let the user close it manually then thus giving | 1213 // 2 links in bubble. Let the user close it manually then thus giving |
| 1214 // ability to navigate to second link. | 1214 // ability to navigate to second link. |
| 1215 // mobile_data_bubble_ will be set to NULL in BubbleClosing callback. | 1215 // mobile_data_bubble_ will be set to NULL in BubbleClosing callback. |
| 1216 std::string deal_info_url = data_promo_notification_->deal_info_url(); | 1216 std::string deal_info_url = data_promo_notification_->deal_info_url(); |
| 1217 std::string deal_topup_url = data_promo_notification_->deal_topup_url(); | 1217 std::string deal_topup_url = data_promo_notification_->deal_topup_url(); |
| 1218 if (deal_info_url.empty()) | 1218 if (deal_info_url.empty()) |
| 1219 data_promo_notification_->CloseNotification(); | 1219 data_promo_notification_->CloseNotification(); |
| 1220 | 1220 |
| 1221 std::string deal_url_to_open; | 1221 std::string deal_url_to_open; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1269 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1270 }; | 1270 }; |
| 1271 | 1271 |
| 1272 } // namespace | 1272 } // namespace |
| 1273 | 1273 |
| 1274 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 1274 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
| 1275 return new chromeos::SystemTrayDelegate(tray); | 1275 return new chromeos::SystemTrayDelegate(tray); |
| 1276 } | 1276 } |
| 1277 | 1277 |
| 1278 } // namespace chromeos | 1278 } // namespace chromeos |
| OLD | NEW |