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 | 12 |
13 namespace content { | 13 namespace content { |
14 class BrowserContext; | 14 class WebContents; |
15 } | 15 } |
16 | 16 |
17 // Interface implemented to expose per-platform updating functionality. | 17 // Interface implemented to expose per-platform updating functionality. |
18 class VersionUpdater { | 18 class VersionUpdater { |
19 public: | 19 public: |
20 // Update process state machine. | 20 // Update process state machine. |
21 enum Status { | 21 enum Status { |
22 CHECKING, | 22 CHECKING, |
23 UPDATING, | 23 UPDATING, |
24 NEARLY_UPDATED, | 24 NEARLY_UPDATED, |
(...skipping 27 matching lines...) Expand all Loading... | |
52 | 52 |
53 #if defined(OS_MACOSX) | 53 #if defined(OS_MACOSX) |
54 // Used to show or hide the promote UI elements. | 54 // Used to show or hide the promote UI elements. |
55 typedef base::Callback<void(PromotionState)> PromoteCallback; | 55 typedef base::Callback<void(PromotionState)> PromoteCallback; |
56 #endif | 56 #endif |
57 | 57 |
58 virtual ~VersionUpdater() {} | 58 virtual ~VersionUpdater() {} |
59 | 59 |
60 // Sub-classes must implement this method to create the respective | 60 // Sub-classes must implement this method to create the respective |
61 // specialization. | 61 // specialization. |
62 static VersionUpdater* Create(content::BrowserContext* context); | 62 static VersionUpdater* Create(content::WebContents* web_contents); |
63 | 63 |
64 // Begins the update process by checking for update availability. | 64 // Begins the update process by checking for update availability. |
65 // |status_callback| is called for each status update. |promote_callback| can | 65 // |status_callback| is called for each status update. |promote_callback| can |
66 // be used to show or hide the promote UI elements. | 66 // be used to show or hide the promote UI elements. |
67 virtual void CheckForUpdate(const StatusCallback& status_callback | 67 virtual void CheckForUpdate(const StatusCallback& status_callback |
S. Ganesh
2015/05/13 20:21:41
Perhaps mention here that HelpHandler::RequestUpda
grt (UTC plus 2)
2015/05/13 20:36:38
I tend to not put that sort of things in code comm
| |
68 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
69 , const PromoteCallback& promote_callback | 69 , const PromoteCallback& promote_callback |
70 #endif | 70 #endif |
71 ) = 0; | 71 ) = 0; |
72 | 72 |
73 #if defined(OS_MACOSX) | 73 #if defined(OS_MACOSX) |
74 // Make updates available for all users. | 74 // Make updates available for all users. |
75 virtual void PromoteUpdater() const = 0; | 75 virtual void PromoteUpdater() const = 0; |
76 #endif | 76 #endif |
77 | 77 |
78 // Relaunches the browser, generally after being updated. | 78 // Relaunches the browser, generally after being updated. |
79 virtual void RelaunchBrowser() const = 0; | 79 virtual void RelaunchBrowser() const = 0; |
80 | 80 |
81 #if defined(OS_CHROMEOS) | 81 #if defined(OS_CHROMEOS) |
82 virtual void SetChannel(const std::string& channel, | 82 virtual void SetChannel(const std::string& channel, |
83 bool is_powerwash_allowed) = 0; | 83 bool is_powerwash_allowed) = 0; |
84 virtual void GetChannel(bool get_current_channel, | 84 virtual void GetChannel(bool get_current_channel, |
85 const ChannelCallback& callback) = 0; | 85 const ChannelCallback& callback) = 0; |
86 #endif | 86 #endif |
87 }; | 87 }; |
88 | 88 |
89 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ | 89 #endif // CHROME_BROWSER_UI_WEBUI_HELP_VERSION_UPDATER_H_ |
OLD | NEW |