| 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_HELP_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_HELP_HELP_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_HELP_HELP_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_HELP_HELP_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/ui/webui/help/version_updater.h" | 11 #include "chrome/browser/ui/webui/help/version_updater.h" |
| 12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 14 #include "content/public/browser/web_ui_message_handler.h" | 14 #include "content/public/browser/web_ui_message_handler.h" |
| 15 | 15 |
| 16 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
| 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/platform_file.h" |
| 17 #include "chrome/browser/chromeos/version_loader.h" | 19 #include "chrome/browser/chromeos/version_loader.h" |
| 18 #endif // defined(OS_CHROMEOS) | 20 #endif // defined(OS_CHROMEOS) |
| 19 | 21 |
| 20 // WebUI message handler for the help page. | 22 // WebUI message handler for the help page. |
| 21 class HelpHandler : public content::WebUIMessageHandler, | 23 class HelpHandler : public content::WebUIMessageHandler, |
| 22 public content::NotificationObserver { | 24 public content::NotificationObserver { |
| 23 public: | 25 public: |
| 24 HelpHandler(); | 26 HelpHandler(); |
| 25 virtual ~HelpHandler(); | 27 virtual ~HelpHandler(); |
| 26 | 28 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Callback method which forwards promotion state to the page. | 67 // Callback method which forwards promotion state to the page. |
| 66 void SetPromotionState(VersionUpdater::PromotionState state); | 68 void SetPromotionState(VersionUpdater::PromotionState state); |
| 67 #endif | 69 #endif |
| 68 | 70 |
| 69 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
| 70 // Callbacks from VersionLoader. | 72 // Callbacks from VersionLoader. |
| 71 void OnOSVersion(chromeos::VersionLoader::Handle handle, std::string version); | 73 void OnOSVersion(chromeos::VersionLoader::Handle handle, std::string version); |
| 72 void OnOSFirmware(chromeos::VersionLoader::Handle handle, | 74 void OnOSFirmware(chromeos::VersionLoader::Handle handle, |
| 73 std::string firmware); | 75 std::string firmware); |
| 74 void OnReleaseChannel(const std::string& channel); | 76 void OnReleaseChannel(const std::string& channel); |
| 77 |
| 78 void ProcessLsbFileInfo( |
| 79 base::PlatformFileError rv, const base::PlatformFileInfo& file_info); |
| 75 #endif | 80 #endif |
| 76 | 81 |
| 77 // Specialized instance of the VersionUpdater used to update the browser. | 82 // Specialized instance of the VersionUpdater used to update the browser. |
| 78 scoped_ptr<VersionUpdater> version_updater_; | 83 scoped_ptr<VersionUpdater> version_updater_; |
| 79 | 84 |
| 80 // Used to observe notifications. | 85 // Used to observe notifications. |
| 81 content::NotificationRegistrar registrar_; | 86 content::NotificationRegistrar registrar_; |
| 82 | 87 |
| 83 #if defined(OS_CHROMEOS) | 88 #if defined(OS_CHROMEOS) |
| 89 // Used for callbacks. |
| 90 base::WeakPtrFactory<HelpHandler> weak_factory_; |
| 91 |
| 84 // Handles asynchronously loading the CrOS version info. | 92 // Handles asynchronously loading the CrOS version info. |
| 85 chromeos::VersionLoader loader_; | 93 chromeos::VersionLoader loader_; |
| 86 | 94 |
| 87 // Used to request the version. | 95 // Used to request the version. |
| 88 CancelableRequestConsumer consumer_; | 96 CancelableRequestConsumer consumer_; |
| 89 #endif // defined(OS_CHROMEOS) | 97 #endif // defined(OS_CHROMEOS) |
| 90 | 98 |
| 91 DISALLOW_COPY_AND_ASSIGN(HelpHandler); | 99 DISALLOW_COPY_AND_ASSIGN(HelpHandler); |
| 92 }; | 100 }; |
| 93 | 101 |
| 94 #endif // CHROME_BROWSER_UI_WEBUI_HELP_HELP_HANDLER_H_ | 102 #endif // CHROME_BROWSER_UI_WEBUI_HELP_HELP_HANDLER_H_ |
| OLD | NEW |