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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1772 } | 1772 } |
| 1773 } | 1773 } |
| 1774 } | 1774 } |
| 1775 | 1775 |
| 1776 // Set Cellular Buttons Visibility | 1776 // Set Cellular Buttons Visibility |
| 1777 dictionary->SetBoolean( | 1777 dictionary->SetBoolean( |
| 1778 kTagDisableConnectButton, | 1778 kTagDisableConnectButton, |
| 1779 cellular->activation_state() == flimflam::kActivationStateActivating || | 1779 cellular->activation_state() == flimflam::kActivationStateActivating || |
| 1780 cellular->IsConnectingState()); | 1780 cellular->IsConnectingState()); |
| 1781 | 1781 |
| 1782 if (cellular->activation_state() == flimflam::kActivationStateUnknown) { | |
| 1783 // Don't show any account management related buttons if the activation | |
| 1784 // state is unknown and no payment portal URL is available. | |
| 1785 std::string url; | |
|
stevenjb
2013/08/14 17:48:53
nit: support_url
armansito
2013/08/14 23:12:00
Done.
| |
| 1786 if (!dictionary->GetString(kTagSupportUrl, &url) || url.empty()) | |
| 1787 return; | |
| 1788 } | |
| 1789 | |
| 1782 if (cellular->activation_state() != flimflam::kActivationStateActivating && | 1790 if (cellular->activation_state() != flimflam::kActivationStateActivating && |
| 1783 cellular->activation_state() != flimflam::kActivationStateActivated) { | 1791 cellular->activation_state() != flimflam::kActivationStateActivated) { |
| 1784 dictionary->SetBoolean(kTagShowActivateButton, true); | 1792 dictionary->SetBoolean(kTagShowActivateButton, true); |
| 1785 } else { | 1793 } else { |
| 1786 const MobileConfig::Carrier* carrier = | 1794 const MobileConfig::Carrier* carrier = |
| 1787 MobileConfig::GetInstance()->GetCarrier(carrier_id); | 1795 MobileConfig::GetInstance()->GetCarrier(carrier_id); |
| 1788 if (carrier && carrier->show_portal_button()) { | 1796 if (carrier && carrier->show_portal_button()) { |
| 1789 // The button should be shown for a LTE network even when the LTE network | 1797 // The button should be shown for a LTE network even when the LTE network |
| 1790 // is not connected, but CrOS is online. This is done to enable users to | 1798 // is not connected, but CrOS is online. This is done to enable users to |
| 1791 // update their plan even if they are out of credits. | 1799 // update their plan even if they are out of credits. |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1976 cellular && cellular->support_network_scan()); | 1984 cellular && cellular->support_network_scan()); |
| 1977 | 1985 |
| 1978 dictionary->SetBoolean(kTagWimaxAvailable, | 1986 dictionary->SetBoolean(kTagWimaxAvailable, |
| 1979 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); | 1987 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); |
| 1980 dictionary->SetBoolean(kTagWimaxEnabled, | 1988 dictionary->SetBoolean(kTagWimaxEnabled, |
| 1981 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); | 1989 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); |
| 1982 } | 1990 } |
| 1983 | 1991 |
| 1984 } // namespace options | 1992 } // namespace options |
| 1985 } // namespace chromeos | 1993 } // namespace chromeos |
| OLD | NEW |