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_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES_HANDLER_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h"
10 #include "content/public/browser/web_ui_message_handler.h"
14 namespace syncfs_internals
{
16 // This class handles message from WebUI page of chrome://syncfs-internals/
17 // for the Extension Statuses tab. It corresponds to browser/resources/
18 // sync_file_system_internals/extension_statuses.html. All methods in this class
19 // should be called on UI thread.
20 class ExtensionStatusesHandler
: public content::WebUIMessageHandler
{
22 explicit ExtensionStatusesHandler(Profile
* profile
);
23 ~ExtensionStatusesHandler() override
;
25 // Shared by Extension Statuses Tab and also File Metadata Tab to generate the
26 // extension drop down.
27 static void GetExtensionStatusesAsDictionary(
29 const base::Callback
<void(const base::ListValue
&)>& callback
);
31 // WebUIMessageHandler implementation.
32 void RegisterMessages() override
;
35 void GetExtensionStatuses(const base::ListValue
* args
);
36 void DidGetExtensionStatuses(const base::ListValue
& list
);
39 base::WeakPtrFactory
<ExtensionStatusesHandler
> weak_ptr_factory_
;
41 DISALLOW_COPY_AND_ASSIGN(ExtensionStatusesHandler
);
44 } // namespace syncfs_internals
46 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_EXTENSION_STATUSES_HANDLER_H_