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 "ash/system/network/tray_network.h" | 5 #include "ash/system/network/tray_network.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/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 private: | 258 private: |
259 void AppendHeaderEntry() { | 259 void AppendHeaderEntry() { |
260 CreateSpecialRow(IDS_ASH_STATUS_TRAY_NETWORK, this); | 260 CreateSpecialRow(IDS_ASH_STATUS_TRAY_NETWORK, this); |
261 } | 261 } |
262 | 262 |
263 void AppendHeaderButtons() { | 263 void AppendHeaderButtons() { |
264 button_wifi_ = new TrayPopupHeaderButton(this, | 264 button_wifi_ = new TrayPopupHeaderButton(this, |
265 IDR_AURA_UBER_TRAY_WIFI_ENABLED, | 265 IDR_AURA_UBER_TRAY_WIFI_ENABLED, |
266 IDR_AURA_UBER_TRAY_WIFI_DISABLED, | 266 IDR_AURA_UBER_TRAY_WIFI_DISABLED, |
267 IDR_AURA_UBER_TRAY_WIFI_ENABLED_HOVER, | 267 IDR_AURA_UBER_TRAY_WIFI_ENABLED_HOVER, |
268 IDR_AURA_UBER_TRAY_WIFI_DISABLED_HOVER); | 268 IDR_AURA_UBER_TRAY_WIFI_DISABLED_HOVER, |
| 269 IDS_ASH_STATUS_TRAY_WIFI); |
269 footer()->AddButton(button_wifi_); | 270 footer()->AddButton(button_wifi_); |
270 | 271 |
271 button_mobile_ = new TrayPopupHeaderButton(this, | 272 button_mobile_ = new TrayPopupHeaderButton(this, |
272 IDR_AURA_UBER_TRAY_CELLULAR_ENABLED, | 273 IDR_AURA_UBER_TRAY_CELLULAR_ENABLED, |
273 IDR_AURA_UBER_TRAY_CELLULAR_DISABLED, | 274 IDR_AURA_UBER_TRAY_CELLULAR_DISABLED, |
274 IDR_AURA_UBER_TRAY_CELLULAR_ENABLED_HOVER, | 275 IDR_AURA_UBER_TRAY_CELLULAR_ENABLED_HOVER, |
275 IDR_AURA_UBER_TRAY_CELLULAR_DISABLED_HOVER); | 276 IDR_AURA_UBER_TRAY_CELLULAR_DISABLED_HOVER, |
| 277 IDS_ASH_STATUS_TRAY_CELLULAR); |
276 footer()->AddButton(button_mobile_); | 278 footer()->AddButton(button_mobile_); |
277 | 279 |
278 info_icon_ = new TrayPopupHeaderButton(this, | 280 info_icon_ = new TrayPopupHeaderButton(this, |
279 IDR_AURA_UBER_TRAY_NETWORK_INFO, | 281 IDR_AURA_UBER_TRAY_NETWORK_INFO, |
280 IDR_AURA_UBER_TRAY_NETWORK_INFO, | 282 IDR_AURA_UBER_TRAY_NETWORK_INFO, |
281 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, | 283 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, |
282 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER); | 284 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, |
| 285 IDS_ASH_STATUS_TRAY_NETWORK_INFO); |
283 footer()->AddButton(info_icon_); | 286 footer()->AddButton(info_icon_); |
284 } | 287 } |
285 | 288 |
286 void UpdateHeaderButtons() { | 289 void UpdateHeaderButtons() { |
287 SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate(); | 290 SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate(); |
288 button_wifi_->SetToggled(!delegate->GetWifiEnabled()); | 291 button_wifi_->SetToggled(!delegate->GetWifiEnabled()); |
289 button_mobile_->SetToggled(!delegate->GetMobileEnabled()); | 292 button_mobile_->SetToggled(!delegate->GetMobileEnabled()); |
290 button_mobile_->SetVisible(delegate->GetMobileAvailable()); | 293 button_mobile_->SetVisible(delegate->GetMobileAvailable()); |
291 if (proxy_settings_) | 294 if (proxy_settings_) |
292 proxy_settings_->SetEnabled(delegate->IsNetworkConnected()); | 295 proxy_settings_->SetEnabled(delegate->IsNetworkConnected()); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 | 807 |
805 void TrayNetwork::LinkClicked(ErrorType error_type) { | 808 void TrayNetwork::LinkClicked(ErrorType error_type) { |
806 tray::NetworkErrors::ErrorMap::const_iterator iter = | 809 tray::NetworkErrors::ErrorMap::const_iterator iter = |
807 errors()->messages().find(error_type); | 810 errors()->messages().find(error_type); |
808 if (iter != errors()->messages().end() && iter->second.delegate) | 811 if (iter != errors()->messages().end() && iter->second.delegate) |
809 iter->second.delegate->NotificationLinkClicked(); | 812 iter->second.delegate->NotificationLinkClicked(); |
810 } | 813 } |
811 | 814 |
812 } // namespace internal | 815 } // namespace internal |
813 } // namespace ash | 816 } // namespace ash |
OLD | NEW |