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