Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_button.h" | 5 #include "chrome/browser/chromeos/status/network_menu_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 return host_->ShouldOpenButtonOptions(this); | 111 return host_->ShouldOpenButtonOptions(this); |
| 112 } | 112 } |
| 113 | 113 |
| 114 //////////////////////////////////////////////////////////////////////////////// | 114 //////////////////////////////////////////////////////////////////////////////// |
| 115 // NetworkMenuButton, private methods | 115 // NetworkMenuButton, private methods |
| 116 | 116 |
| 117 void NetworkMenuButton::SetNetworkIcon(NetworkLibrary* cros, | 117 void NetworkMenuButton::SetNetworkIcon(NetworkLibrary* cros, |
| 118 const Network* network) { | 118 const Network* network) { |
| 119 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 119 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 120 | 120 |
| 121 if (!cros || !CrosLibrary::Get()->EnsureLoaded()) { | 121 if (!cros || !CrosLibrary::Get()->EnsureLoaded() || cros->IsLocked()) { |
| 122 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); | 122 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); |
| 123 SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_WARNING)); | 123 SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_WARNING)); |
| 124 SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16( | 124 SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16( |
| 125 IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP))); | 125 IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP))); |
|
Charlie Lee
2011/01/21 00:24:37
fix tooltip to be more clear?
zel
2011/01/21 19:14:49
On the second thought, I will better leave the ico
| |
| 126 return; | 126 return; |
| 127 } | 127 } |
| 128 | 128 |
| 129 if (!cros->Connected() && !cros->Connecting()) { | 129 if (!cros->Connected() && !cros->Connecting()) { |
| 130 animation_connecting_.Stop(); | 130 animation_connecting_.Stop(); |
| 131 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); | 131 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); |
| 132 SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_DISCONNECTED)); | 132 SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_DISCONNECTED)); |
| 133 SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16( | 133 SetTooltipText(UTF16ToWide(l10n_util::GetStringUTF16( |
| 134 IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP))); | 134 IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP))); |
| 135 return; | 135 return; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 cros->RemoveNetworkObserver(active_network_, this); | 195 cros->RemoveNetworkObserver(active_network_, this); |
| 196 } | 196 } |
| 197 if (!new_network.empty()) { | 197 if (!new_network.empty()) { |
| 198 cros->AddNetworkObserver(new_network, this); | 198 cros->AddNetworkObserver(new_network, this); |
| 199 } | 199 } |
| 200 active_network_ = new_network; | 200 active_network_ = new_network; |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace chromeos | 204 } // namespace chromeos |
| OLD | NEW |