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

Unified Diff: chrome/browser/chromeos/dom_ui/internet_options_handler.cc

Issue 6343004: Use signal strength of detected networks when displaying remembered networks. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/dom_ui/internet_options_handler.cc
diff --git a/chrome/browser/chromeos/dom_ui/internet_options_handler.cc b/chrome/browser/chromeos/dom_ui/internet_options_handler.cc
index 1b37ceadaa14506277ab47645ea9ead226e5723e..51ae165ea03c64d4644d6c81b491bfda3635d025 100644
--- a/chrome/browser/chromeos/dom_ui/internet_options_handler.cc
+++ b/chrome/browser/chromeos/dom_ui/internet_options_handler.cc
@@ -1004,9 +1004,28 @@ ListValue* InternetOptionsHandler::GetRememberedList() {
const chromeos::WifiNetworkVector& wifi_networks =
cros->remembered_wifi_networks();
+ const chromeos::WifiNetworkVector& live_wifi_networks =
+ cros->wifi_networks();
stevenjb 2011/01/21 17:11:18 Since we don't use "live_wifi_networks" elsewhere
+
for (chromeos::WifiNetworkVector::const_iterator it =
wifi_networks.begin(); it != wifi_networks.end(); ++it) {
Charlie Lee 2011/01/21 19:21:09 I would recommend instead of doing this in a doubl
- SkBitmap icon = *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0_BLACK);
+ // The remembered networks from libcros/flimflam don't include the signal
+ // strength. So, if this remembered network has the same name (SSID) as a
+ // live one, use the live one's signal strength.
+ chromeos::WifiNetworkVector::const_iterator lit =
+ live_wifi_networks.begin();
+ for ( ; lit != live_wifi_networks.end(); ++lit) {
+ if ((*it)->name() == (*lit)->name())
+ break;
stevenjb 2011/01/21 17:11:18 Need to compare both name() and encryption(). We s
+ }
+ // Don't show active network in the remembered list.
+ if (lit != live_wifi_networks.end() && (*lit)->connected())
+ continue;
+ SkBitmap icon;
+ if (lit == live_wifi_networks.end())
+ icon = *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0_BLACK);
+ else
+ icon = chromeos::NetworkMenu::IconForNetworkStrength(*lit, true);
if ((*it)->encrypted()) {
icon = chromeos::NetworkMenu::IconForDisplay(icon,
*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_SECURE));
stevenjb 2011/01/21 17:11:18 Does the secure icon trump the signal strength ico
Charlie Lee 2011/01/21 19:21:09 Isn't the secure icon just a badge? If so, then we
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698