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

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

Issue 3744009: chromium-os:5494 Networks with identical names not handled properly. (Closed)
Patch Set: Rebase from trunk. Created 10 years, 2 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
« no previous file with comments | « chrome/browser/chromeos/network_list.cc ('k') | chrome/browser/chromeos/status/network_menu.cc » ('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) 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_dropdown_button.h" 5 #include "chrome/browser/chromeos/status/network_dropdown_button.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/cros/cros_library.h" 10 #include "chrome/browser/chromeos/cros/cros_library.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 79 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
80 if (CrosLibrary::Get()->EnsureLoaded()) { 80 if (CrosLibrary::Get()->EnsureLoaded()) {
81 // Always show the higher priority connection first. Ethernet then wifi. 81 // Always show the higher priority connection first. Ethernet then wifi.
82 if (cros->ethernet_connected()) { 82 if (cros->ethernet_connected()) {
83 animation_connecting_.Stop(); 83 animation_connecting_.Stop();
84 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_WIRED)); 84 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_WIRED));
85 SetText(l10n_util::GetString(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET)); 85 SetText(l10n_util::GetString(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET));
86 } else if (cros->wifi_connected()) { 86 } else if (cros->wifi_connected()) {
87 animation_connecting_.Stop(); 87 animation_connecting_.Stop();
88 SetIcon(IconForNetworkStrength(cros->wifi_strength(), true)); 88 SetIcon(IconForNetworkStrength(
89 SetText(ASCIIToWide(cros->wifi_name())); 89 cros->wifi_network().strength(), true));
90 SetText(ASCIIToWide(cros->wifi_network().name()));
90 } else if (cros->cellular_connected()) { 91 } else if (cros->cellular_connected()) {
91 animation_connecting_.Stop(); 92 animation_connecting_.Stop();
92 SetIcon(IconForNetworkStrength(cros->cellular_strength(), false)); 93 SetIcon(IconForNetworkStrength(
93 SetText(ASCIIToWide(cros->cellular_name())); 94 cros->cellular_network().strength(), false));
95 SetText(ASCIIToWide(cros->cellular_network().name()));
94 } else if (cros->wifi_connecting() || cros->cellular_connecting()) { 96 } else if (cros->wifi_connecting() || cros->cellular_connecting()) {
95 if (!animation_connecting_.is_animating()) { 97 if (!animation_connecting_.is_animating()) {
96 animation_connecting_.Reset(); 98 animation_connecting_.Reset();
97 animation_connecting_.StartThrobbing(-1); 99 animation_connecting_.StartThrobbing(-1);
98 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS1_BLACK)); 100 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS1_BLACK));
99 } 101 }
100 102
101 if (cros->wifi_connecting()) 103 if (cros->wifi_connecting())
102 SetText(ASCIIToWide(cros->wifi_name())); 104 SetText(ASCIIToWide(cros->wifi_network().name()));
103 else if (cros->cellular_connecting()) 105 else if (cros->cellular_connecting())
104 SetText(ASCIIToWide(cros->cellular_name())); 106 SetText(ASCIIToWide(cros->cellular_network().name()));
105 } 107 }
106 108
107 if (!cros->Connected() && !cros->Connecting()) { 109 if (!cros->Connected() && !cros->Connecting()) {
108 animation_connecting_.Stop(); 110 animation_connecting_.Stop();
109 SetIcon(SkBitmap()); 111 SetIcon(SkBitmap());
110 SetText(l10n_util::GetString(IDS_NETWORK_SELECTION_NONE)); 112 SetText(l10n_util::GetString(IDS_NETWORK_SELECTION_NONE));
111 } 113 }
112 } else { 114 } else {
113 animation_connecting_.Stop(); 115 animation_connecting_.Stop();
114 SetIcon(SkBitmap()); 116 SetIcon(SkBitmap());
115 SetText(l10n_util::GetString(IDS_STATUSBAR_NO_NETWORKS_MESSAGE)); 117 SetText(l10n_util::GetString(IDS_STATUSBAR_NO_NETWORKS_MESSAGE));
116 } 118 }
117 119
118 SchedulePaint(); 120 SchedulePaint();
119 } 121 }
120 122
121 } // namespace chromeos 123 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/network_list.cc ('k') | chrome/browser/chromeos/status/network_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698