Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: ash/system/chromeos/network/network_icon.cc

Issue 14137017: Add TechnologyState to NetworkStateHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/system/chromeos/network/network_state_list_detailed_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/system/chromeos/network/network_state_list_detailed_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698