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

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

Issue 10177001: Reimplement CrosSetOfflineMode without Libcros (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/cros_network_functions_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/cros_network_functions.h" 5 #include "chrome/browser/chromeos/cros/cros_network_functions.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/cros/gvalue_util.h" 10 #include "chrome/browser/chromeos/cros/gvalue_util.h"
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 callback, object); 706 callback, object);
707 } else { 707 } else {
708 DBusThreadManager::Get()->GetFlimflamDeviceClient()->Register( 708 DBusThreadManager::Get()->GetFlimflamDeviceClient()->Register(
709 dbus::ObjectPath(device_path), network_id, 709 dbus::ObjectPath(device_path), network_id,
710 base::Bind(&OnNetworkActionSuccess, device_path, callback, object), 710 base::Bind(&OnNetworkActionSuccess, device_path, callback, object),
711 base::Bind(&OnNetworkActionError, device_path, callback, object)); 711 base::Bind(&OnNetworkActionError, device_path, callback, object));
712 } 712 }
713 } 713 }
714 714
715 bool CrosSetOfflineMode(bool offline) { 715 bool CrosSetOfflineMode(bool offline) {
716 return chromeos::SetOfflineMode(offline); 716 if (g_libcros_network_functions_enabled) {
717 return chromeos::SetOfflineMode(offline);
718 } else {
719 base::FundamentalValue value(offline);
720 DBusThreadManager::Get()->GetFlimflamManagerClient()->SetProperty(
721 flimflam::kOfflineModeProperty, value, base::Bind(&DoNothing));
722 return true;
723 }
717 } 724 }
718 725
719 IPConfigStatus* CrosListIPConfigs(const std::string& device_path) { 726 IPConfigStatus* CrosListIPConfigs(const std::string& device_path) {
720 return chromeos::ListIPConfigs(device_path.c_str()); 727 return chromeos::ListIPConfigs(device_path.c_str());
721 } 728 }
722 729
723 bool CrosAddIPConfig(const std::string& device_path, IPConfigType type) { 730 bool CrosAddIPConfig(const std::string& device_path, IPConfigType type) {
724 if (g_libcros_network_functions_enabled) { 731 if (g_libcros_network_functions_enabled) {
725 return chromeos::AddIPConfig(device_path.c_str(), type); 732 return chromeos::AddIPConfig(device_path.c_str(), type);
726 } else { 733 } else {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 ScopedGHashTable ghash( 809 ScopedGHashTable ghash(
803 ConvertDictionaryValueToStringValueGHashTable(properties)); 810 ConvertDictionaryValueToStringValueGHashTable(properties));
804 chromeos::ConfigureService("", ghash.get(), OnConfigureService, NULL); 811 chromeos::ConfigureService("", ghash.get(), OnConfigureService, NULL);
805 } else { 812 } else {
806 DBusThreadManager::Get()->GetFlimflamManagerClient()->ConfigureService( 813 DBusThreadManager::Get()->GetFlimflamManagerClient()->ConfigureService(
807 properties, base::Bind(&DoNothing)); 814 properties, base::Bind(&DoNothing));
808 } 815 }
809 } 816 }
810 817
811 } // namespace chromeos 818 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros/cros_network_functions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698