Chromium Code Reviews| 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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 876 } else { | 876 } else { |
| 877 return base::UTF8ToUTF16(network->name()); | 877 return base::UTF8ToUTF16(network->name()); |
| 878 } | 878 } |
| 879 } | 879 } |
| 880 | 880 |
| 881 int GetCellularUninitializedMsg() { | 881 int GetCellularUninitializedMsg() { |
| 882 static base::Time s_uninitialized_state_time; | 882 static base::Time s_uninitialized_state_time; |
| 883 static int s_uninitialized_msg(0); | 883 static int s_uninitialized_msg(0); |
| 884 | 884 |
| 885 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); | 885 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
| 886 if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) == | 886 if (handler->GetTechnologyState(NetworkTypePattern::Cellular()) == |
|
Kyle Horimoto
2017/06/01 22:12:23
Do we still want this behavior for WiMAX?
stevenjb
2017/06/01 22:29:47
Actually yes, this should still be Mobile(). This
lesliewatkins
2017/06/02 21:31:17
Done.
Switched it back to Mobile, changed the nam
| |
| 887 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { | 887 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { |
| 888 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; | 888 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; |
| 889 s_uninitialized_state_time = base::Time::Now(); | 889 s_uninitialized_state_time = base::Time::Now(); |
| 890 return s_uninitialized_msg; | 890 return s_uninitialized_msg; |
| 891 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { | 891 } else if (handler->GetScanningByType(NetworkTypePattern::Cellular())) { |
|
stevenjb
2017/06/01 22:29:47
This seems like we want to include Tether; if it s
lesliewatkins
2017/06/02 21:31:17
Done.
| |
| 892 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; | 892 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; |
| 893 s_uninitialized_state_time = base::Time::Now(); | 893 s_uninitialized_state_time = base::Time::Now(); |
| 894 return s_uninitialized_msg; | 894 return s_uninitialized_msg; |
| 895 } | 895 } |
| 896 // There can be a delay between leaving the Initializing state and when | 896 // There can be a delay between leaving the Initializing state and when |
| 897 // a Cellular device shows up, so keep showing the initializing | 897 // a Cellular device shows up, so keep showing the initializing |
| 898 // animation for a bit to avoid flashing the disconnect icon. | 898 // animation for a bit to avoid flashing the disconnect icon. |
| 899 const int kInitializingDelaySeconds = 1; | 899 const int kInitializingDelaySeconds = 1; |
| 900 base::TimeDelta dtime = base::Time::Now() - s_uninitialized_state_time; | 900 base::TimeDelta dtime = base::Time::Now() - s_uninitialized_state_time; |
| 901 if (dtime.InSeconds() < kInitializingDelaySeconds) | 901 if (dtime.InSeconds() < kInitializingDelaySeconds) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 993 network_paths.insert((*iter)->path()); | 993 network_paths.insert((*iter)->path()); |
| 994 } | 994 } |
| 995 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 995 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
| 996 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 996 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
| 997 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 997 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
| 998 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); | 998 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 } // namespace network_icon | 1001 } // namespace network_icon |
| 1002 } // namespace ash | 1002 } // namespace ash |
| OLD | NEW |