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

Side by Side Diff: chromeos/dbus/fake_dbus_thread_manager.h

Issue 181413006: Replace misc. network stub flags with more flexible ones (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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) 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 #ifndef CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ 5 #ifndef CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_
6 #define CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ 6 #define CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_
7 7
8 #include <map>
8 #include <string> 9 #include <string>
9 10
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "base/observer_list.h" 12 #include "base/observer_list.h"
12 #include "chromeos/chromeos_export.h" 13 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/dbus_thread_manager.h" 14 #include "chromeos/dbus/dbus_thread_manager.h"
14 15
15 namespace dbus { 16 namespace dbus {
16 class Bus; 17 class Bus;
17 class ObjectPath; 18 class ObjectPath;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 virtual NfcRecordClient* GetNfcRecordClient() OVERRIDE; 98 virtual NfcRecordClient* GetNfcRecordClient() OVERRIDE;
98 virtual NfcTagClient* GetNfcTagClient() OVERRIDE; 99 virtual NfcTagClient* GetNfcTagClient() OVERRIDE;
99 virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE; 100 virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE;
100 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE; 101 virtual PowerManagerClient* GetPowerManagerClient() OVERRIDE;
101 virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE; 102 virtual PowerPolicyController* GetPowerPolicyController() OVERRIDE;
102 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE; 103 virtual SessionManagerClient* GetSessionManagerClient() OVERRIDE;
103 virtual SMSClient* GetSMSClient() OVERRIDE; 104 virtual SMSClient* GetSMSClient() OVERRIDE;
104 virtual SystemClockClient* GetSystemClockClient() OVERRIDE; 105 virtual SystemClockClient* GetSystemClockClient() OVERRIDE;
105 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE; 106 virtual UpdateEngineClient* GetUpdateEngineClient() OVERRIDE;
106 107
108 virtual int GetPowerCycleDelay() const OVERRIDE;
109 virtual int GetShillInteractiveDelay() const OVERRIDE;
110 virtual std::string GetShillInitialState(
111 const std::string& type) const OVERRIDE;
112
107 private: 113 private:
114 // Parses the command line for Power stub switches and sets initial states.
115 void ParsePowerCommandLineSwitch();
116
117 // Parses the command line for Shill stub switches and sets initial states.
118 void ParseShillCommandLineSwitch();
119
120 // Parses options of format foo=bar, setting *arg0=foo, *arg1=bar (optional).
121 // Returns true if parsed successfully, false otherwise.
122 bool GetOptionArgs(const std::string& option,
123 std::string* arg0,
124 std::string* arg1);
125
126 // Sets the initial state for Shill networks matching |type_arg|.
127 void SetShillInitialNetworkState(std::string type_arg, std::string state_arg);
128
108 // Note: Keep this before other members so they can call AddObserver() in 129 // Note: Keep this before other members so they can call AddObserver() in
109 // their c'tors. 130 // their c'tors.
110 ObserverList<DBusThreadManagerObserver> observers_; 131 ObserverList<DBusThreadManagerObserver> observers_;
111 132
112 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_; 133 scoped_ptr<BluetoothAdapterClient> bluetooth_adapter_client_;
113 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_; 134 scoped_ptr<BluetoothAgentManagerClient> bluetooth_agent_manager_client_;
114 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_; 135 scoped_ptr<BluetoothDeviceClient> bluetooth_device_client_;
115 scoped_ptr<BluetoothInputClient> bluetooth_input_client_; 136 scoped_ptr<BluetoothInputClient> bluetooth_input_client_;
116 scoped_ptr<BluetoothProfileManagerClient> bluetooth_profile_manager_client_; 137 scoped_ptr<BluetoothProfileManagerClient> bluetooth_profile_manager_client_;
117 scoped_ptr<CrasAudioClient> cras_audio_client_; 138 scoped_ptr<CrasAudioClient> cras_audio_client_;
(...skipping 16 matching lines...) Expand all
134 scoped_ptr<NfcTagClient> nfc_tag_client_; 155 scoped_ptr<NfcTagClient> nfc_tag_client_;
135 scoped_ptr<PermissionBrokerClient> permission_broker_client_; 156 scoped_ptr<PermissionBrokerClient> permission_broker_client_;
136 scoped_ptr<SystemClockClient> system_clock_client_; 157 scoped_ptr<SystemClockClient> system_clock_client_;
137 scoped_ptr<PowerManagerClient> power_manager_client_; 158 scoped_ptr<PowerManagerClient> power_manager_client_;
138 scoped_ptr<SessionManagerClient> session_manager_client_; 159 scoped_ptr<SessionManagerClient> session_manager_client_;
139 scoped_ptr<SMSClient> sms_client_; 160 scoped_ptr<SMSClient> sms_client_;
140 scoped_ptr<UpdateEngineClient> update_engine_client_; 161 scoped_ptr<UpdateEngineClient> update_engine_client_;
141 162
142 scoped_ptr<PowerPolicyController> power_policy_controller_; 163 scoped_ptr<PowerPolicyController> power_policy_controller_;
143 164
165 int power_cycle_delay_; // Seconds over which to cycle power state
166 int shill_interactive_delay_; // Seconds to delay interactive actions
pneubeck (no reviews) 2014/02/27 09:04:37 you could put these two shill_* members into a Shi
stevenjb 2014/02/28 02:44:06 Moved implementation to clients.
167 std::map<std::string, std::string> shill_initial_state_map_;
168
144 DISALLOW_COPY_AND_ASSIGN(FakeDBusThreadManager); 169 DISALLOW_COPY_AND_ASSIGN(FakeDBusThreadManager);
145 }; 170 };
146 171
147 } // namespace chromeos 172 } // namespace chromeos
148 173
149 #endif // CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_ 174 #endif // CHROMEOS_DBUS_FAKE_DBUS_THREAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698