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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, | 235 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER, |
236 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER); | 236 IDR_AURA_UBER_TRAY_NETWORK_INFO_HOVER); |
237 footer()->AddButton(info_icon_); | 237 footer()->AddButton(info_icon_); |
238 } | 238 } |
239 | 239 |
240 void UpdateHeaderButtons() { | 240 void UpdateHeaderButtons() { |
241 SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate(); | 241 SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate(); |
242 button_wifi_->SetToggled(!delegate->GetWifiEnabled()); | 242 button_wifi_->SetToggled(!delegate->GetWifiEnabled()); |
243 button_mobile_->SetToggled(!delegate->GetMobileEnabled()); | 243 button_mobile_->SetToggled(!delegate->GetMobileEnabled()); |
244 button_mobile_->SetVisible(delegate->GetMobileAvailable()); | 244 button_mobile_->SetVisible(delegate->GetMobileAvailable()); |
245 proxy_settings_->SetEnabled(delegate->IsNetworkConnected()); | 245 if (proxy_settings_) |
| 246 proxy_settings_->SetEnabled(delegate->IsNetworkConnected()); |
246 } | 247 } |
247 | 248 |
248 void AppendNetworkEntries() { | 249 void AppendNetworkEntries() { |
249 CreateScrollableList(); | 250 CreateScrollableList(); |
250 | 251 |
251 HoverHighlightView* container = new HoverHighlightView(this); | 252 HoverHighlightView* container = new HoverHighlightView(this); |
252 container->set_fixed_height(kTrayPopupItemHeight); | 253 container->set_fixed_height(kTrayPopupItemHeight); |
253 container->AddLabel(ui::ResourceBundle::GetSharedInstance(). | 254 container->AddLabel(ui::ResourceBundle::GetSharedInstance(). |
254 GetLocalizedString(IDS_ASH_STATUS_TRAY_MOBILE_VIEW_ACCOUNT), | 255 GetLocalizedString(IDS_ASH_STATUS_TRAY_MOBILE_VIEW_ACCOUNT), |
255 gfx::Font::NORMAL); | 256 gfx::Font::NORMAL); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 329 |
329 other_wifi_ = new TrayPopupTextButton(this, | 330 other_wifi_ = new TrayPopupTextButton(this, |
330 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_OTHER_WIFI)); | 331 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_OTHER_WIFI)); |
331 bottom_row->AddTextButton(other_wifi_); | 332 bottom_row->AddTextButton(other_wifi_); |
332 | 333 |
333 other_mobile_ = new TrayPopupTextButton(this, | 334 other_mobile_ = new TrayPopupTextButton(this, |
334 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_OTHER_MOBILE)); | 335 rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_OTHER_MOBILE)); |
335 bottom_row->AddTextButton(other_mobile_); | 336 bottom_row->AddTextButton(other_mobile_); |
336 | 337 |
337 CreateSettingsEntry(); | 338 CreateSettingsEntry(); |
| 339 DCHECK(settings_ || proxy_settings_); |
338 bottom_row->AddTextButton(settings_ ? settings_ : proxy_settings_); | 340 bottom_row->AddTextButton(settings_ ? settings_ : proxy_settings_); |
339 | 341 |
340 AddChildView(bottom_row); | 342 AddChildView(bottom_row); |
341 } | 343 } |
342 | 344 |
343 void UpdateNetworkExtra() { | 345 void UpdateNetworkExtra() { |
344 if (login_ == user::LOGGED_IN_LOCKED) | 346 if (login_ == user::LOGGED_IN_LOCKED) |
345 return; | 347 return; |
346 | 348 |
347 SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate(); | 349 SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate(); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 if (tray_) | 565 if (tray_) |
564 tray_->Update(info); | 566 tray_->Update(info); |
565 if (default_) | 567 if (default_) |
566 default_->Update(); | 568 default_->Update(); |
567 if (detailed_) | 569 if (detailed_) |
568 detailed_->Update(); | 570 detailed_->Update(); |
569 } | 571 } |
570 | 572 |
571 } // namespace internal | 573 } // namespace internal |
572 } // namespace ash | 574 } // namespace ash |
OLD | NEW |