Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / webui / components_ui.h
blobf184dbeeb0f8705d300c1e1a05e2a38f2e484bf2
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_
8 #include <string>
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"
15 namespace base {
16 class RefCountedMemory;
19 namespace user_prefs {
20 class PrefRegistrySyncable;
23 class ComponentsUI : public content::WebUIController,
24 public component_updater::ServiceObserver {
25 public:
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;
39 private:
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_