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

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: 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
« no previous file with comments | « ash/system/tray/system_tray_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..741fa4d0c313bf21be74c147f3597c05ba347252 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -595,7 +595,9 @@ 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) {
@@ -605,15 +607,26 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
const MobileConfig::Carrier* carrier = config->GetCarrier(*carrier_id);
if (carrier) {
*topup_url = carrier->top_up_url();
- return true;
+ 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->technology_family() == TECHNOLOGY_FAMILY_GSM &&
Nikita (slow) 2012/04/24 10:41:50 Based on http://code.google.com/p/chromium-os/issu
+ !cellular->is_sim_locked() &&
+ cellular->imsi().empty()) {
+ *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 | « ash/system/tray/system_tray_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698