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/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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
870 | 870 |
871 // Otherwise just show the network name or 'Ethernet'. | 871 // Otherwise just show the network name or 'Ethernet'. |
872 if (network->Matches(NetworkTypePattern::Ethernet())) { | 872 if (network->Matches(NetworkTypePattern::Ethernet())) { |
873 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ETHERNET); | 873 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ETHERNET); |
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; |
James Cook
2017/07/10 18:43:03
Aside: You didn't add it in this CL, but I'm a lit
lesliewatkins
2017/07/12 21:49:49
Acknowledged.
| |
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 // TODO (lesliewatkins): Only return this message when Tether is uninitialized |
James Cook
2017/07/10 18:43:03
nit: no space after TODO
lesliewatkins
2017/07/12 21:49:49
Done.
| |
885 // due to no Bluetooth (dependent on 2969493002). | |
James Cook
2017/07/10 18:43:03
nit: b/12345 for internal bugs (assuming that's an
Kyle Horimoto
2017/07/10 19:15:37
It's actually a Chromium CL number: https://codere
lesliewatkins
2017/07/12 21:49:49
Changed!
| |
886 if (handler->GetTechnologyState(NetworkTypePattern::Tether()) == | |
885 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { | 887 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { |
886 // TODO (lesliewatkins): Add a more descriptive message (e.g. "Enable | 888 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_ENABLE_BLUETOOTH; |
887 // Bluetooth") for Tether technology type. | 889 s_uninitialized_state_time = base::Time::Now(); |
890 return s_uninitialized_msg; | |
891 } else if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) == | |
892 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { | |
888 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; | 893 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; |
889 s_uninitialized_state_time = base::Time::Now(); | 894 s_uninitialized_state_time = base::Time::Now(); |
890 return s_uninitialized_msg; | 895 return s_uninitialized_msg; |
891 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { | 896 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { |
892 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; | 897 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; |
893 s_uninitialized_state_time = base::Time::Now(); | 898 s_uninitialized_state_time = base::Time::Now(); |
894 return s_uninitialized_msg; | 899 return s_uninitialized_msg; |
895 } | 900 } |
896 // There can be a delay between leaving the Initializing state and when | 901 // There can be a delay between leaving the Initializing state and when |
897 // a Mobile device shows up, so keep showing the initializing | 902 // a Mobile device shows up, so keep showing the initializing |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
993 network_paths.insert((*iter)->path()); | 998 network_paths.insert((*iter)->path()); |
994 } | 999 } |
995 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 1000 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
996 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 1001 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
997 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 1002 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
998 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); | 1003 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); |
999 } | 1004 } |
1000 | 1005 |
1001 } // namespace network_icon | 1006 } // namespace network_icon |
1002 } // namespace ash | 1007 } // namespace ash |
OLD | NEW |