| 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 CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "third_party/cros_system_api/dbus/update_engine/dbus-constants.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 class WebContents; | 16 class WebContents; |
| 16 } | 17 } |
| 17 | 18 |
| 18 // Interface implemented to expose per-platform updating functionality. | 19 // Interface implemented to expose per-platform updating functionality. |
| 19 class VersionUpdater { | 20 class VersionUpdater { |
| 20 public: | 21 public: |
| 21 // Update process state machine. | 22 // Update process state machine. |
| 22 enum Status { | 23 enum Status { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 enum PromotionState { | 36 enum PromotionState { |
| 36 PROMOTE_HIDDEN, | 37 PROMOTE_HIDDEN, |
| 37 PROMOTE_ENABLED, | 38 PROMOTE_ENABLED, |
| 38 PROMOTE_DISABLED | 39 PROMOTE_DISABLED |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 // TODO(jhawkins): Use a delegate interface instead of multiple callback | 42 // TODO(jhawkins): Use a delegate interface instead of multiple callback |
| 42 // types. | 43 // types. |
| 43 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
| 44 typedef base::Callback<void(const std::string&)> ChannelCallback; | 45 typedef base::Callback<void(const std::string&)> ChannelCallback; |
| 45 typedef base::Callback<void(int status)> EolStatusCallback; | 46 typedef base::Callback<void(update_engine::EndOfLifeStatus status)> |
| 47 EolStatusCallback; |
| 46 #endif | 48 #endif |
| 47 | 49 |
| 48 // Used to update the client of status changes. int parameter is the progress | 50 // Used to update the client of status changes. int parameter is the progress |
| 49 // and should only be non-zero for the UPDATING state. | 51 // and should only be non-zero for the UPDATING state. |
| 50 // base::string16 parameter is a message explaining a failure. | 52 // base::string16 parameter is a message explaining a failure. |
| 51 typedef base::Callback<void(Status, int, const base::string16&)> | 53 typedef base::Callback<void(Status, int, const base::string16&)> |
| 52 StatusCallback; | 54 StatusCallback; |
| 53 | 55 |
| 54 // Used to show or hide the promote UI elements. Mac-only. | 56 // Used to show or hide the promote UI elements. Mac-only. |
| 55 typedef base::Callback<void(PromotionState)> PromoteCallback; | 57 typedef base::Callback<void(PromotionState)> PromoteCallback; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 77 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
| 78 virtual void SetChannel(const std::string& channel, | 80 virtual void SetChannel(const std::string& channel, |
| 79 bool is_powerwash_allowed) = 0; | 81 bool is_powerwash_allowed) = 0; |
| 80 virtual void GetChannel(bool get_current_channel, | 82 virtual void GetChannel(bool get_current_channel, |
| 81 const ChannelCallback& callback) = 0; | 83 const ChannelCallback& callback) = 0; |
| 82 virtual void GetEolStatus(const EolStatusCallback& callback) = 0; | 84 virtual void GetEolStatus(const EolStatusCallback& callback) = 0; |
| 83 #endif | 85 #endif |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ | 88 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ |
| OLD | NEW |