| 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_HANDLER2_H_ | |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_ABOUT_PAGE_HANDLER2_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 namespace options2 { | |
| 17 | |
| 18 // ChromeOS about page UI handler. | |
| 19 class AboutPageHandler : public ::options2::OptionsPageUIHandler { | |
| 20 | |
| 21 public: | |
| 22 AboutPageHandler(); | |
| 23 virtual ~AboutPageHandler(); | |
| 24 | |
| 25 // OptionsPageUIHandler implementation. | |
| 26 virtual void GetLocalizedValues( | |
| 27 base::DictionaryValue* localized_strings) OVERRIDE; | |
| 28 virtual void RegisterMessages() OVERRIDE; | |
| 29 | |
| 30 private: | |
| 31 class UpdateObserver; | |
| 32 | |
| 33 // The function is called from JavaScript when the about page is ready. | |
| 34 void PageReady(const base::ListValue* args); | |
| 35 | |
| 36 // The function is called from JavaScript to set the release track like | |
| 37 // "beta-channel" and "dev-channel". | |
| 38 void SetReleaseTrack(const base::ListValue* args); | |
| 39 | |
| 40 // Initiates update check. | |
| 41 void CheckNow(const base::ListValue* args); | |
| 42 | |
| 43 // Restarts the system. | |
| 44 void RestartNow(const base::ListValue* args); | |
| 45 | |
| 46 // Callback from VersionLoader giving the version. | |
| 47 void OnOSVersion(VersionLoader::Handle handle, | |
| 48 std::string version); | |
| 49 void OnOSFirmware(VersionLoader::Handle handle, | |
| 50 std::string firmware); | |
| 51 void UpdateStatus(const UpdateEngineClient::Status& status); | |
| 52 | |
| 53 // UpdateEngine Callback handler. | |
| 54 static void UpdateSelectedChannel(UpdateObserver* observer, | |
| 55 const std::string& channel); | |
| 56 | |
| 57 // Handles asynchronously loading the version. | |
| 58 VersionLoader loader_; | |
| 59 | |
| 60 // Used to request the version. | |
| 61 CancelableRequestConsumer consumer_; | |
| 62 | |
| 63 // Update Observer | |
| 64 scoped_ptr<UpdateObserver> update_observer_; | |
| 65 | |
| 66 int progress_; | |
| 67 bool sticky_; | |
| 68 bool started_; | |
| 69 | |
| 70 DISALLOW_COPY_AND_ASSIGN(AboutPageHandler); | |
| 71 }; | |
| 72 | |
| 73 } // namespace options2 | |
| 74 } // namespace chromeos | |
| 75 | |
| 76 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_ABOUT_PAGE_HANDLER2_H_ | |
| OLD | NEW |