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

Side by Side Diff: ash/system/network/network_icon.cc

Issue 2957043002: Add a row in the network tray to inform users to turn Bluetooth on to enable Tether. (Closed)
Patch Set: Overhaul of previous implementation Created 3 years, 5 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/system/network/network_icon.h" 5 #include "ash/system/network/network_icon.h"
6 6
7 #include "ash/resources/vector_icons/vector_icons.h" 7 #include "ash/resources/vector_icons/vector_icons.h"
8 #include "ash/strings/grit/ash_strings.h" 8 #include "ash/strings/grit/ash_strings.h"
9 #include "ash/system/network/network_icon_animation.h" 9 #include "ash/system/network/network_icon_animation.h"
10 #include "ash/system/network/network_icon_animation_observer.h" 10 #include "ash/system/network/network_icon_animation_observer.h"
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 } else { 874 } else {
875 return base::UTF8ToUTF16(network->name()); 875 return base::UTF8ToUTF16(network->name());
876 } 876 }
877 } 877 }
878 878
879 int GetMobileUninitializedMsg() { 879 int GetMobileUninitializedMsg() {
880 static base::Time s_uninitialized_state_time; 880 static base::Time s_uninitialized_state_time;
881 static int s_uninitialized_msg(0); 881 static int s_uninitialized_msg(0);
882 882
883 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); 883 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
884 if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) == 884 if (handler->GetTechnologyState(NetworkTypePattern::Tether()) ==
885 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { 885 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) {
886 // TODO (lesliewatkins): Add a more descriptive message (e.g. "Enable 886 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_ENABLE_BLUETOOTH;
Kyle Horimoto 2017/07/07 17:33:59 nit: Add a TODO here to only do this when Tether i
lesliewatkins 2017/07/09 00:57:47 Done.
887 // Bluetooth") for Tether technology type. 887 s_uninitialized_state_time = base::Time::Now();
888 return s_uninitialized_msg;
889 } else if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) ==
890 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) {
888 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; 891 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR;
889 s_uninitialized_state_time = base::Time::Now(); 892 s_uninitialized_state_time = base::Time::Now();
890 return s_uninitialized_msg; 893 return s_uninitialized_msg;
891 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { 894 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) {
892 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; 895 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING;
893 s_uninitialized_state_time = base::Time::Now(); 896 s_uninitialized_state_time = base::Time::Now();
894 return s_uninitialized_msg; 897 return s_uninitialized_msg;
895 } 898 }
896 // There can be a delay between leaving the Initializing state and when 899 // There can be a delay between leaving the Initializing state and when
897 // a Mobile device shows up, so keep showing the initializing 900 // a Mobile device shows up, so keep showing the initializing
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 network_paths.insert((*iter)->path()); 996 network_paths.insert((*iter)->path());
994 } 997 }
995 PurgeIconMap(ICON_TYPE_TRAY, network_paths); 998 PurgeIconMap(ICON_TYPE_TRAY, network_paths);
996 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); 999 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths);
997 PurgeIconMap(ICON_TYPE_LIST, network_paths); 1000 PurgeIconMap(ICON_TYPE_LIST, network_paths);
998 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); 1001 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths);
999 } 1002 }
1000 1003
1001 } // namespace network_icon 1004 } // namespace network_icon
1002 } // namespace ash 1005 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698