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_SYNC_FILE_SYSTEM_INTERNALS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_SYNC_FILE_SYSTEM_INTERNALS_HANDLER_H_
8 #include "base/compiler_specific.h"
9 #include "chrome/browser/sync_file_system/sync_event_observer.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 Sync Service tab. It corresponds to browser/resources/
18 // sync_file_system_internals/sync_service.html. All methods in this class
19 // should be called on UI thread.
20 class SyncFileSystemInternalsHandler
21 : public content::WebUIMessageHandler,
22 public sync_file_system::SyncEventObserver {
24 explicit SyncFileSystemInternalsHandler(Profile* profile);
25 virtual ~SyncFileSystemInternalsHandler();
27 // content::WebUIMessageHandler implementation.
28 virtual void RegisterMessages() OVERRIDE;
30 // sync_file_system::SyncEventObserver interface implementation.
31 virtual void OnSyncStateUpdated(
32 const GURL& app_origin,
33 sync_file_system::SyncServiceState state,
34 const std::string& description) OVERRIDE;
35 virtual void OnFileSynced(
36 const fileapi::FileSystemURL& url,
37 sync_file_system::SyncFileStatus status,
38 sync_file_system::SyncAction action,
39 sync_file_system::SyncDirection direction) OVERRIDE;
42 void GetServiceStatus(const base::ListValue* args);
43 void GetNotificationSource(const base::ListValue* args);
44 void GetLog(const base::ListValue* args);
48 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemInternalsHandler);
51 } // namespace syncfs_internals
53 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_SYNC_FILE_SYSTEM_INTERNALS_HANDLER_H_