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

Side by Side Diff: chromeos/dbus/shill_manager_client_stub.cc

Issue 12387065: Convert TrayVPN to use new NetworkState code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 "chromeos/dbus/shill_manager_client_stub.h" 5 #include "chromeos/dbus/shill_manager_client_stub.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/chromeos/chromeos_version.h" 8 #include "base/chromeos/chromeos_version.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 base::ListValue* list_property = NULL; 407 base::ListValue* list_property = NULL;
408 if (!stub_properties_.GetListWithoutPathExpansion( 408 if (!stub_properties_.GetListWithoutPathExpansion(
409 property, &list_property)) { 409 property, &list_property)) {
410 list_property = new base::ListValue; 410 list_property = new base::ListValue;
411 stub_properties_.SetWithoutPathExpansion(property, list_property); 411 stub_properties_.SetWithoutPathExpansion(property, list_property);
412 } 412 }
413 return list_property; 413 return list_property;
414 } 414 }
415 415
416 bool ShillManagerClientStub::TechnologyEnabled(const std::string& type) const { 416 bool ShillManagerClientStub::TechnologyEnabled(const std::string& type) const {
417 if (type == flimflam::kTypeVPN)
418 return true; // VPN is always "enabled" since there is no associated device
417 bool enabled = false; 419 bool enabled = false;
418 const base::ListValue* technologies; 420 const base::ListValue* technologies;
419 if (stub_properties_.GetListWithoutPathExpansion( 421 if (stub_properties_.GetListWithoutPathExpansion(
420 flimflam::kEnabledTechnologiesProperty, &technologies)) { 422 flimflam::kEnabledTechnologiesProperty, &technologies)) {
421 base::StringValue type_value(type); 423 base::StringValue type_value(type);
422 if (technologies->Find(type_value) != technologies->end()) 424 if (technologies->Find(type_value) != technologies->end())
423 enabled = true; 425 enabled = true;
424 } 426 }
425 return enabled; 427 return enabled;
426 } 428 }
(...skipping 17 matching lines...) Expand all
444 std::string type; 446 std::string type;
445 properties->GetString(flimflam::kTypeProperty, &type); 447 properties->GetString(flimflam::kTypeProperty, &type);
446 if (TechnologyEnabled(type)) 448 if (TechnologyEnabled(type))
447 new_service_list->Append((*iter)->DeepCopy()); 449 new_service_list->Append((*iter)->DeepCopy());
448 } 450 }
449 } 451 }
450 return new_service_list; 452 return new_service_list;
451 } 453 }
452 454
453 } // namespace chromeos 455 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698