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/network_state_list_detailed_view.h" | 5 #include "ash/common/system/chromeos/network/network_state_list_detailed_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 owner()->system_tray()->CloseSystemBubble(); | 396 owner()->system_tray()->CloseSystemBubble(); |
397 } | 397 } |
398 | 398 |
399 void NetworkStateListDetailedView::HandleViewClicked(views::View* view) { | 399 void NetworkStateListDetailedView::HandleViewClicked(views::View* view) { |
400 // If the info bubble was visible, close it when some other item is clicked. | 400 // If the info bubble was visible, close it when some other item is clicked. |
401 ResetInfoBubble(); | 401 ResetInfoBubble(); |
402 | 402 |
403 if (login_ == LoginStatus::LOCKED) | 403 if (login_ == LoginStatus::LOCKED) |
404 return; | 404 return; |
405 | 405 |
406 std::string service_path; | 406 std::string guid; |
407 if (!network_list_view_->IsNetworkEntry(view, &service_path)) | 407 if (!network_list_view_->IsNetworkEntry(view, &guid)) |
408 return; | 408 return; |
409 | 409 |
410 const NetworkState* network = | 410 const NetworkState* network = |
411 NetworkHandler::Get()->network_state_handler()->GetNetworkState( | 411 NetworkHandler::Get()->network_state_handler()->GetNetworkStateFromGuid( |
412 service_path); | 412 guid); |
413 if (!network || network->IsConnectedState() || network->IsConnectingState()) { | 413 if (!network || network->IsConnectedState() || network->IsConnectingState()) { |
414 WmShell::Get()->RecordUserMetricsAction( | 414 WmShell::Get()->RecordUserMetricsAction( |
415 list_type_ == LIST_TYPE_VPN | 415 list_type_ == LIST_TYPE_VPN |
416 ? UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS | 416 ? UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS |
417 : UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS); | 417 : UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS); |
418 WmShell::Get()->system_tray_controller()->ShowNetworkSettings( | 418 WmShell::Get()->system_tray_controller()->ShowNetworkSettings( |
419 network ? network->guid() : std::string()); | 419 network ? network->guid() : std::string()); |
420 } else { | 420 } else { |
421 WmShell::Get()->RecordUserMetricsAction( | 421 WmShell::Get()->RecordUserMetricsAction( |
422 list_type_ == LIST_TYPE_VPN | 422 list_type_ == LIST_TYPE_VPN |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 return controlled_by_extension_icon_.ToImageSkia(); | 645 return controlled_by_extension_icon_.ToImageSkia(); |
646 } | 646 } |
647 | 647 |
648 views::View* NetworkStateListDetailedView::CreateControlledByExtensionView( | 648 views::View* NetworkStateListDetailedView::CreateControlledByExtensionView( |
649 const NetworkInfo& info) { | 649 const NetworkInfo& info) { |
650 NetworkingConfigDelegate* networking_config_delegate = | 650 NetworkingConfigDelegate* networking_config_delegate = |
651 WmShell::Get()->system_tray_delegate()->GetNetworkingConfigDelegate(); | 651 WmShell::Get()->system_tray_delegate()->GetNetworkingConfigDelegate(); |
652 if (!networking_config_delegate) | 652 if (!networking_config_delegate) |
653 return nullptr; | 653 return nullptr; |
654 std::unique_ptr<const NetworkingConfigDelegate::ExtensionInfo> | 654 std::unique_ptr<const NetworkingConfigDelegate::ExtensionInfo> |
655 extension_info = networking_config_delegate->LookUpExtensionForNetwork( | 655 extension_info = |
656 info.service_path); | 656 networking_config_delegate->LookUpExtensionForNetwork(info.guid); |
657 if (!extension_info) | 657 if (!extension_info) |
658 return nullptr; | 658 return nullptr; |
659 | 659 |
660 // Get the tooltip text. | 660 // Get the tooltip text. |
661 base::string16 tooltip_text = l10n_util::GetStringFUTF16( | 661 base::string16 tooltip_text = l10n_util::GetStringFUTF16( |
662 IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI, | 662 IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI, |
663 base::UTF8ToUTF16(extension_info->extension_name)); | 663 base::UTF8ToUTF16(extension_info->extension_name)); |
664 | 664 |
665 views::ImageView* controlled_icon = | 665 views::ImageView* controlled_icon = |
666 new FixedSizedImageView(kTrayPopupDetailsIconWidth, 0); | 666 new FixedSizedImageView(kTrayPopupDetailsIconWidth, 0); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED); | 752 UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED); |
753 WmShell::Get()->system_tray_controller()->ShowNetworkCreate(shill::kTypeWifi); | 753 WmShell::Get()->system_tray_controller()->ShowNetworkCreate(shill::kTypeWifi); |
754 } | 754 } |
755 | 755 |
756 void NetworkStateListDetailedView::RelayoutScrollList() { | 756 void NetworkStateListDetailedView::RelayoutScrollList() { |
757 scroller()->Layout(); | 757 scroller()->Layout(); |
758 } | 758 } |
759 | 759 |
760 } // namespace tray | 760 } // namespace tray |
761 } // namespace ash | 761 } // namespace ash |
OLD | NEW |