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

Side by Side Diff: chrome/browser/chromeos/status/network_menu.cc

Issue 14753003: Don't open mobile setup when activating Sprint network from network menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
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/chromeos/status/network_menu.h" 5 #include "chrome/browser/chromeos/status/network_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 std::string str = input; 57 std::string str = input;
58 size_t found = str.find('&'); 58 size_t found = str.find('&');
59 while (found != std::string::npos) { 59 while (found != std::string::npos) {
60 str.replace(found, 1, "&&"); 60 str.replace(found, 1, "&&");
61 found = str.find('&', found + 2); 61 found = str.find('&', found + 2);
62 } 62 }
63 return str; 63 return str;
64 } 64 }
65 65
66 // Activate a cellular network. 66 // Activate a cellular network.
67 void ActivateCellular(const chromeos::CellularNetwork* cellular) { 67 void ActivateCellular(chromeos::CellularNetwork* cellular) {
68 DCHECK(cellular); 68 DCHECK(cellular);
69 69
70 ash::Shell::GetInstance()->delegate()->OpenMobileSetup( 70 if (cellular->UsesDirectActivation()) {
71 cellular->service_path()); 71 cellular->StartActivation();
72 } else {
73 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(
74 cellular->service_path());
75 }
72 } 76 }
73 77
74 // Decides whether a network should be highlighted in the UI. 78 // Decides whether a network should be highlighted in the UI.
75 bool ShouldHighlightNetwork(const chromeos::Network* network) { 79 bool ShouldHighlightNetwork(const chromeos::Network* network) {
76 chromeos::NetworkLibrary* cros = 80 chromeos::NetworkLibrary* cros =
77 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); 81 chromeos::CrosLibrary::Get()->GetNetworkLibrary();
78 return cros->connected_network() ? network == cros->connected_network() : 82 return cros->connected_network() ? network == cros->connected_network() :
79 network == cros->connecting_network(); 83 network == cros->connecting_network();
80 } 84 }
81 85
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1110
1107 void NetworkMenu::ShowOtherVPN() { 1111 void NetworkMenu::ShowOtherVPN() {
1108 NetworkConfigView::ShowForType(TYPE_VPN, delegate_->GetNativeWindow()); 1112 NetworkConfigView::ShowForType(TYPE_VPN, delegate_->GetNativeWindow());
1109 } 1113 }
1110 1114
1111 void NetworkMenu::ShowOtherCellular() { 1115 void NetworkMenu::ShowOtherCellular() {
1112 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow()); 1116 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow());
1113 } 1117 }
1114 1118
1115 } // namespace chromeos 1119 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698