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

Side by Side Diff: extensions/browser/api/networking_private/networking_private_chromeos.cc

Issue 987963002: Add forgetNetwork to networkingPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_chromeos. h" 5 #include "extensions/browser/api/networking_private/networking_private_chromeos. h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "chromeos/dbus/dbus_thread_manager.h" 10 #include "chromeos/dbus/dbus_thread_manager.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (!shared && !GetUserIdHash(browser_context_, &user_id_hash, &error)) { 196 if (!shared && !GetUserIdHash(browser_context_, &user_id_hash, &error)) {
197 failure_callback.Run(error); 197 failure_callback.Run(error);
198 return; 198 return;
199 } 199 }
200 200
201 GetManagedConfigurationHandler()->CreateConfiguration( 201 GetManagedConfigurationHandler()->CreateConfiguration(
202 user_id_hash, *properties, success_callback, 202 user_id_hash, *properties, success_callback,
203 base::Bind(&NetworkHandlerFailureCallback, failure_callback)); 203 base::Bind(&NetworkHandlerFailureCallback, failure_callback));
204 } 204 }
205 205
206 void NetworkingPrivateChromeOS::ForgetNetwork(
207 const std::string& guid,
208 const VoidCallback& success_callback,
209 const FailureCallback& failure_callback) {
210 std::string service_path, error;
211 if (!GetServicePathFromGuid(guid, &service_path, &error)) {
212 failure_callback.Run(error);
213 return;
214 }
215
216 GetManagedConfigurationHandler()->RemoveConfiguration(
217 service_path, success_callback,
218 base::Bind(&NetworkHandlerFailureCallback, failure_callback));
219 }
220
206 void NetworkingPrivateChromeOS::GetNetworks( 221 void NetworkingPrivateChromeOS::GetNetworks(
207 const std::string& network_type, 222 const std::string& network_type,
208 bool configured_only, 223 bool configured_only,
209 bool visible_only, 224 bool visible_only,
210 int limit, 225 int limit,
211 const NetworkListCallback& success_callback, 226 const NetworkListCallback& success_callback,
212 const FailureCallback& failure_callback) { 227 const FailureCallback& failure_callback) {
213 NetworkTypePattern pattern = 228 NetworkTypePattern pattern =
214 chromeos::onc::NetworkTypePatternFromOncType(network_type); 229 chromeos::onc::NetworkTypePatternFromOncType(network_type);
215 scoped_ptr<base::ListValue> network_properties_list = 230 scoped_ptr<base::ListValue> network_properties_list =
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 352
338 return true; 353 return true;
339 } 354 }
340 355
341 bool NetworkingPrivateChromeOS::RequestScan() { 356 bool NetworkingPrivateChromeOS::RequestScan() {
342 GetStateHandler()->RequestScan(); 357 GetStateHandler()->RequestScan();
343 return true; 358 return true;
344 } 359 }
345 360
346 } // namespace extensions 361 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698