| 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 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 } else { | 869 } else { |
| 870 return base::UTF8ToUTF16(network->name()); | 870 return base::UTF8ToUTF16(network->name()); |
| 871 } | 871 } |
| 872 } | 872 } |
| 873 | 873 |
| 874 int GetMobileUninitializedMsg() { | 874 int GetMobileUninitializedMsg() { |
| 875 static base::Time s_uninitialized_state_time; | 875 static base::Time s_uninitialized_state_time; |
| 876 static int s_uninitialized_msg(0); | 876 static int s_uninitialized_msg(0); |
| 877 | 877 |
| 878 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); | 878 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
| 879 if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) == | 879 // TODO(lesliewatkins): Only return this message when Tether is uninitialized |
| 880 // due to no Bluetooth (dependent on codereview.chromium.org/2969493002/). |
| 881 if (handler->GetTechnologyState(NetworkTypePattern::Tether()) == |
| 880 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { | 882 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { |
| 881 // TODO (lesliewatkins): Add a more descriptive message (e.g. "Enable | 883 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_ENABLE_BLUETOOTH; |
| 882 // Bluetooth") for Tether technology type. | 884 s_uninitialized_state_time = base::Time::Now(); |
| 885 return s_uninitialized_msg; |
| 886 } else if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) == |
| 887 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { |
| 883 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; | 888 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; |
| 884 s_uninitialized_state_time = base::Time::Now(); | 889 s_uninitialized_state_time = base::Time::Now(); |
| 885 return s_uninitialized_msg; | 890 return s_uninitialized_msg; |
| 886 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { | 891 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { |
| 887 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; | 892 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; |
| 888 s_uninitialized_state_time = base::Time::Now(); | 893 s_uninitialized_state_time = base::Time::Now(); |
| 889 return s_uninitialized_msg; | 894 return s_uninitialized_msg; |
| 890 } | 895 } |
| 891 // 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 |
| 892 // a Mobile device shows up, so keep showing the initializing | 897 // a Mobile device shows up, so keep showing the initializing |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 network_paths.insert((*iter)->path()); | 993 network_paths.insert((*iter)->path()); |
| 989 } | 994 } |
| 990 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 995 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
| 991 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 996 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
| 992 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 997 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
| 993 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); | 998 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); |
| 994 } | 999 } |
| 995 | 1000 |
| 996 } // namespace network_icon | 1001 } // namespace network_icon |
| 997 } // namespace ash | 1002 } // namespace ash |
| OLD | NEW |