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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // If |get_current_channel| is set to true, calls |callback| with | 129 // If |get_current_channel| is set to true, calls |callback| with |
130 // the name of the channel that the device is currently | 130 // the name of the channel that the device is currently |
131 // on. Otherwise, it calls it with the name of the channel the | 131 // on. Otherwise, it calls it with the name of the channel the |
132 // device is supposed to be (in case of a pending channel | 132 // device is supposed to be (in case of a pending channel |
133 // change). On error, calls |callback| with an empty string. | 133 // change). On error, calls |callback| with an empty string. |
134 virtual void GetChannel(bool get_current_channel, | 134 virtual void GetChannel(bool get_current_channel, |
135 const GetChannelCallback& callback) = 0; | 135 const GetChannelCallback& callback) = 0; |
136 | 136 |
137 // Called once GetEolStatus() is complete. Takes one parameter; | 137 // Called once GetEolStatus() is complete. Takes one parameter; |
138 // - EolStatus: the eol status of the device. | 138 // - EndOfLife Status: the end of life status of the device. |
139 typedef base::Callback<void(int status)> GetEolStatusCallback; | 139 typedef base::Callback<void(update_engine::EndOfLifeStatus status)> |
| 140 GetEolStatusCallback; |
140 | 141 |
141 // Get Eol status of the device and calls |callback| when completed. | 142 // Get EndOfLife status of the device and calls |callback| when completed. |
142 virtual void GetEolStatus(const GetEolStatusCallback& callback) = 0; | 143 virtual void GetEolStatus(const GetEolStatusCallback& callback) = 0; |
143 | 144 |
144 // Returns an empty UpdateCheckCallback that does nothing. | 145 // Returns an empty UpdateCheckCallback that does nothing. |
145 static UpdateCheckCallback EmptyUpdateCheckCallback(); | 146 static UpdateCheckCallback EmptyUpdateCheckCallback(); |
146 | 147 |
147 // Creates the instance. | 148 // Creates the instance. |
148 static UpdateEngineClient* Create(DBusClientImplementationType type); | 149 static UpdateEngineClient* Create(DBusClientImplementationType type); |
149 | 150 |
150 // Returns true if |target_channel| is more stable than |current_channel|. | 151 // Returns true if |target_channel| is more stable than |current_channel|. |
151 static bool IsTargetChannelMoreStable(const std::string& current_channel, | 152 static bool IsTargetChannelMoreStable(const std::string& current_channel, |
152 const std::string& target_channel); | 153 const std::string& target_channel); |
153 | 154 |
154 protected: | 155 protected: |
155 // Create() should be used instead. | 156 // Create() should be used instead. |
156 UpdateEngineClient(); | 157 UpdateEngineClient(); |
157 | 158 |
158 private: | 159 private: |
159 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); | 160 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); |
160 }; | 161 }; |
161 | 162 |
162 } // namespace chromeos | 163 } // namespace chromeos |
163 | 164 |
164 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ | 165 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ |
OLD | NEW |