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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_
10 #include "components/component_updater/component_updater_service.h"
11 #include "components/update_client/crx_update_item.h"
12 #include "content/public/browser/web_ui_controller.h"
13 #include "ui/base/layout.h"
16 class RefCountedMemory
;
19 namespace user_prefs
{
20 class PrefRegistrySyncable
;
23 class ComponentsUI
: public content::WebUIController
,
24 public component_updater::ServiceObserver
{
26 explicit ComponentsUI(content::WebUI
* web_ui
);
27 ~ComponentsUI() override
;
29 static void OnDemandUpdate(const std::string
& component_id
);
31 static base::ListValue
* LoadComponents();
33 static base::RefCountedMemory
* GetFaviconResourceBytes(
34 ui::ScaleFactor scale_factor
);
36 // ServiceObserver implementation.
37 void OnEvent(Events event
, const std::string
& id
) override
;
40 static base::string16
ComponentEventToString(Events event
);
41 static base::string16
ServiceStatusToString(
42 update_client::CrxUpdateItem::State state
);
43 DISALLOW_COPY_AND_ASSIGN(ComponentsUI
);
46 #endif // CHROME_BROWSER_UI_WEBUI_COMPONENTS_UI_H_