| 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/chromeos/network/network_icon.h" | 5 #include "ash/system/chromeos/network/network_icon.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/chromeos/network/network_icon_animation.h" | 8 #include "ash/system/chromeos/network/network_icon_animation.h" |
| 9 #include "ash/system/chromeos/network/network_icon_animation_observer.h" | 9 #include "ash/system/chromeos/network/network_icon_animation_observer.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 } else { | 688 } else { |
| 689 return UTF8ToUTF16(network->name()); | 689 return UTF8ToUTF16(network->name()); |
| 690 } | 690 } |
| 691 } | 691 } |
| 692 | 692 |
| 693 int GetCellularUninitializedMsg() { | 693 int GetCellularUninitializedMsg() { |
| 694 static base::Time s_uninitialized_state_time; | 694 static base::Time s_uninitialized_state_time; |
| 695 static int s_uninitialized_msg(0); | 695 static int s_uninitialized_msg(0); |
| 696 | 696 |
| 697 NetworkStateHandler* handler = NetworkStateHandler::Get(); | 697 NetworkStateHandler* handler = NetworkStateHandler::Get(); |
| 698 if (handler->TechnologyUninitialized( | 698 if (handler->GetTechnologyState(NetworkStateHandler::kMatchTypeMobile) |
| 699 NetworkStateHandler::kMatchTypeMobile)) { | 699 == NetworkStateHandler::TECHNOLOGY_UNINITIALIZED) { |
| 700 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; | 700 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_INITIALIZING_CELLULAR; |
| 701 s_uninitialized_state_time = base::Time::Now(); | 701 s_uninitialized_state_time = base::Time::Now(); |
| 702 return s_uninitialized_msg; | 702 return s_uninitialized_msg; |
| 703 } else if (handler->GetScanningByType( | 703 } else if (handler->GetScanningByType( |
| 704 NetworkStateHandler::kMatchTypeMobile)) { | 704 NetworkStateHandler::kMatchTypeMobile)) { |
| 705 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_CELLULAR_SCANNING; | 705 s_uninitialized_msg = IDS_ASH_STATUS_TRAY_CELLULAR_SCANNING; |
| 706 s_uninitialized_state_time = base::Time::Now(); | 706 s_uninitialized_state_time = base::Time::Now(); |
| 707 return s_uninitialized_msg; | 707 return s_uninitialized_msg; |
| 708 } | 708 } |
| 709 // There can be a delay between leaving the Initializing state and when | 709 // There can be a delay between leaving the Initializing state and when |
| 710 // a Cellular device shows up, so keep showing the initializing | 710 // a Cellular device shows up, so keep showing the initializing |
| 711 // animation for a bit to avoid flashing the disconnect icon. | 711 // animation for a bit to avoid flashing the disconnect icon. |
| 712 const int kInitializingDelaySeconds = 1; | 712 const int kInitializingDelaySeconds = 1; |
| 713 base::TimeDelta dtime = base::Time::Now() - s_uninitialized_state_time; | 713 base::TimeDelta dtime = base::Time::Now() - s_uninitialized_state_time; |
| 714 if (dtime.InSeconds() < kInitializingDelaySeconds) | 714 if (dtime.InSeconds() < kInitializingDelaySeconds) |
| 715 return s_uninitialized_msg; | 715 return s_uninitialized_msg; |
| 716 return 0; | 716 return 0; |
| 717 } | 717 } |
| 718 | 718 |
| 719 } // namespace network_icon | 719 } // namespace network_icon |
| 720 } // namespace ash | 720 } // namespace ash |
| OLD | NEW |