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

Unified Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 10201015: [cros] Add network tray item for mobile network setup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 8 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
Index: chrome/browser/chromeos/system/ash_system_tray_delegate.cc
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index 1922b4c8e0693a01c290b52703d57877849bf0c5..eb61bc16f27a013ffe09c1fc0f667716f5f1bd32 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -595,25 +595,37 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
}
virtual bool GetCellularCarrierInfo(std::string* carrier_id,
- std::string* topup_url) OVERRIDE {
+ std::string* topup_url,
+ std::string* setup_url) OVERRIDE {
+ bool result = false;
NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary();
const NetworkDevice* cellular = crosnet->FindCellularDevice();
- if (cellular) {
- MobileConfig* config = MobileConfig::GetInstance();
- if (config->IsReady()) {
- *carrier_id = crosnet->GetCellularHomeCarrierId();
- const MobileConfig::Carrier* carrier = config->GetCarrier(*carrier_id);
- if (carrier) {
- *topup_url = carrier->top_up_url();
- return true;
+ if (!cellular)
+ return false;
+
+ MobileConfig* config = MobileConfig::GetInstance();
+ if (config->IsReady()) {
+ *carrier_id = crosnet->GetCellularHomeCarrierId();
+ const MobileConfig::Carrier* carrier = config->GetCarrier(*carrier_id);
+ if (carrier) {
+ *topup_url = carrier->top_up_url();
+ result = true;
+ }
+ const MobileConfig::LocaleConfig* locale_config =
+ config->GetLocaleConfig();
+ if (locale_config) {
+ // Only link to setup URL if SIM card is not inserted.
+ if (cellular->is_sim_absent()) {
+ *setup_url = locale_config->setup_url();
+ result = true;
}
}
}
- return false;
+ return result;
}
- virtual void ShowCellularTopupURL(const std::string& topup_url) OVERRIDE {
- GetAppropriateBrowser()->ShowSingletonTab(GURL(topup_url));
+ virtual void ShowCellularURL(const std::string& url) OVERRIDE {
+ GetAppropriateBrowser()->ShowSingletonTab(GURL(url));
}
virtual void ChangeProxySettings() OVERRIDE {
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698