| 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_vpn.h" | 5 #include "ash/system/network/tray_vpn.h" |
| 6 | 6 |
| 7 #include "ash/resources/vector_icons/vector_icons.h" | 7 #include "ash/resources/vector_icons/vector_icons.h" |
| 8 #include "ash/session/session_controller.h" | 8 #include "ash/session/session_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_port.h" | 10 #include "ash/shell_port.h" |
| 11 #include "ash/strings/grit/ash_strings.h" | 11 #include "ash/strings/grit/ash_strings.h" |
| 12 #include "ash/system/network/network_icon.h" | 12 #include "ash/system/network/network_icon.h" |
| 13 #include "ash/system/network/network_icon_animation.h" | 13 #include "ash/system/network/network_icon_animation.h" |
| 14 #include "ash/system/network/network_icon_animation_observer.h" | 14 #include "ash/system/network/network_icon_animation_observer.h" |
| 15 #include "ash/system/network/network_state_list_detailed_view.h" | |
| 16 #include "ash/system/network/vpn_list.h" | 15 #include "ash/system/network/vpn_list.h" |
| 16 #include "ash/system/network/vpn_list_view.h" |
| 17 #include "ash/system/tray/system_tray.h" | 17 #include "ash/system/tray/system_tray.h" |
| 18 #include "ash/system/tray/system_tray_delegate.h" | 18 #include "ash/system/tray/system_tray_delegate.h" |
| 19 #include "ash/system/tray/tray_constants.h" | 19 #include "ash/system/tray/tray_constants.h" |
| 20 #include "ash/system/tray/tray_item_more.h" | 20 #include "ash/system/tray/tray_item_more.h" |
| 21 #include "ash/system/tray/tray_popup_item_style.h" | 21 #include "ash/system/tray/tray_popup_item_style.h" |
| 22 #include "chromeos/network/network_state.h" | 22 #include "chromeos/network/network_state.h" |
| 23 #include "chromeos/network/network_state_handler.h" | 23 #include "chromeos/network/network_state_handler.h" |
| 24 #include "third_party/cros_system_api/dbus/service_constants.h" | 24 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 26 #include "ui/gfx/paint_vector_icon.h" | 26 #include "ui/gfx/paint_vector_icon.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 return default_; | 167 return default_; |
| 168 } | 168 } |
| 169 | 169 |
| 170 views::View* TrayVPN::CreateDetailedView(LoginStatus status) { | 170 views::View* TrayVPN::CreateDetailedView(LoginStatus status) { |
| 171 CHECK(detailed_ == nullptr); | 171 CHECK(detailed_ == nullptr); |
| 172 if (!chromeos::NetworkHandler::IsInitialized()) | 172 if (!chromeos::NetworkHandler::IsInitialized()) |
| 173 return nullptr; | 173 return nullptr; |
| 174 | 174 |
| 175 ShellPort::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_DETAILED_VPN_VIEW); | 175 ShellPort::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_DETAILED_VPN_VIEW); |
| 176 detailed_ = new tray::NetworkStateListDetailedView( | 176 detailed_ = new tray::VPNListView(this, status); |
| 177 this, tray::NetworkStateListDetailedView::LIST_TYPE_VPN, status); | |
| 178 detailed_->Init(); | 177 detailed_->Init(); |
| 179 return detailed_; | 178 return detailed_; |
| 180 } | 179 } |
| 181 | 180 |
| 182 void TrayVPN::DestroyDefaultView() { | 181 void TrayVPN::DestroyDefaultView() { |
| 183 default_ = nullptr; | 182 default_ = nullptr; |
| 184 } | 183 } |
| 185 | 184 |
| 186 void TrayVPN::DestroyDetailedView() { | 185 void TrayVPN::DestroyDetailedView() { |
| 187 detailed_ = nullptr; | 186 detailed_ = nullptr; |
| 188 } | 187 } |
| 189 | 188 |
| 190 void TrayVPN::NetworkStateChanged() { | 189 void TrayVPN::NetworkStateChanged() { |
| 191 if (default_) | 190 if (default_) |
| 192 default_->Update(); | 191 default_->Update(); |
| 193 if (detailed_) | 192 if (detailed_) |
| 194 detailed_->Update(); | 193 detailed_->Update(); |
| 195 } | 194 } |
| 196 | 195 |
| 197 } // namespace ash | 196 } // namespace ash |
| OLD | NEW |