| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/vpn_list_view.h" | 5 #include "ash/common/system/chromeos/network/vpn_list_view.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ash/common/ash_view_ids.h" | 11 #include "ash/common/ash_view_ids.h" |
| 12 #include "ash/common/material_design/material_design_controller.h" | 12 #include "ash/common/material_design/material_design_controller.h" |
| 13 #include "ash/common/system/chromeos/network/network_icon.h" | 13 #include "ash/common/system/chromeos/network/network_icon.h" |
| 14 #include "ash/common/system/chromeos/network/network_icon_animation.h" | 14 #include "ash/common/system/chromeos/network/network_icon_animation.h" |
| 15 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" | 15 #include "ash/common/system/chromeos/network/network_icon_animation_observer.h" |
| 16 #include "ash/common/system/chromeos/network/network_list_delegate.h" | 16 #include "ash/common/system/chromeos/network/network_list_delegate.h" |
| 17 #include "ash/common/system/chromeos/network/vpn_list.h" | 17 #include "ash/common/system/chromeos/network/vpn_list.h" |
| 18 #include "ash/common/system/tray/hover_highlight_view.h" | 18 #include "ash/common/system/tray/hover_highlight_view.h" |
| 19 #include "ash/common/system/tray/system_menu_button.h" | 19 #include "ash/common/system/tray/system_menu_button.h" |
| 20 #include "ash/common/system/tray/system_tray_controller.h" | 20 #include "ash/common/system/tray/system_tray_controller.h" |
| 21 #include "ash/common/system/tray/throbber_view.h" | 21 #include "ash/common/system/tray/throbber_view.h" |
| 22 #include "ash/common/system/tray/tray_constants.h" | 22 #include "ash/common/system/tray/tray_constants.h" |
| 23 #include "ash/common/system/tray/tray_popup_utils.h" | 23 #include "ash/common/system/tray/tray_popup_utils.h" |
| 24 #include "ash/common/system/tray/tri_view.h" | 24 #include "ash/common/system/tray/tri_view.h" |
| 25 #include "ash/common/wm_shell.h" | 25 #include "ash/common/wm_shell.h" |
| 26 #include "ash/resources/vector_icons/vector_icons.h" | 26 #include "ash/resources/vector_icons/vector_icons.h" |
| 27 #include "ash/shell.h" |
| 27 #include "ash/strings/grit/ash_strings.h" | 28 #include "ash/strings/grit/ash_strings.h" |
| 28 #include "base/bind.h" | 29 #include "base/bind.h" |
| 29 #include "base/bind_helpers.h" | 30 #include "base/bind_helpers.h" |
| 30 #include "base/logging.h" | 31 #include "base/logging.h" |
| 31 #include "base/strings/utf_string_conversions.h" | 32 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/values.h" | 33 #include "base/values.h" |
| 33 #include "chromeos/network/network_connection_handler.h" | 34 #include "chromeos/network/network_connection_handler.h" |
| 34 #include "chromeos/network/network_handler.h" | 35 #include "chromeos/network/network_handler.h" |
| 35 #include "chromeos/network/network_state.h" | 36 #include "chromeos/network/network_state.h" |
| 36 #include "chromeos/network/network_type_pattern.h" | 37 #include "chromeos/network/network_type_pattern.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 void VPNListView::OnViewClicked(views::View* sender) { | 353 void VPNListView::OnViewClicked(views::View* sender) { |
| 353 const auto& provider_iter = provider_view_map_.find(sender); | 354 const auto& provider_iter = provider_view_map_.find(sender); |
| 354 if (provider_iter != provider_view_map_.end()) { | 355 if (provider_iter != provider_view_map_.end()) { |
| 355 // If the user clicks on a provider entry, request that the "add network" | 356 // If the user clicks on a provider entry, request that the "add network" |
| 356 // dialog for this provider be shown. | 357 // dialog for this provider be shown. |
| 357 const VPNProvider& provider = provider_iter->second; | 358 const VPNProvider& provider = provider_iter->second; |
| 358 WmShell* shell = WmShell::Get(); | 359 WmShell* shell = WmShell::Get(); |
| 359 if (provider.third_party) { | 360 if (provider.third_party) { |
| 360 shell->RecordUserMetricsAction( | 361 shell->RecordUserMetricsAction( |
| 361 UMA_STATUS_AREA_VPN_ADD_THIRD_PARTY_CLICKED); | 362 UMA_STATUS_AREA_VPN_ADD_THIRD_PARTY_CLICKED); |
| 362 shell->system_tray_controller()->ShowThirdPartyVpnCreate( | 363 Shell::Get()->system_tray_controller()->ShowThirdPartyVpnCreate( |
| 363 provider.extension_id); | 364 provider.extension_id); |
| 364 } else { | 365 } else { |
| 365 shell->RecordUserMetricsAction(UMA_STATUS_AREA_VPN_ADD_BUILT_IN_CLICKED); | 366 shell->RecordUserMetricsAction(UMA_STATUS_AREA_VPN_ADD_BUILT_IN_CLICKED); |
| 366 shell->system_tray_controller()->ShowNetworkCreate(shill::kTypeVPN); | 367 Shell::Get()->system_tray_controller()->ShowNetworkCreate( |
| 368 shill::kTypeVPN); |
| 367 } | 369 } |
| 368 return; | 370 return; |
| 369 } | 371 } |
| 370 | 372 |
| 371 // If the user clicked on a network entry, let the |delegate_| trigger a | 373 // If the user clicked on a network entry, let the |delegate_| trigger a |
| 372 // connection attempt (if the network is currently disconnected) or show a | 374 // connection attempt (if the network is currently disconnected) or show a |
| 373 // configuration dialog (if the network is currently connected or connecting). | 375 // configuration dialog (if the network is currently connected or connecting). |
| 374 delegate_->OnNetworkEntryClicked(sender); | 376 delegate_->OnNetworkEntryClicked(sender); |
| 375 } | 377 } |
| 376 | 378 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 } | 433 } |
| 432 } | 434 } |
| 433 | 435 |
| 434 // Add providers without any configured networks, in the order that the | 436 // Add providers without any configured networks, in the order that the |
| 435 // providers were returned by the extensions system. | 437 // providers were returned by the extensions system. |
| 436 for (const VPNProvider& provider : providers) | 438 for (const VPNProvider& provider : providers) |
| 437 AddProviderAndNetworks(provider, networks); | 439 AddProviderAndNetworks(provider, networks); |
| 438 } | 440 } |
| 439 | 441 |
| 440 } // namespace ash | 442 } // namespace ash |
| OLD | NEW |