Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/options/chromeos/internet_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1554 kTagDisableConnectButton, | 1554 kTagDisableConnectButton, |
| 1555 cellular->activation_state() == chromeos::ACTIVATION_STATE_ACTIVATING || | 1555 cellular->activation_state() == chromeos::ACTIVATION_STATE_ACTIVATING || |
| 1556 cellular->connecting()); | 1556 cellular->connecting()); |
| 1557 | 1557 |
| 1558 if (cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATING && | 1558 if (cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATING && |
| 1559 cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATED) { | 1559 cellular->activation_state() != chromeos::ACTIVATION_STATE_ACTIVATED) { |
| 1560 dictionary->SetBoolean(kTagShowActivateButton, true); | 1560 dictionary->SetBoolean(kTagShowActivateButton, true); |
| 1561 } else { | 1561 } else { |
| 1562 const chromeos::MobileConfig::Carrier* carrier = | 1562 const chromeos::MobileConfig::Carrier* carrier = |
| 1563 chromeos::MobileConfig::GetInstance()->GetCarrier(carrier_id); | 1563 chromeos::MobileConfig::GetInstance()->GetCarrier(carrier_id); |
| 1564 if (carrier && carrier->show_portal_button()) { | 1564 if (carrier && carrier->show_portal_button() && cellular->connected()) { |
| 1565 // This will trigger BuyDataPlanCallback() so that | 1565 // This will trigger BuyDataPlanCallback() so that chrome://mobilesetup/ |
| 1566 // chrome://mobilesetup/ will open carrier specific portal. | 1566 // will open carrier specific portal. If the cellular network is not |
| 1567 // connected, don't show the view account button since we don't have an | |
| 1568 // active network to pull the account URL info from. | |
|
Ben Chan
2013/02/15 00:09:41
Is the cellular connection really necessary? I thi
| |
| 1567 dictionary->SetBoolean(kTagShowViewAccountButton, true); | 1569 dictionary->SetBoolean(kTagShowViewAccountButton, true); |
| 1568 } | 1570 } |
| 1569 } | 1571 } |
| 1570 } | 1572 } |
| 1571 | 1573 |
| 1572 gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const { | 1574 gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const { |
| 1573 // TODO(beng): This is an improper direct dependency on Browser. Route this | 1575 // TODO(beng): This is an improper direct dependency on Browser. Route this |
| 1574 // through some sort of delegate. | 1576 // through some sort of delegate. |
| 1575 Browser* browser = | 1577 Browser* browser = |
| 1576 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); | 1578 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1840 | 1842 |
| 1841 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); | 1843 dictionary->SetBoolean(kTagWimaxEnabled, cros_->wimax_enabled()); |
| 1842 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); | 1844 dictionary->SetBoolean(kTagWimaxAvailable, cros_->wimax_available()); |
| 1843 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); | 1845 dictionary->SetBoolean(kTagWimaxBusy, cros_->wimax_busy()); |
| 1844 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once | 1846 // TODO(kevers): The use of 'offline_mode' is not quite correct. Update once |
| 1845 // we have proper back-end support. | 1847 // we have proper back-end support. |
| 1846 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); | 1848 dictionary->SetBoolean(kTagAirplaneMode, cros_->offline_mode()); |
| 1847 } | 1849 } |
| 1848 | 1850 |
| 1849 } // namespace options | 1851 } // namespace options |
| OLD | NEW |