OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/system/chromeos/network/network_connect.h" | 5 #include "ash/system/chromeos/network/network_connect.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/chromeos/network/network_observer.h" | 8 #include "ash/system/chromeos/network/network_observer.h" |
9 #include "ash/system/chromeos/network/network_state_notifier.h" | 9 #include "ash/system/chromeos/network/network_state_notifier.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
11 #include "ash/system/tray/system_tray_notifier.h" | 11 #include "ash/system/tray/system_tray_notifier.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chromeos/login/login_state.h" | 16 #include "chromeos/login/login_state.h" |
17 #include "chromeos/network/device_state.h" | 17 #include "chromeos/network/device_state.h" |
| 18 #include "chromeos/network/network_activation_handler.h" |
18 #include "chromeos/network/network_configuration_handler.h" | 19 #include "chromeos/network/network_configuration_handler.h" |
19 #include "chromeos/network/network_connection_handler.h" | 20 #include "chromeos/network/network_connection_handler.h" |
20 #include "chromeos/network/network_event_log.h" | 21 #include "chromeos/network/network_event_log.h" |
21 #include "chromeos/network/network_handler_callbacks.h" | 22 #include "chromeos/network/network_handler_callbacks.h" |
22 #include "chromeos/network/network_profile.h" | 23 #include "chromeos/network/network_profile.h" |
23 #include "chromeos/network/network_profile_handler.h" | 24 #include "chromeos/network/network_profile_handler.h" |
24 #include "chromeos/network/network_state.h" | 25 #include "chromeos/network/network_state.h" |
25 #include "chromeos/network/network_state_handler.h" | 26 #include "chromeos/network/network_state_handler.h" |
26 #include "grit/ash_strings.h" | 27 #include "grit/ash_strings.h" |
27 #include "third_party/cros_system_api/dbus/service_constants.h" | 28 #include "third_party/cros_system_api/dbus/service_constants.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 GetNetworkState(service_path); | 274 GetNetworkState(service_path); |
274 if (!cellular || cellular->type() != flimflam::kTypeCellular) { | 275 if (!cellular || cellular->type() != flimflam::kTypeCellular) { |
275 NET_LOG_ERROR("ActivateCellular with no Service", service_path); | 276 NET_LOG_ERROR("ActivateCellular with no Service", service_path); |
276 return; | 277 return; |
277 } | 278 } |
278 if (cellular->activation_state() == flimflam::kActivationStateActivated) { | 279 if (cellular->activation_state() == flimflam::kActivationStateActivated) { |
279 NET_LOG_ERROR("ActivateCellular for activated service", service_path); | 280 NET_LOG_ERROR("ActivateCellular for activated service", service_path); |
280 return; | 281 return; |
281 } | 282 } |
282 | 283 |
283 NetworkHandler::Get()->network_connection_handler()->ActivateNetwork( | 284 NetworkHandler::Get()->network_activation_handler()->Activate( |
284 service_path, | 285 service_path, |
285 "", // carrier | 286 "", // carrier |
286 base::Bind(&OnActivateSucceeded, service_path), | 287 base::Bind(&OnActivateSucceeded, service_path), |
287 base::Bind(&OnActivateFailed, service_path)); | 288 base::Bind(&OnActivateFailed, service_path)); |
288 } | 289 } |
289 | 290 |
290 void ConfigureNetworkAndConnect(const std::string& service_path, | 291 void ConfigureNetworkAndConnect(const std::string& service_path, |
291 const base::DictionaryValue& properties, | 292 const base::DictionaryValue& properties, |
292 bool shared) { | 293 bool shared) { |
293 NET_LOG_USER("ConfigureNetworkAndConnect", service_path); | 294 NET_LOG_USER("ConfigureNetworkAndConnect", service_path); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 if (StringToLowerASCII(error) == | 389 if (StringToLowerASCII(error) == |
389 StringToLowerASCII(std::string(flimflam::kUnknownString))) { | 390 StringToLowerASCII(std::string(flimflam::kUnknownString))) { |
390 return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); | 391 return l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); |
391 } | 392 } |
392 return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR, | 393 return l10n_util::GetStringFUTF16(IDS_NETWORK_UNRECOGNIZED_ERROR, |
393 UTF8ToUTF16(error)); | 394 UTF8ToUTF16(error)); |
394 } | 395 } |
395 | 396 |
396 } // network_connect | 397 } // network_connect |
397 } // ash | 398 } // ash |
OLD | NEW |