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 // Don't show any account management related buttons if the activation |
| 1783 // state is unknown or no payment portal URL is available. |
| 1784 std::string support_url; |
| 1785 if (cellular->activation_state() == flimflam::kActivationStateUnknown || |
| 1786 !dictionary->GetString(kTagSupportUrl, &support_url) || |
| 1787 support_url.empty()) { |
| 1788 VLOG(2) << "No support URL is available. Don't display buttons."; |
| 1789 return; |
| 1790 } |
| 1791 |
1782 if (cellular->activation_state() != flimflam::kActivationStateActivating && | 1792 if (cellular->activation_state() != flimflam::kActivationStateActivating && |
1783 cellular->activation_state() != flimflam::kActivationStateActivated) { | 1793 cellular->activation_state() != flimflam::kActivationStateActivated) { |
1784 dictionary->SetBoolean(kTagShowActivateButton, true); | 1794 dictionary->SetBoolean(kTagShowActivateButton, true); |
1785 } else { | 1795 } else { |
1786 const MobileConfig::Carrier* carrier = | 1796 const MobileConfig::Carrier* carrier = |
1787 MobileConfig::GetInstance()->GetCarrier(carrier_id); | 1797 MobileConfig::GetInstance()->GetCarrier(carrier_id); |
1788 if (carrier && carrier->show_portal_button()) { | 1798 if (carrier && carrier->show_portal_button()) { |
1789 // The button should be shown for a LTE network even when the LTE network | 1799 // 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 | 1800 // 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. | 1801 // 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()); | 1986 cellular && cellular->support_network_scan()); |
1977 | 1987 |
1978 dictionary->SetBoolean(kTagWimaxAvailable, | 1988 dictionary->SetBoolean(kTagWimaxAvailable, |
1979 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); | 1989 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); |
1980 dictionary->SetBoolean(kTagWimaxEnabled, | 1990 dictionary->SetBoolean(kTagWimaxEnabled, |
1981 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); | 1991 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); |
1982 } | 1992 } |
1983 | 1993 |
1984 } // namespace options | 1994 } // namespace options |
1985 } // namespace chromeos | 1995 } // namespace chromeos |
OLD | NEW |