| 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 "base/command_line.h" | 22 #include "base/command_line.h" |
| 23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 24 #include "chromeos/network/network_state.h" | 24 #include "chromeos/network/network_state.h" |
| 25 #include "chromeos/network/network_state_handler.h" | 25 #include "chromeos/network/network_state_handler.h" |
| 26 #include "grit/ash_resources.h" | 26 #include "grit/ash_resources.h" |
| 27 #include "grit/ash_strings.h" | 27 #include "grit/ash_strings.h" |
| 28 #include "third_party/cros_system_api/dbus/service_constants.h" | 28 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 29 #include "ui/accessibility/ax_view_state.h" | 29 #include "ui/accessibility/ax_node_data.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 31 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
| 32 #include "ui/views/controls/image_view.h" | 32 #include "ui/views/controls/image_view.h" |
| 33 #include "ui/views/controls/link.h" | 33 #include "ui/views/controls/link.h" |
| 34 #include "ui/views/controls/link_listener.h" | 34 #include "ui/views/controls/link_listener.h" |
| 35 #include "ui/views/layout/box_layout.h" | 35 #include "ui/views/layout/box_layout.h" |
| 36 #include "ui/views/widget/widget.h" | 36 #include "ui/views/widget/widget.h" |
| 37 | 37 |
| 38 using chromeos::NetworkHandler; | 38 using chromeos::NetworkHandler; |
| 39 using chromeos::NetworkState; | 39 using chromeos::NetworkState; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); | 77 handler->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); |
| 78 if (connected_network) { | 78 if (connected_network) { |
| 79 UpdateConnectionStatus(base::UTF8ToUTF16(connected_network->name()), | 79 UpdateConnectionStatus(base::UTF8ToUTF16(connected_network->name()), |
| 80 true); | 80 true); |
| 81 } else { | 81 } else { |
| 82 UpdateConnectionStatus(base::string16(), false); | 82 UpdateConnectionStatus(base::string16(), false); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 // views::View: | 86 // views::View: |
| 87 void GetAccessibleState(ui::AXViewState* state) override { | 87 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
| 88 state->name = connection_status_string_; | 88 node_data->SetName(connection_status_string_); |
| 89 state->role = ui::AX_ROLE_BUTTON; | 89 node_data->role = ui::AX_ROLE_BUTTON; |
| 90 } | 90 } |
| 91 | 91 |
| 92 // network_icon::AnimationObserver: | 92 // network_icon::AnimationObserver: |
| 93 void NetworkIconChanged() override { UpdateNetworkStateHandlerIcon(); } | 93 void NetworkIconChanged() override { UpdateNetworkStateHandlerIcon(); } |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 // Updates connection status and notifies accessibility event when necessary. | 96 // Updates connection status and notifies accessibility event when necessary. |
| 97 void UpdateConnectionStatus(const base::string16& network_name, | 97 void UpdateConnectionStatus(const base::string16& network_name, |
| 98 bool connected) { | 98 bool connected) { |
| 99 base::string16 new_connection_status_string; | 99 base::string16 new_connection_status_string; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 void TrayNetwork::NetworkStateChanged() { | 321 void TrayNetwork::NetworkStateChanged() { |
| 322 if (tray_) | 322 if (tray_) |
| 323 tray_->UpdateNetworkStateHandlerIcon(); | 323 tray_->UpdateNetworkStateHandlerIcon(); |
| 324 if (default_) | 324 if (default_) |
| 325 default_->Update(); | 325 default_->Update(); |
| 326 if (detailed_) | 326 if (detailed_) |
| 327 detailed_->Update(); | 327 detailed_->Update(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace ash | 330 } // namespace ash |
| OLD | NEW |