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