| 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 "chrome/browser/chromeos/status/network_menu_icon.h" | 5 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 } else { | 627 } else { |
| 628 text_ = UTF8ToUTF16(connecting_network_->name()); | 628 text_ = UTF8ToUTF16(connecting_network_->name()); |
| 629 } | 629 } |
| 630 } | 630 } |
| 631 | 631 |
| 632 // Sets up the icon and badges for GenerateBitmap(). | 632 // Sets up the icon and badges for GenerateBitmap(). |
| 633 void NetworkMenuIcon::SetIconAndText() { | 633 void NetworkMenuIcon::SetIconAndText() { |
| 634 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); | 634 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); |
| 635 DCHECK(cros); | 635 DCHECK(cros); |
| 636 | 636 |
| 637 if (cros->wifi_scanning()) |
| 638 return; // Don't update icon while scanning |
| 639 |
| 637 icon_->ClearIconAndBadges(); | 640 icon_->ClearIconAndBadges(); |
| 638 | 641 |
| 639 // If we are connecting to a network, display that. | 642 // If we are connecting to a network, display that. |
| 640 connecting_network_ = GetConnectingNetwork(); | 643 connecting_network_ = GetConnectingNetwork(); |
| 641 if (connecting_network_) { | 644 if (connecting_network_) { |
| 642 SetConnectingIconAndText(); | 645 SetConnectingIconAndText(); |
| 643 return; | 646 return; |
| 644 } | 647 } |
| 645 | 648 |
| 646 // If not connecting to a network, show the active or connected network. | 649 // If not connecting to a network, show the active or connected network. |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 const gfx::ImageSkia NetworkMenuIcon::GetConnectedImage(ImageType type, | 878 const gfx::ImageSkia NetworkMenuIcon::GetConnectedImage(ImageType type, |
| 876 ResourceColorTheme color) { | 879 ResourceColorTheme color) { |
| 877 return GetImage(type, NumImages(type) - 1, color); | 880 return GetImage(type, NumImages(type) - 1, color); |
| 878 } | 881 } |
| 879 | 882 |
| 880 int NetworkMenuIcon::NumImages(ImageType type) { | 883 int NetworkMenuIcon::NumImages(ImageType type) { |
| 881 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; | 884 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; |
| 882 } | 885 } |
| 883 | 886 |
| 884 } // chromeos | 887 } // chromeos |
| OLD | NEW |