OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 protected: | 376 protected: |
377 virtual ~FileDialogStringsFunction() {} | 377 virtual ~FileDialogStringsFunction() {} |
378 | 378 |
379 // SyncExtensionFunction overrides. | 379 // SyncExtensionFunction overrides. |
380 virtual bool RunImpl() OVERRIDE; | 380 virtual bool RunImpl() OVERRIDE; |
381 | 381 |
382 private: | 382 private: |
383 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getStrings"); | 383 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getStrings"); |
384 }; | 384 }; |
385 | 385 |
| 386 // Retrieve property information for multiple files, returning a list of the |
| 387 // same length as the input list of file URLs. If a particular file has an |
| 388 // error, then return a dictionary with the key "error" set to the error number |
| 389 // (base::PlatformFileError) for that entry in the returned list. |
| 390 class GetGDataFilePropertiesFunction : public FileBrowserFunction { |
| 391 public: |
| 392 GetGDataFilePropertiesFunction(); |
| 393 |
| 394 protected: |
| 395 virtual ~GetGDataFilePropertiesFunction(); |
| 396 |
| 397 // Virtual function that can be overridden to do operations on each virtual |
| 398 // file path before fetching the properties. Return false to stop iterating |
| 399 // over the files. |
| 400 virtual bool DoOperation(const FilePath& file); |
| 401 |
| 402 // AsyncExtensionFunction overrides. |
| 403 virtual bool RunImpl() OVERRIDE; |
| 404 |
| 405 private: |
| 406 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.getGDataFileProperties"); |
| 407 }; |
| 408 |
| 409 // Pin multiple files in the cache, returning a list of file properties with the |
| 410 // updated cache state. The returned array is the same length as the input list |
| 411 // of file URLs. If a particular file has an error, then return a dictionary |
| 412 // with the key "error" set to the error number (base::PlatformFileError) for |
| 413 // that entry in the returned list. |
| 414 class PinGDataFileFunction : public GetGDataFilePropertiesFunction { |
| 415 public: |
| 416 PinGDataFileFunction(); |
| 417 |
| 418 protected: |
| 419 virtual ~PinGDataFileFunction(); |
| 420 |
| 421 private: |
| 422 // Actually do the pinning of each file. |
| 423 virtual bool DoOperation(const FilePath& path) OVERRIDE; |
| 424 |
| 425 DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.pinGDataFile"); |
| 426 }; |
| 427 |
386 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 428 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
OLD | NEW |