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/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 Loading... |
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 chromeos::NetworkLibrary* cros = |
71 cellular->service_path()); | 71 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
| 72 if (cros->CellularDeviceUsesDirectActivation()) { |
| 73 cellular->StartActivation(); |
| 74 } else { |
| 75 ash::Shell::GetInstance()->delegate()->OpenMobileSetup( |
| 76 cellular->service_path()); |
| 77 } |
72 } | 78 } |
73 | 79 |
74 // Decides whether a network should be highlighted in the UI. | 80 // Decides whether a network should be highlighted in the UI. |
75 bool ShouldHighlightNetwork(const chromeos::Network* network) { | 81 bool ShouldHighlightNetwork(const chromeos::Network* network) { |
76 chromeos::NetworkLibrary* cros = | 82 chromeos::NetworkLibrary* cros = |
77 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | 83 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
78 return cros->connected_network() ? network == cros->connected_network() : | 84 return cros->connected_network() ? network == cros->connected_network() : |
79 network == cros->connecting_network(); | 85 network == cros->connecting_network(); |
80 } | 86 } |
81 | 87 |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 | 1112 |
1107 void NetworkMenu::ShowOtherVPN() { | 1113 void NetworkMenu::ShowOtherVPN() { |
1108 NetworkConfigView::ShowForType(TYPE_VPN, delegate_->GetNativeWindow()); | 1114 NetworkConfigView::ShowForType(TYPE_VPN, delegate_->GetNativeWindow()); |
1109 } | 1115 } |
1110 | 1116 |
1111 void NetworkMenu::ShowOtherCellular() { | 1117 void NetworkMenu::ShowOtherCellular() { |
1112 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow()); | 1118 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow()); |
1113 } | 1119 } |
1114 | 1120 |
1115 } // namespace chromeos | 1121 } // namespace chromeos |
OLD | NEW |