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_state_notifier.h" | 8 #include "ash/system/chromeos/network/network_state_notifier.h" |
9 #include "ash/system/system_notifier.h" | 9 #include "ash/system/system_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_resources.h" | 27 #include "grit/ash_resources.h" |
27 #include "grit/ash_strings.h" | 28 #include "grit/ash_strings.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 // management URL is available. | 352 // management URL is available. |
352 if (!cellular->payment_url().empty()) | 353 if (!cellular->payment_url().empty()) |
353 ShowMobileSetup(service_path); | 354 ShowMobileSetup(service_path); |
354 return; | 355 return; |
355 } | 356 } |
356 if (cellular->activation_state() == flimflam::kActivationStateActivated) { | 357 if (cellular->activation_state() == flimflam::kActivationStateActivated) { |
357 NET_LOG_ERROR("ActivateCellular for activated service", service_path); | 358 NET_LOG_ERROR("ActivateCellular for activated service", service_path); |
358 return; | 359 return; |
359 } | 360 } |
360 | 361 |
361 NetworkHandler::Get()->network_connection_handler()->ActivateNetwork( | 362 NetworkHandler::Get()->network_activation_handler()->Activate( |
362 service_path, | 363 service_path, |
363 "", // carrier | 364 "", // carrier |
364 base::Bind(&OnActivateSucceeded, service_path), | 365 base::Bind(&OnActivateSucceeded, service_path), |
365 base::Bind(&OnActivateFailed, service_path)); | 366 base::Bind(&OnActivateFailed, service_path)); |
366 } | 367 } |
367 | 368 |
368 void ShowMobileSetup(const std::string& service_path) { | 369 void ShowMobileSetup(const std::string& service_path) { |
369 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); | 370 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
370 const NetworkState* cellular = handler->GetNetworkState(service_path); | 371 const NetworkState* cellular = handler->GetNetworkState(service_path); |
371 if (!cellular || cellular->type() != flimflam::kTypeCellular) { | 372 if (!cellular || cellular->type() != flimflam::kTypeCellular) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 501 |
501 void ShowNetworkSettings(const std::string& service_path) { | 502 void ShowNetworkSettings(const std::string& service_path) { |
502 if (!ash::Shell::HasInstance()) | 503 if (!ash::Shell::HasInstance()) |
503 return; | 504 return; |
504 ash::Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings( | 505 ash::Shell::GetInstance()->system_tray_delegate()->ShowNetworkSettings( |
505 service_path); | 506 service_path); |
506 } | 507 } |
507 | 508 |
508 } // network_connect | 509 } // network_connect |
509 } // ash | 510 } // ash |
OLD | NEW |