OLD | NEW |
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_UPDATE_ENGINE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ |
6 #define CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ |
7 | 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
8 #include "base/callback.h" | 11 #include "base/callback.h" |
9 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
10 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
11 #include "chromeos/dbus/dbus_client.h" | 14 #include "chromeos/dbus/dbus_client.h" |
12 #include "chromeos/dbus/dbus_client_implementation_type.h" | 15 #include "chromeos/dbus/dbus_client_implementation_type.h" |
13 | 16 |
14 #include <string> | |
15 | |
16 namespace chromeos { | 17 namespace chromeos { |
17 | 18 |
18 // UpdateEngineClient is used to communicate with the update engine. | 19 // UpdateEngineClient is used to communicate with the update engine. |
19 class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { | 20 class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
20 public: | 21 public: |
21 // Edges for state machine | 22 // Edges for state machine |
22 // IDLE->CHECKING_FOR_UPDATE | 23 // IDLE->CHECKING_FOR_UPDATE |
23 // CHECKING_FOR_UPDATE->IDLE | 24 // CHECKING_FOR_UPDATE->IDLE |
24 // CHECKING_FOR_UPDATE->UPDATE_AVAILABLE | 25 // CHECKING_FOR_UPDATE->UPDATE_AVAILABLE |
25 // ... | 26 // ... |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // change). On error, calls |callback| with an empty string. | 128 // change). On error, calls |callback| with an empty string. |
128 virtual void GetChannel(bool get_current_channel, | 129 virtual void GetChannel(bool get_current_channel, |
129 const GetChannelCallback& callback) = 0; | 130 const GetChannelCallback& callback) = 0; |
130 | 131 |
131 // Returns an empty UpdateCheckCallback that does nothing. | 132 // Returns an empty UpdateCheckCallback that does nothing. |
132 static UpdateCheckCallback EmptyUpdateCheckCallback(); | 133 static UpdateCheckCallback EmptyUpdateCheckCallback(); |
133 | 134 |
134 // Creates the instance. | 135 // Creates the instance. |
135 static UpdateEngineClient* Create(DBusClientImplementationType type); | 136 static UpdateEngineClient* Create(DBusClientImplementationType type); |
136 | 137 |
| 138 // Returns true if |target_channel| is more stable than |current_channel|. |
| 139 static bool IsTargetChannelMoreStable(const std::string& current_channel, |
| 140 const std::string& target_channel); |
| 141 |
137 protected: | 142 protected: |
138 // Create() should be used instead. | 143 // Create() should be used instead. |
139 UpdateEngineClient(); | 144 UpdateEngineClient(); |
140 | 145 |
141 private: | 146 private: |
142 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); | 147 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); |
143 }; | 148 }; |
144 | 149 |
145 } // namespace chromeos | 150 } // namespace chromeos |
146 | 151 |
147 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ | 152 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ |
OLD | NEW |