OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_ABOUT_PAGE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_ABOUT_PAGE_HANDLER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/ui/webui/options2/options_ui2.h" |
| 12 #include "chrome/browser/chromeos/dbus/update_engine_client.h" |
| 13 #include "chrome/browser/chromeos/version_loader.h" |
| 14 |
| 15 namespace chromeos { |
| 16 |
| 17 // ChromeOS about page UI handler. |
| 18 class AboutPageHandler : public OptionsPage2UIHandler { |
| 19 |
| 20 public: |
| 21 AboutPageHandler(); |
| 22 virtual ~AboutPageHandler(); |
| 23 |
| 24 // OptionsPage2UIHandler implementation. |
| 25 virtual void GetLocalizedValues( |
| 26 base::DictionaryValue* localized_strings) OVERRIDE; |
| 27 virtual void RegisterMessages() OVERRIDE; |
| 28 |
| 29 private: |
| 30 class UpdateObserver; |
| 31 |
| 32 // The function is called from JavaScript when the about page is ready. |
| 33 void PageReady(const base::ListValue* args); |
| 34 |
| 35 // The function is called from JavaScript to set the release track like |
| 36 // "beta-channel" and "dev-channel". |
| 37 void SetReleaseTrack(const base::ListValue* args); |
| 38 |
| 39 // Initiates update check. |
| 40 void CheckNow(const base::ListValue* args); |
| 41 |
| 42 // Restarts the system. |
| 43 void RestartNow(const base::ListValue* args); |
| 44 |
| 45 // Callback from VersionLoader giving the version. |
| 46 void OnOSVersion(VersionLoader::Handle handle, |
| 47 std::string version); |
| 48 void OnOSFirmware(VersionLoader::Handle handle, |
| 49 std::string firmware); |
| 50 void UpdateStatus(const UpdateEngineClient::Status& status); |
| 51 |
| 52 // UpdateEngine Callback handler. |
| 53 static void UpdateSelectedChannel(UpdateObserver* observer, |
| 54 const std::string& channel); |
| 55 |
| 56 // Handles asynchronously loading the version. |
| 57 VersionLoader loader_; |
| 58 |
| 59 // Used to request the version. |
| 60 CancelableRequestConsumer consumer_; |
| 61 |
| 62 // Update Observer |
| 63 scoped_ptr<UpdateObserver> update_observer_; |
| 64 |
| 65 int progress_; |
| 66 bool sticky_; |
| 67 bool started_; |
| 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(AboutPageHandler); |
| 70 }; |
| 71 |
| 72 } // namespace chromeos |
| 73 |
| 74 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_ABOUT_PAGE_HANDLER_H_ |
OLD | NEW |