summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/options/internet_page_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/options/internet_page_view.cc')
-rw-r--r--chrome/browser/chromeos/options/internet_page_view.cc35
1 files changed, 16 insertions, 19 deletions
diff --git a/chrome/browser/chromeos/options/internet_page_view.cc b/chrome/browser/chromeos/options/internet_page_view.cc
index a9f099f..794814a 100644
--- a/chrome/browser/chromeos/options/internet_page_view.cc
+++ b/chrome/browser/chromeos/options/internet_page_view.cc
@@ -301,7 +301,7 @@ class WirelessSection : public NetworkSection {
bool connected, int connection_type);
WifiNetworkVector wifi_networks_;
- CellularNetworkVector celluar_networks_;
+ CellularNetworkVector cellular_networks_;
DISALLOW_COPY_AND_ASSIGN(WirelessSection);
};
@@ -334,36 +334,34 @@ void WirelessSection::InitSection() {
}
// Cellular
- celluar_networks_ = cros->cellular_networks();
- // Cellular networks ssids.
- for (size_t i = 0; i < celluar_networks_.size(); ++i) {
- std::wstring name = ASCIIToWide(celluar_networks_[i]->name());
+ cellular_networks_ = cros->cellular_networks();
+ for (size_t i = 0; i < cellular_networks_.size(); ++i) {
+ std::wstring name = ASCIIToWide(cellular_networks_[i]->name());
SkBitmap icon = NetworkMenu::IconForNetworkStrength(
- celluar_networks_[i]->strength(), true);
- // TODO(chocobo): Check cellular network 3g/edge.
- SkBitmap badge = *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_3G);
-// SkBitmap badge = *rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_EDGE);
+ cellular_networks_[i]->strength(), true);
+ SkBitmap badge =
+ NetworkMenu::BadgeForNetworkTechnology(cellular_networks_[i]);
icon = NetworkMenu::IconForDisplay(icon, badge);
- bool connecting = celluar_networks_[i]->connecting();
- bool connected = celluar_networks_[i]->connected();
+ bool connecting = cellular_networks_[i]->connecting();
+ bool connected = cellular_networks_[i]->connected();
AddWirelessNetwork(i, icon, name, connecting, connected, TYPE_CELLULAR);
}
}
void WirelessSection::ButtonClicked(int button, int connection_type, int id) {
if (connection_type == TYPE_CELLULAR) {
- if (static_cast<int>(celluar_networks_.size()) > id) {
+ if (static_cast<int>(cellular_networks_.size()) > id) {
if (button == CONNECT_BUTTON) {
// Connect to cellular network.
CrosLibrary::Get()->GetNetworkLibrary()->ConnectToCellularNetwork(
- celluar_networks_[id]);
+ cellular_networks_[id]);
} else if (button == DISCONNECT_BUTTON) {
CrosLibrary::Get()->GetNetworkLibrary()->DisconnectFromWirelessNetwork(
- celluar_networks_[id]);
+ cellular_networks_[id]);
} else {
- CreateModalPopup(new NetworkConfigView(celluar_networks_[id]));
+ CreateModalPopup(new NetworkConfigView(cellular_networks_[id]));
}
}
} else if (connection_type == TYPE_WIFI) {
@@ -428,7 +426,6 @@ class RememberedSection : public NetworkSection {
private:
WifiNetworkVector wifi_networks_;
- CellularNetworkVector celluar_networks_;
DISALLOW_COPY_AND_ASSIGN(RememberedSection);
};
@@ -570,14 +567,14 @@ InternetPageView::InternetPageView(Profile* profile)
scroll_view_(new views::ScrollView) {
NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary();
cros->UpdateSystemInfo();
- cros->AddObserver(this);
+ cros->AddNetworkManagerObserver(this);
}
InternetPageView::~InternetPageView() {
- CrosLibrary::Get()->GetNetworkLibrary()->RemoveObserver(this);
+ CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this);
}
-void InternetPageView::NetworkChanged(NetworkLibrary* obj) {
+void InternetPageView::OnNetworkManagerChanged(NetworkLibrary* obj) {
// Refresh wired, wireless, and remembered networks.
// Remember the current scroll region, and try to scroll back afterwards.
gfx::Rect rect = scroll_view_->GetVisibleRect();