| 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> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "chromeos/chromeos_export.h" | 15 #include "chromeos/chromeos_export.h" |
| 16 #include "chromeos/dbus/dbus_client.h" | 16 #include "chromeos/dbus/dbus_client.h" |
| 17 #include "chromeos/dbus/dbus_client_implementation_type.h" | 17 #include "chromeos/dbus/dbus_client_implementation_type.h" |
| 18 #include "dbus/message.h" |
| 18 #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h" | 19 #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h" |
| 19 | 20 |
| 20 namespace chromeos { | 21 namespace chromeos { |
| 21 | 22 |
| 22 // UpdateEngineClient is used to communicate with the update engine. | 23 // UpdateEngineClient is used to communicate with the update engine. |
| 23 class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { | 24 class CHROMEOS_EXPORT UpdateEngineClient : public DBusClient { |
| 24 public: | 25 public: |
| 25 // Edges for state machine | 26 // Edges for state machine |
| 26 // IDLE->CHECKING_FOR_UPDATE | 27 // IDLE->CHECKING_FOR_UPDATE |
| 27 // CHECKING_FOR_UPDATE->IDLE | 28 // CHECKING_FOR_UPDATE->IDLE |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const GetChannelCallback& callback) = 0; | 136 const GetChannelCallback& callback) = 0; |
| 136 | 137 |
| 137 // Called once GetEolStatus() is complete. Takes one parameter; | 138 // Called once GetEolStatus() is complete. Takes one parameter; |
| 138 // - EndOfLife Status: the end of life status of the device. | 139 // - EndOfLife Status: the end of life status of the device. |
| 139 typedef base::Callback<void(update_engine::EndOfLifeStatus status)> | 140 typedef base::Callback<void(update_engine::EndOfLifeStatus status)> |
| 140 GetEolStatusCallback; | 141 GetEolStatusCallback; |
| 141 | 142 |
| 142 // Get EndOfLife status of the device and calls |callback| when completed. | 143 // Get EndOfLife status of the device and calls |callback| when completed. |
| 143 virtual void GetEolStatus(const GetEolStatusCallback& callback) = 0; | 144 virtual void GetEolStatus(const GetEolStatusCallback& callback) = 0; |
| 144 | 145 |
| 146 // Either allow or disallow receiving updates over cellular connections. |
| 147 // Synchronous (blocking) method. |
| 148 virtual void SetUpdateOverCellularPermission( |
| 149 bool allowed, |
| 150 const base::Closure& callback) = 0; |
| 151 |
| 145 // Returns an empty UpdateCheckCallback that does nothing. | 152 // Returns an empty UpdateCheckCallback that does nothing. |
| 146 static UpdateCheckCallback EmptyUpdateCheckCallback(); | 153 static UpdateCheckCallback EmptyUpdateCheckCallback(); |
| 147 | 154 |
| 148 // Creates the instance. | 155 // Creates the instance. |
| 149 static UpdateEngineClient* Create(DBusClientImplementationType type); | 156 static UpdateEngineClient* Create(DBusClientImplementationType type); |
| 150 | 157 |
| 151 // Returns true if |target_channel| is more stable than |current_channel|. | 158 // Returns true if |target_channel| is more stable than |current_channel|. |
| 152 static bool IsTargetChannelMoreStable(const std::string& current_channel, | 159 static bool IsTargetChannelMoreStable(const std::string& current_channel, |
| 153 const std::string& target_channel); | 160 const std::string& target_channel); |
| 154 | 161 |
| 155 protected: | 162 protected: |
| 156 // Create() should be used instead. | 163 // Create() should be used instead. |
| 157 UpdateEngineClient(); | 164 UpdateEngineClient(); |
| 158 | 165 |
| 159 private: | 166 private: |
| 160 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); | 167 DISALLOW_COPY_AND_ASSIGN(UpdateEngineClient); |
| 161 }; | 168 }; |
| 162 | 169 |
| 163 } // namespace chromeos | 170 } // namespace chromeos |
| 164 | 171 |
| 165 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ | 172 #endif // CHROMEOS_DBUS_UPDATE_ENGINE_CLIENT_H_ |
| OLD | NEW |