| 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 // TODO(lesliewatkins): Only return this message when Tether is uninitialized | 879 if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) == |
| 880 // due to no Bluetooth (dependent on codereview.chromium.org/2969493002/). | |
| 881 if (handler->GetTechnologyState(NetworkTypePattern::Tether()) == | |
| 882 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { | 880 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { |
| 883 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_ENABLE_BLUETOOTH; | 881 // TODO (lesliewatkins): Add a more descriptive message (e.g. "Enable |
| 884 s_uninitialized_state_time = base::Time::Now(); | 882 // Bluetooth") for Tether technology type. |
| 885 return s_uninitialized_msg; | |
| 886 } else if (handler->GetTechnologyState(NetworkTypePattern::Mobile()) == | |
| 887 NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { | |
| 888 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; | 883 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; |
| 889 s_uninitialized_state_time = base::Time::Now(); | 884 s_uninitialized_state_time = base::Time::Now(); |
| 890 return s_uninitialized_msg; | 885 return s_uninitialized_msg; |
| 891 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { | 886 } else if (handler->GetScanningByType(NetworkTypePattern::Mobile())) { |
| 892 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; | 887 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_MOBILE_SCANNING; |
| 893 s_uninitialized_state_time = base::Time::Now(); | 888 s_uninitialized_state_time = base::Time::Now(); |
| 894 return s_uninitialized_msg; | 889 return s_uninitialized_msg; |
| 895 } | 890 } |
| 896 // There can be a delay between leaving the Initializing state and when | 891 // There can be a delay between leaving the Initializing state and when |
| 897 // a Mobile device shows up, so keep showing the initializing | 892 // 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()); | 988 network_paths.insert((*iter)->path()); |
| 994 } | 989 } |
| 995 PurgeIconMap(ICON_TYPE_TRAY, network_paths); | 990 PurgeIconMap(ICON_TYPE_TRAY, network_paths); |
| 996 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); | 991 PurgeIconMap(ICON_TYPE_DEFAULT_VIEW, network_paths); |
| 997 PurgeIconMap(ICON_TYPE_LIST, network_paths); | 992 PurgeIconMap(ICON_TYPE_LIST, network_paths); |
| 998 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); | 993 PurgeIconMap(ICON_TYPE_MENU_LIST, network_paths); |
| 999 } | 994 } |
| 1000 | 995 |
| 1001 } // namespace network_icon | 996 } // namespace network_icon |
| 1002 } // namespace ash | 997 } // namespace ash |
| OLD | NEW |