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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 12256049: Don't show the view account button if a cellular network is not connected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/OWNERS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
stevenjb 2013/02/15 00:12:53 Shouldn't we check for cros->connected_network() i
rkc 2013/02/15 00:19:59 We're specifically checking if this cellular netwo
stevenjb 2013/02/15 00:22:52 OK, if it makes sense to ben, it's good enough for
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698