| 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 bool search_mapped_to_caps_lock = false; | 1195 bool search_mapped_to_caps_lock = false; |
| 1196 if (!base::chromeos::IsRunningOnChromeOS() || | 1196 if (!base::chromeos::IsRunningOnChromeOS() || |
| 1197 search_key_mapped_to_ == input_method::kCapsLockKey) | 1197 search_key_mapped_to_ == input_method::kCapsLockKey) |
| 1198 search_mapped_to_caps_lock = true; | 1198 search_mapped_to_caps_lock = true; |
| 1199 | 1199 |
| 1200 ash::CapsLockObserver* observer = tray_->caps_lock_observer(); | 1200 ash::CapsLockObserver* observer = tray_->caps_lock_observer(); |
| 1201 if (observer) | 1201 if (observer) |
| 1202 observer->OnCapsLockChanged(enabled, search_mapped_to_caps_lock); | 1202 observer->OnCapsLockChanged(enabled, search_mapped_to_caps_lock); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 // Overridden from MessageBubbleLinkListener | 1205 // Overridden from ash::NetworkTrayDelegate |
| 1206 virtual void OnLinkActivated(size_t index) OVERRIDE { | 1206 virtual void NotificationLinkClicked(size_t index) OVERRIDE { |
| 1207 // If we have deal info URL defined that means that there're | 1207 // If we have deal info URL defined that means that there're |
| 1208 // 2 links in bubble. Let the user close it manually then thus giving | 1208 // 2 links in bubble. Let the user close it manually then thus giving |
| 1209 // ability to navigate to second link. | 1209 // ability to navigate to second link. |
| 1210 // mobile_data_bubble_ will be set to NULL in BubbleClosing callback. | 1210 // mobile_data_bubble_ will be set to NULL in BubbleClosing callback. |
| 1211 std::string deal_info_url = data_promo_notification_->deal_info_url(); | 1211 std::string deal_info_url = data_promo_notification_->deal_info_url(); |
| 1212 std::string deal_topup_url = data_promo_notification_->deal_topup_url(); | 1212 std::string deal_topup_url = data_promo_notification_->deal_topup_url(); |
| 1213 if (deal_info_url.empty()) | 1213 if (deal_info_url.empty()) |
| 1214 data_promo_notification_->CloseNotification(); | 1214 data_promo_notification_->CloseNotification(); |
| 1215 | 1215 |
| 1216 std::string deal_url_to_open; | 1216 std::string deal_url_to_open; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1264 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 1265 }; | 1265 }; |
| 1266 | 1266 |
| 1267 } // namespace | 1267 } // namespace |
| 1268 | 1268 |
| 1269 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 1269 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
| 1270 return new chromeos::SystemTrayDelegate(tray); | 1270 return new chromeos::SystemTrayDelegate(tray); |
| 1271 } | 1271 } |
| 1272 | 1272 |
| 1273 } // namespace chromeos | 1273 } // namespace chromeos |
| OLD | NEW |