| 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/common/system/chromeos/network/tray_network.h" | 5 #include "ash/common/system/chromeos/network/tray_network.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/wm_shelf_util.h" | 7 #include "ash/common/shelf/wm_shelf_util.h" |
| 8 #include "ash/common/system/chromeos/network/network_icon.h" | 8 #include "ash/common/system/chromeos/network/network_icon.h" |
| 9 #include "ash/common/system/chromeos/network/network_icon_animation.h" | 9 #include "ash/common/system/chromeos/network/network_icon_animation.h" |
| 10 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" | 10 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" |
| 11 #include "ash/common/system/chromeos/network/network_state_list_detailed_view.h" | 11 #include "ash/common/system/chromeos/network/network_state_list_detailed_view.h" |
| 12 #include "ash/common/system/chromeos/network/tray_network_state_observer.h" | 12 #include "ash/common/system/chromeos/network/tray_network_state_observer.h" |
| 13 #include "ash/common/system/tray/system_tray.h" | 13 #include "ash/common/system/tray/system_tray.h" |
| 14 #include "ash/common/system/tray/system_tray_delegate.h" | 14 #include "ash/common/system/tray/system_tray_delegate.h" |
| 15 #include "ash/common/system/tray/system_tray_notifier.h" | 15 #include "ash/common/system/tray/system_tray_notifier.h" |
| 16 #include "ash/common/system/tray/tray_constants.h" | 16 #include "ash/common/system/tray/tray_constants.h" |
| 17 #include "ash/common/system/tray/tray_item_more.h" | 17 #include "ash/common/system/tray/tray_item_more.h" |
| 18 #include "ash/common/system/tray/tray_item_view.h" | 18 #include "ash/common/system/tray/tray_item_view.h" |
| 19 #include "ash/common/system/tray/tray_popup_item_style.h" | 19 #include "ash/common/system/tray/tray_popup_item_style.h" |
| 20 #include "ash/common/system/tray/tray_utils.h" | 20 #include "ash/common/system/tray/tray_utils.h" |
| 21 #include "ash/common/wm_shell.h" | 21 #include "ash/common/wm_shell.h" |
| 22 #include "ash/shell.h" |
| 22 #include "ash/strings/grit/ash_strings.h" | 23 #include "ash/strings/grit/ash_strings.h" |
| 23 #include "base/command_line.h" | 24 #include "base/command_line.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 25 #include "chromeos/network/network_state.h" | 26 #include "chromeos/network/network_state.h" |
| 26 #include "chromeos/network/network_state_handler.h" | 27 #include "chromeos/network/network_state_handler.h" |
| 27 #include "third_party/cros_system_api/dbus/service_constants.h" | 28 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 28 #include "ui/accessibility/ax_node_data.h" | 29 #include "ui/accessibility/ax_node_data.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
| 31 #include "ui/views/controls/link.h" | 32 #include "ui/views/controls/link.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 224 |
| 224 } // namespace tray | 225 } // namespace tray |
| 225 | 226 |
| 226 TrayNetwork::TrayNetwork(SystemTray* system_tray) | 227 TrayNetwork::TrayNetwork(SystemTray* system_tray) |
| 227 : SystemTrayItem(system_tray, UMA_NETWORK), | 228 : SystemTrayItem(system_tray, UMA_NETWORK), |
| 228 tray_(NULL), | 229 tray_(NULL), |
| 229 default_(NULL), | 230 default_(NULL), |
| 230 detailed_(NULL), | 231 detailed_(NULL), |
| 231 request_wifi_view_(false) { | 232 request_wifi_view_(false) { |
| 232 network_state_observer_.reset(new TrayNetworkStateObserver(this)); | 233 network_state_observer_.reset(new TrayNetworkStateObserver(this)); |
| 233 SystemTrayNotifier* notifier = WmShell::Get()->system_tray_notifier(); | 234 SystemTrayNotifier* notifier = Shell::Get()->system_tray_notifier(); |
| 234 notifier->AddNetworkObserver(this); | 235 notifier->AddNetworkObserver(this); |
| 235 notifier->AddNetworkPortalDetectorObserver(this); | 236 notifier->AddNetworkPortalDetectorObserver(this); |
| 236 } | 237 } |
| 237 | 238 |
| 238 TrayNetwork::~TrayNetwork() { | 239 TrayNetwork::~TrayNetwork() { |
| 239 SystemTrayNotifier* notifier = WmShell::Get()->system_tray_notifier(); | 240 SystemTrayNotifier* notifier = Shell::Get()->system_tray_notifier(); |
| 240 notifier->RemoveNetworkObserver(this); | 241 notifier->RemoveNetworkObserver(this); |
| 241 notifier->RemoveNetworkPortalDetectorObserver(this); | 242 notifier->RemoveNetworkPortalDetectorObserver(this); |
| 242 } | 243 } |
| 243 | 244 |
| 244 views::View* TrayNetwork::CreateTrayView(LoginStatus status) { | 245 views::View* TrayNetwork::CreateTrayView(LoginStatus status) { |
| 245 CHECK(tray_ == NULL); | 246 CHECK(tray_ == NULL); |
| 246 if (!chromeos::NetworkHandler::IsInitialized()) | 247 if (!chromeos::NetworkHandler::IsInitialized()) |
| 247 return NULL; | 248 return NULL; |
| 248 tray_ = new tray::NetworkTrayView(this); | 249 tray_ = new tray::NetworkTrayView(this); |
| 249 return tray_; | 250 return tray_; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 void TrayNetwork::NetworkStateChanged() { | 311 void TrayNetwork::NetworkStateChanged() { |
| 311 if (tray_) | 312 if (tray_) |
| 312 tray_->UpdateNetworkStateHandlerIcon(); | 313 tray_->UpdateNetworkStateHandlerIcon(); |
| 313 if (default_) | 314 if (default_) |
| 314 default_->Update(); | 315 default_->Update(); |
| 315 if (detailed_) | 316 if (detailed_) |
| 316 detailed_->Update(); | 317 detailed_->Update(); |
| 317 } | 318 } |
| 318 | 319 |
| 319 } // namespace ash | 320 } // namespace ash |
| OLD | NEW |