Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: ash/common/system/chromeos/network/network_state_list_detailed_view.cc

Issue 2698473007: Convert path usage in NetworkListViewBase subclasses to use guids. (Closed)
Patch Set: Formatting. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 owner()->system_tray()->CloseSystemBubble(); 395 owner()->system_tray()->CloseSystemBubble();
396 } 396 }
397 397
398 void NetworkStateListDetailedView::HandleViewClicked(views::View* view) { 398 void NetworkStateListDetailedView::HandleViewClicked(views::View* view) {
399 // If the info bubble was visible, close it when some other item is clicked. 399 // If the info bubble was visible, close it when some other item is clicked.
400 ResetInfoBubble(); 400 ResetInfoBubble();
401 401
402 if (login_ == LoginStatus::LOCKED) 402 if (login_ == LoginStatus::LOCKED)
403 return; 403 return;
404 404
405 std::string service_path; 405 std::string guid;
406 if (!network_list_view_->IsNetworkEntry(view, &service_path)) 406 if (!network_list_view_->IsNetworkEntry(view, &guid))
407 return; 407 return;
408 408
409 const NetworkState* network = 409 const NetworkState* network =
410 NetworkHandler::Get()->network_state_handler()->GetNetworkState( 410 NetworkHandler::Get()->network_state_handler()->GetNetworkStateFromGuid(
411 service_path); 411 guid);
412 if (!network || network->IsConnectedState() || network->IsConnectingState()) { 412 if (!network || network->IsConnectedState() || network->IsConnectingState()) {
413 WmShell::Get()->RecordUserMetricsAction( 413 WmShell::Get()->RecordUserMetricsAction(
414 list_type_ == LIST_TYPE_VPN 414 list_type_ == LIST_TYPE_VPN
415 ? UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS 415 ? UMA_STATUS_AREA_SHOW_NETWORK_CONNECTION_DETAILS
416 : UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS); 416 : UMA_STATUS_AREA_SHOW_VPN_CONNECTION_DETAILS);
417 WmShell::Get()->system_tray_controller()->ShowNetworkSettings( 417 WmShell::Get()->system_tray_controller()->ShowNetworkSettings(
418 network ? network->guid() : std::string()); 418 network ? network->guid() : std::string());
419 } else { 419 } else {
420 WmShell::Get()->RecordUserMetricsAction( 420 WmShell::Get()->RecordUserMetricsAction(
421 list_type_ == LIST_TYPE_VPN 421 list_type_ == LIST_TYPE_VPN
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 return controlled_by_extension_icon_.ToImageSkia(); 636 return controlled_by_extension_icon_.ToImageSkia();
637 } 637 }
638 638
639 views::View* NetworkStateListDetailedView::CreateControlledByExtensionView( 639 views::View* NetworkStateListDetailedView::CreateControlledByExtensionView(
640 const NetworkInfo& info) { 640 const NetworkInfo& info) {
641 NetworkingConfigDelegate* networking_config_delegate = 641 NetworkingConfigDelegate* networking_config_delegate =
642 WmShell::Get()->system_tray_delegate()->GetNetworkingConfigDelegate(); 642 WmShell::Get()->system_tray_delegate()->GetNetworkingConfigDelegate();
643 if (!networking_config_delegate) 643 if (!networking_config_delegate)
644 return nullptr; 644 return nullptr;
645 std::unique_ptr<const NetworkingConfigDelegate::ExtensionInfo> 645 std::unique_ptr<const NetworkingConfigDelegate::ExtensionInfo>
646 extension_info = networking_config_delegate->LookUpExtensionForNetwork( 646 extension_info =
647 info.service_path); 647 networking_config_delegate->LookUpExtensionForNetwork(info.guid);
stevenjb 2017/02/16 22:40:31 This delegate function needs to be modified to acc
Ryan Hansberry 2017/02/16 23:14:18 Thankfully this was the only place that calls this
648 if (!extension_info) 648 if (!extension_info)
649 return nullptr; 649 return nullptr;
650 650
651 // Get the tooltip text. 651 // Get the tooltip text.
652 base::string16 tooltip_text = l10n_util::GetStringFUTF16( 652 base::string16 tooltip_text = l10n_util::GetStringFUTF16(
653 IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI, 653 IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI,
654 base::UTF8ToUTF16(extension_info->extension_name)); 654 base::UTF8ToUTF16(extension_info->extension_name));
655 655
656 views::ImageView* controlled_icon = 656 views::ImageView* controlled_icon =
657 new FixedSizedImageView(kTrayPopupDetailsIconWidth, 0); 657 new FixedSizedImageView(kTrayPopupDetailsIconWidth, 0);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED); 743 UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED);
744 WmShell::Get()->system_tray_controller()->ShowNetworkCreate(shill::kTypeWifi); 744 WmShell::Get()->system_tray_controller()->ShowNetworkCreate(shill::kTypeWifi);
745 } 745 }
746 746
747 void NetworkStateListDetailedView::RelayoutScrollList() { 747 void NetworkStateListDetailedView::RelayoutScrollList() {
748 scroller()->Layout(); 748 scroller()->Layout();
749 } 749 }
750 750
751 } // namespace tray 751 } // namespace tray
752 } // namespace ash 752 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698