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

Side by Side Diff: chrome/browser/chromeos/cros/network_library_impl_cros.cc

Issue 15899015: Add CheckPortalList manager property to NetworkStateHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: force manager property update in shill manager client stub implementation Created 7 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/cros/network_library_impl_cros.h" 5 #include "chrome/browser/chromeos/cros/network_library_impl_cros.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_writer.h" // for debug output only. 9 #include "base/json/json_writer.h" // for debug output only.
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 17 matching lines...) Expand all
28 // Structure used to pass IP parameter info to a DoSetIPParameters callback, 28 // Structure used to pass IP parameter info to a DoSetIPParameters callback,
29 // since Bind only takes up to six parameters. 29 // since Bind only takes up to six parameters.
30 struct NetworkLibraryImplCros::IPParameterInfo { 30 struct NetworkLibraryImplCros::IPParameterInfo {
31 std::string address; 31 std::string address;
32 std::string netmask; 32 std::string netmask;
33 std::string gateway; 33 std::string gateway;
34 std::string name_servers; 34 std::string name_servers;
35 int dhcp_usage_mask; 35 int dhcp_usage_mask;
36 }; 36 };
37 37
38 namespace {
39
40 // List of interfaces that have portal check enabled by default.
41 const char kDefaultCheckPortalList[] = "ethernet,wifi,cellular";
42
43 } // namespace
44
45 //////////////////////////////////////////////////////////////////////////// 38 ////////////////////////////////////////////////////////////////////////////
46 39
47 NetworkLibraryImplCros::NetworkLibraryImplCros() 40 NetworkLibraryImplCros::NetworkLibraryImplCros()
48 : NetworkLibraryImplBase(), 41 : NetworkLibraryImplBase(),
49 weak_ptr_factory_(this) { 42 weak_ptr_factory_(this) {
50 } 43 }
51 44
52 NetworkLibraryImplCros::~NetworkLibraryImplCros() { 45 NetworkLibraryImplCros::~NetworkLibraryImplCros() {
53 STLDeleteValues(&monitored_networks_); 46 STLDeleteValues(&monitored_networks_);
54 STLDeleteValues(&monitored_devices_); 47 STLDeleteValues(&monitored_devices_);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 280
288 void NetworkLibraryImplCros::CallDeleteRememberedNetwork( 281 void NetworkLibraryImplCros::CallDeleteRememberedNetwork(
289 const std::string& profile_path, 282 const std::string& profile_path,
290 const std::string& service_path) { 283 const std::string& service_path) {
291 CrosDeleteServiceFromProfile(profile_path, service_path); 284 CrosDeleteServiceFromProfile(profile_path, service_path);
292 } 285 }
293 286
294 ////////////////////////////////////////////////////////////////////////////// 287 //////////////////////////////////////////////////////////////////////////////
295 // NetworkLibrary implementation. 288 // NetworkLibrary implementation.
296 289
297 void NetworkLibraryImplCros::SetCheckPortalList(
298 const std::string& check_portal_list) {
299 base::StringValue value(check_portal_list);
300 CrosSetNetworkManagerProperty(flimflam::kCheckPortalListProperty, value);
301 }
302
303 void NetworkLibraryImplCros::SetDefaultCheckPortalList() {
304 SetCheckPortalList(kDefaultCheckPortalList);
305 }
306
307 void NetworkLibraryImplCros::ChangePin(const std::string& old_pin, 290 void NetworkLibraryImplCros::ChangePin(const std::string& old_pin,
308 const std::string& new_pin) { 291 const std::string& new_pin) {
309 const NetworkDevice* cellular = FindCellularDevice(); 292 const NetworkDevice* cellular = FindCellularDevice();
310 if (!cellular) { 293 if (!cellular) {
311 NOTREACHED() << "Calling ChangePin method w/o cellular device."; 294 NOTREACHED() << "Calling ChangePin method w/o cellular device.";
312 return; 295 return;
313 } 296 }
314 sim_operation_ = SIM_OPERATION_CHANGE_PIN; 297 sim_operation_ = SIM_OPERATION_CHANGE_PIN;
315 CrosRequestChangePin( 298 CrosRequestChangePin(
316 cellular->device_path(), old_pin, new_pin, 299 cellular->device_path(), old_pin, new_pin,
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 RefreshIPConfig(network); 1349 RefreshIPConfig(network);
1367 } 1350 }
1368 1351
1369 // static 1352 // static
1370 bool NetworkLibraryImplCros::AreProfilePathsEqual(const NetworkProfile& a, 1353 bool NetworkLibraryImplCros::AreProfilePathsEqual(const NetworkProfile& a,
1371 const NetworkProfile& b) { 1354 const NetworkProfile& b) {
1372 return a.path == b.path; 1355 return a.path == b.path;
1373 } 1356 }
1374 1357
1375 } // namespace chromeos 1358 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/network_library_impl_cros.h ('k') | chrome/browser/chromeos/cros/network_library_impl_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698