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

Side by Side Diff: chrome/browser/chromeos/net/managed_network_configuration_handler.cc

Issue 12319145: Using the new Network*Handlers in networkingPrivate Extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed some closing periods from comments. Created 7 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 "chrome/browser/chromeos/net/managed_network_configuration_handler.h" 5 #include "chrome/browser/chromeos/net/managed_network_configuration_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 error_message))); 57 error_message)));
58 } 58 }
59 59
60 void TranslatePropertiesAndRunCallback( 60 void TranslatePropertiesAndRunCallback(
61 const network_handler::DictionaryResultCallback& callback, 61 const network_handler::DictionaryResultCallback& callback,
62 const std::string& service_path, 62 const std::string& service_path,
63 const base::DictionaryValue& shill_properties) { 63 const base::DictionaryValue& shill_properties) {
64 scoped_ptr<base::DictionaryValue> onc_network( 64 scoped_ptr<base::DictionaryValue> onc_network(
65 onc::TranslateShillServiceToONCPart( 65 onc::TranslateShillServiceToONCPart(
66 shill_properties, 66 shill_properties,
67 &onc::kNetworkConfigurationSignature)); 67 &onc::kNetworkWithStateSignature));
68 callback.Run(service_path, *onc_network); 68 callback.Run(service_path, *onc_network);
69 } 69 }
70 70
71 } // namespace 71 } // namespace
72 72
73 // static 73 // static
74 void ManagedNetworkConfigurationHandler::Initialize() { 74 void ManagedNetworkConfigurationHandler::Initialize() {
75 CHECK(!g_configuration_handler_instance); 75 CHECK(!g_configuration_handler_instance);
76 g_configuration_handler_instance = new ManagedNetworkConfigurationHandler; 76 g_configuration_handler_instance = new ManagedNetworkConfigurationHandler;
77 } 77 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (guid.empty()) { 123 if (guid.empty()) {
124 RunErrorCallback(service_path, 124 RunErrorCallback(service_path,
125 kSetOnUnconfiguredNetwork, 125 kSetOnUnconfiguredNetwork,
126 kSetOnUnconfiguredNetworkMessage, 126 kSetOnUnconfiguredNetworkMessage,
127 error_callback); 127 error_callback);
128 } 128 }
129 129
130 // TODO(pneubeck): Enforce policies. 130 // TODO(pneubeck): Enforce policies.
131 131
132 scoped_ptr<base::DictionaryValue> shill_dictionary( 132 scoped_ptr<base::DictionaryValue> shill_dictionary(
133 onc::TranslateONCObjectToShill( 133 onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature,
134 &onc::kNetworkConfigurationSignature, 134 properties));
135 properties));
136 135
137 NetworkConfigurationHandler::Get()->SetProperties(service_path, 136 NetworkConfigurationHandler::Get()->SetProperties(service_path,
138 *shill_dictionary, 137 *shill_dictionary,
139 callback, 138 callback,
140 error_callback); 139 error_callback);
141 } 140 }
142 141
143 void ManagedNetworkConfigurationHandler::Connect( 142 void ManagedNetworkConfigurationHandler::Connect(
144 const std::string& service_path, 143 const std::string& service_path,
145 const base::Closure& callback, 144 const base::Closure& callback,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 error_callback); 197 error_callback);
199 } 198 }
200 199
201 ManagedNetworkConfigurationHandler::ManagedNetworkConfigurationHandler() { 200 ManagedNetworkConfigurationHandler::ManagedNetworkConfigurationHandler() {
202 } 201 }
203 202
204 ManagedNetworkConfigurationHandler::~ManagedNetworkConfigurationHandler() { 203 ManagedNetworkConfigurationHandler::~ManagedNetworkConfigurationHandler() {
205 } 204 }
206 205
207 } // namespace chromeos 206 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698