| 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_SYNC_FILE_SYSTEM_INTERNALS_FILE_METADATA_HANDLER
_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_FILE_METADATA_HANDLER
_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_FILE_METADATA_HANDLER
_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_FILE_METADATA_HANDLER
_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "chrome/browser/sync_file_system/remote_file_sync_service.h" | 11 #include "chrome/browser/sync_file_system/remote_file_sync_service.h" |
| 12 #include "chrome/browser/sync_file_system/sync_status_code.h" | 12 #include "chrome/browser/sync_file_system/sync_status_code.h" |
| 13 #include "content/public/browser/web_ui_message_handler.h" | 13 #include "content/public/browser/web_ui_message_handler.h" |
| 14 | 14 |
| 15 class Profile; | 15 class Profile; |
| 16 | 16 |
| 17 namespace syncfs_internals { | 17 namespace syncfs_internals { |
| 18 | 18 |
| 19 // This class handles messages from WebUI page of chrome://syncfs-internals/ | 19 // This class handles messages from WebUI page of chrome://syncfs-internals/ |
| 20 // for the File Metadata tab. It corresponds to browser/resources/ | 20 // for the File Metadata tab. It corresponds to browser/resources/ |
| 21 // sync_file_system_internals/file_metadata.html. All methods in this class | 21 // sync_file_system_internals/file_metadata.html. All methods in this class |
| 22 // should be called on UI thread. | 22 // should be called on UI thread. |
| 23 class FileMetadataHandler : public content::WebUIMessageHandler { | 23 class FileMetadataHandler : public content::WebUIMessageHandler { |
| 24 public: | 24 public: |
| 25 explicit FileMetadataHandler(Profile* profile); | 25 explicit FileMetadataHandler(Profile* profile); |
| 26 virtual ~FileMetadataHandler(); | 26 virtual ~FileMetadataHandler(); |
| 27 | 27 |
| 28 // WebUIMessageHandler implementation. | 28 // WebUIMessageHandler implementation. |
| 29 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 void GetExtensions(const base::ListValue* args); | 32 void GetExtensions(const base::ListValue* args); |
| 33 void DidGetExtensions(const base::ListValue& list); | 33 void DidGetExtensions(const base::ListValue& list); |
| 34 | 34 |
| 35 void GetFileMetadata(const base::ListValue* args); | 35 void GetFileMetadata(const base::ListValue* args); |
| 36 void DidGetFileMetadata(const base::ListValue& files); | 36 void DidGetFileMetadata(const base::ListValue& files); |
| 37 | 37 |
| 38 Profile* profile_; | 38 Profile* profile_; |
| 39 base::WeakPtrFactory<FileMetadataHandler> weak_factory_; | 39 base::WeakPtrFactory<FileMetadataHandler> weak_factory_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(FileMetadataHandler); | 41 DISALLOW_COPY_AND_ASSIGN(FileMetadataHandler); |
| 42 }; | 42 }; |
| 43 } // namespace syncfs_internals | 43 } // namespace syncfs_internals |
| 44 | 44 |
| 45 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_FILE_METADATA_HAND
LER_H_ | 45 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_FILE_SYSTEM_INTERNALS_FILE_METADATA_HAND
LER_H_ |
| OLD | NEW |