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

Side by Side Diff: chromeos/network/network_connection_handler.cc

Issue 181413006: Replace misc. network stub flags with more flexible ones (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Elim. shill_stub_helper and move functions to clients. Created 6 years, 9 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) 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 "chromeos/network/network_connection_handler.h" 5 #include "chromeos/network/network_connection_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
10 #include "base/location.h" 9 #include "base/location.h"
11 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
12 #include "chromeos/cert_loader.h" 11 #include "chromeos/cert_loader.h"
13 #include "chromeos/chromeos_switches.h"
14 #include "chromeos/dbus/dbus_thread_manager.h" 12 #include "chromeos/dbus/dbus_thread_manager.h"
15 #include "chromeos/dbus/shill_manager_client.h" 13 #include "chromeos/dbus/shill_manager_client.h"
16 #include "chromeos/dbus/shill_service_client.h" 14 #include "chromeos/dbus/shill_service_client.h"
17 #include "chromeos/network/client_cert_util.h" 15 #include "chromeos/network/client_cert_util.h"
18 #include "chromeos/network/network_configuration_handler.h" 16 #include "chromeos/network/network_configuration_handler.h"
19 #include "chromeos/network/network_event_log.h" 17 #include "chromeos/network/network_event_log.h"
20 #include "chromeos/network/network_handler_callbacks.h" 18 #include "chromeos/network/network_handler_callbacks.h"
21 #include "chromeos/network/network_profile_handler.h" 19 #include "chromeos/network/network_profile_handler.h"
22 #include "chromeos/network/network_state.h" 20 #include "chromeos/network/network_state.h"
23 #include "chromeos/network/network_state_handler.h" 21 #include "chromeos/network/network_state_handler.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 NET_LOG_EVENT("VPN Is Configured", service_path); 83 NET_LOG_EVENT("VPN Is Configured", service_path);
86 } 84 }
87 return false; 85 return false;
88 } 86 }
89 87
90 std::string GetDefaultUserProfilePath(const NetworkState* network) { 88 std::string GetDefaultUserProfilePath(const NetworkState* network) {
91 if (!NetworkHandler::IsInitialized() || 89 if (!NetworkHandler::IsInitialized() ||
92 !LoginState::Get()->IsUserAuthenticated() || 90 !LoginState::Get()->IsUserAuthenticated() ||
93 (network && network->type() == shill::kTypeWifi && 91 (network && network->type() == shill::kTypeWifi &&
94 network->security() == shill::kSecurityNone)) { 92 network->security() == shill::kSecurityNone)) {
95 return NetworkProfileHandler::kSharedProfilePath; 93 return NetworkProfileHandler::GetSharedProfilePath();
96 } 94 }
97 const NetworkProfile* profile = 95 const NetworkProfile* profile =
98 NetworkHandler::Get()->network_profile_handler()->GetDefaultUserProfile(); 96 NetworkHandler::Get()->network_profile_handler()->GetDefaultUserProfile();
99 return profile ? profile->path : NetworkProfileHandler::kSharedProfilePath; 97 return profile ? profile->path
98 : NetworkProfileHandler::GetSharedProfilePath();
100 } 99 }
101 100
102 } // namespace 101 } // namespace
103 102
104 const char NetworkConnectionHandler::kErrorNotFound[] = "not-found"; 103 const char NetworkConnectionHandler::kErrorNotFound[] = "not-found";
105 const char NetworkConnectionHandler::kErrorConnected[] = "connected"; 104 const char NetworkConnectionHandler::kErrorConnected[] = "connected";
106 const char NetworkConnectionHandler::kErrorConnecting[] = "connecting"; 105 const char NetworkConnectionHandler::kErrorConnecting[] = "connecting";
107 const char NetworkConnectionHandler::kErrorNotConnected[] = "not-connected"; 106 const char NetworkConnectionHandler::kErrorNotConnected[] = "not-connected";
108 const char NetworkConnectionHandler::kErrorPassphraseRequired[] = 107 const char NetworkConnectionHandler::kErrorPassphraseRequired[] =
109 "passphrase-required"; 108 "passphrase-required";
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 701
703 void NetworkConnectionHandler::HandleShillDisconnectSuccess( 702 void NetworkConnectionHandler::HandleShillDisconnectSuccess(
704 const std::string& service_path, 703 const std::string& service_path,
705 const base::Closure& success_callback) { 704 const base::Closure& success_callback) {
706 NET_LOG_EVENT("Disconnect Request Sent", service_path); 705 NET_LOG_EVENT("Disconnect Request Sent", service_path);
707 if (!success_callback.is_null()) 706 if (!success_callback.is_null())
708 success_callback.Run(); 707 success_callback.Run();
709 } 708 }
710 709
711 } // namespace chromeos 710 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698