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

Side by Side Diff: chrome/browser/chromeos/status/network_menu_button.cc

Issue 6292008: Added flags to prevent messing with network connections while 3G device is be... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | chrome/browser/resources/options/chromeos_internet_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698