| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMPONENTS_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/component_updater/component_updater_service.h" | 11 #include "components/component_updater/component_updater_service.h" |
| 12 #include "components/update_client/crx_update_item.h" | 12 #include "components/update_client/crx_update_item.h" |
| 13 #include "content/public/browser/web_ui_controller.h" | 13 #include "content/public/browser/web_ui_controller.h" |
| 14 #include "ui/base/layout.h" | 14 #include "ui/base/layout.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class RefCountedMemory; | 17 class RefCountedMemory; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace user_prefs { | |
| 21 class PrefRegistrySyncable; | |
| 22 } | |
| 23 | |
| 24 class ComponentsUI : public content::WebUIController, | 20 class ComponentsUI : public content::WebUIController, |
| 25 public component_updater::ServiceObserver { | 21 public component_updater::ServiceObserver { |
| 26 public: | 22 public: |
| 27 explicit ComponentsUI(content::WebUI* web_ui); | 23 explicit ComponentsUI(content::WebUI* web_ui); |
| 28 ~ComponentsUI() override; | 24 ~ComponentsUI() override; |
| 29 | 25 |
| 30 static void OnDemandUpdate(const std::string& component_id); | 26 static void OnDemandUpdate(const std::string& component_id); |
| 31 | 27 |
| 32 static base::ListValue* LoadComponents(); | 28 static base::ListValue* LoadComponents(); |
| 33 | 29 |
| 34 static base::RefCountedMemory* GetFaviconResourceBytes( | 30 static base::RefCountedMemory* GetFaviconResourceBytes( |
| 35 ui::ScaleFactor scale_factor); | 31 ui::ScaleFactor scale_factor); |
| 36 | 32 |
| 37 // ServiceObserver implementation. | 33 // ServiceObserver implementation. |
| 38 void OnEvent(Events event, const std::string& id) override; | 34 void OnEvent(Events event, const std::string& id) override; |
| 39 | 35 |
| 40 private: | 36 private: |
| 41 static base::string16 ComponentEventToString(Events event); | 37 static base::string16 ComponentEventToString(Events event); |
| 42 static base::string16 ServiceStatusToString( | 38 static base::string16 ServiceStatusToString( |
| 43 update_client::CrxUpdateItem::State state); | 39 update_client::CrxUpdateItem::State state); |
| 44 DISALLOW_COPY_AND_ASSIGN(ComponentsUI); | 40 DISALLOW_COPY_AND_ASSIGN(ComponentsUI); |
| 45 }; | 41 }; |
| 46 | 42 |
| 47 #endif // CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_ | 43 #endif // CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_ |
| OLD | NEW |