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

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: _ Created 8 years, 8 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/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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 569
570 void CrosRequestCellularRegister(const std::string& device_path, 570 void CrosRequestCellularRegister(const std::string& device_path,
571 const std::string& network_id, 571 const std::string& network_id,
572 chromeos::NetworkActionCallback callback, 572 chromeos::NetworkActionCallback callback,
573 void* object) { 573 void* object) {
574 chromeos::RequestCellularRegister(device_path.c_str(), network_id.c_str(), 574 chromeos::RequestCellularRegister(device_path.c_str(), network_id.c_str(),
575 callback, object); 575 callback, object);
576 } 576 }
577 577
578 bool CrosSetOfflineMode(bool offline) { 578 bool CrosSetOfflineMode(bool offline) {
579 return chromeos::SetOfflineMode(offline); 579 if (g_libcros_network_functions_enabled) {
580 return chromeos::SetOfflineMode(offline);
581 } else {
582 base::FundamentalValue value(offline);
583 return DBusThreadManager::Get()->GetFlimflamManagerClient()->
584 CallSetPropertyAndBlock(flimflam::kOfflineModeProperty, value);
stevenjb 2012/04/23 21:42:06 Use a non blocking version; the UI code doesn't re
hashimoto 2012/04/24 04:37:54 Done.
585 }
580 } 586 }
581 587
582 IPConfigStatus* CrosListIPConfigs(const std::string& device_path) { 588 IPConfigStatus* CrosListIPConfigs(const std::string& device_path) {
583 return chromeos::ListIPConfigs(device_path.c_str()); 589 return chromeos::ListIPConfigs(device_path.c_str());
584 } 590 }
585 591
586 bool CrosAddIPConfig(const std::string& device_path, IPConfigType type) { 592 bool CrosAddIPConfig(const std::string& device_path, IPConfigType type) {
587 if (g_libcros_network_functions_enabled) { 593 if (g_libcros_network_functions_enabled) {
588 return chromeos::AddIPConfig(device_path.c_str(), type); 594 return chromeos::AddIPConfig(device_path.c_str(), type);
589 } else { 595 } else {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 ScopedGHashTable ghash( 671 ScopedGHashTable ghash(
666 ConvertDictionaryValueToStringValueGHashTable(properties)); 672 ConvertDictionaryValueToStringValueGHashTable(properties));
667 chromeos::ConfigureService("", ghash.get(), OnConfigureService, NULL); 673 chromeos::ConfigureService("", ghash.get(), OnConfigureService, NULL);
668 } else { 674 } else {
669 DBusThreadManager::Get()->GetFlimflamManagerClient()->ConfigureService( 675 DBusThreadManager::Get()->GetFlimflamManagerClient()->ConfigureService(
670 properties, base::Bind(&DoNothing)); 676 properties, base::Bind(&DoNothing));
671 } 677 }
672 } 678 }
673 679
674 } // namespace chromeos 680 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698