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