diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-04 20:39:00 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-04 20:39:00 +0000 |
commit | 88471ffea5fcdfab97e07975c670ebe9ff4fec4a (patch) | |
tree | 417037c9615a97e109d0fb74ee7503576e2931f2 /chromeos/network/network_device_handler.h | |
parent | 787a090dea46d71ec7cc48d145215e975564db59 (diff) | |
download | chromium_src-88471ffea5fcdfab97e07975c670ebe9ff4fec4a.zip chromium_src-88471ffea5fcdfab97e07975c670ebe9ff4fec4a.tar.gz chromium_src-88471ffea5fcdfab97e07975c670ebe9ff4fec4a.tar.bz2 |
Enable NetworkStateHandler always
This CL should have no affect on Chrome's behavior.
It does the following:
* Removes --enable-new-network-handlers and always enables them
* Adds --ash-enable-new-network-status-area and uses that to control whether
or not to use the new status area code
* Adds --enable-new-network-change-notifier and uses that to control whether
or not to use the new NetworkStateHandler based network change notifier
* Deletes the unused NetworkDeviceHandler (this was added thinking that it
was needed for Geolocation, but it turned out that the code had changed
between Flimflam and Shill so it wasn't necessary)
BUG=161869
For chrome/browser/ui/webui/chromeos, ash/ash_switches:
TBR=xiyuan@chromium.org,sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12095106
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180505 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/network_device_handler.h')
-rw-r--r-- | chromeos/network/network_device_handler.h | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/chromeos/network/network_device_handler.h b/chromeos/network/network_device_handler.h deleted file mode 100644 index 0b90f04..0000000 --- a/chromeos/network/network_device_handler.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ -#define CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ - -#include <map> -#include <set> -#include <string> - -#include "base/memory/weak_ptr.h" -#include "base/observer_list.h" -#include "chromeos/chromeos_export.h" -#include "chromeos/dbus/dbus_method_call_status.h" -#include "chromeos/dbus/shill_property_changed_observer.h" - -namespace base { -class DictionaryValue; -class ListValue; -class Value; -} - -namespace chromeos { - -class CHROMEOS_EXPORT NetworkDeviceHandler - : public ShillPropertyChangedObserver { - public: - struct Device { - Device(); - ~Device(); - std::string type; - bool powered; - bool scanning; - int scan_interval; - }; - typedef std::map<std::string, Device> DeviceMap; - - class Observer { - public: - typedef NetworkDeviceHandler::DeviceMap DeviceMap; - - // Called when devices are updated. Passes the updated map of devices. - virtual void NetworkDevicesUpdated(const DeviceMap& devices) = 0; - - protected: - virtual ~Observer() {} - }; - - virtual ~NetworkDeviceHandler(); - - // Manage the global instance. Must be initialized before any calls to Get(). - static void Initialize(); - static void Shutdown(); - static NetworkDeviceHandler* Get(); - - // Add/remove observers. - void AddObserver(Observer* observer); - void RemoveObserver(Observer* observer); - - bool devices_ready() const { return devices_ready_; } - const DeviceMap& devices() const { return devices_; } - - // ShillPropertyChangedObserver overrides - virtual void OnPropertyChanged(const std::string& key, - const base::Value& value) OVERRIDE; - - private: - friend class NetworkDeviceHandlerTest; - NetworkDeviceHandler(); - void Init(); - - void ManagerPropertiesCallback(DBusMethodCallStatus call_status, - const base::DictionaryValue& properties); - void DevicePropertyChanged(const base::ListValue* devices); - void DevicePropertiesCallback(const std::string& device_path, - DBusMethodCallStatus call_status, - const base::DictionaryValue& properties); - void NetworkPropertiesCallback(const std::string& device_path, - const std::string& network_path, - DBusMethodCallStatus call_status, - const base::DictionaryValue& properties); - void GetDeviceProperties(const std::string& device_path, - const base::DictionaryValue& properties); - - // True when the device list is up to date. - bool devices_ready_; - - // Map of Device structs, valid when |devices_ready_| is true. - DeviceMap devices_; - - // Map of pending devices. - std::set<std::string> pending_device_paths_; - - // Observer list - ObserverList<Observer> observers_; - - // For Shill client callbacks - base::WeakPtrFactory<NetworkDeviceHandler> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(NetworkDeviceHandler); -}; - -} // namespace chromeos - -#endif // CHROMEOS_NETWORK_NETWORK_DEVICE_HANDLER_H_ |