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> |
11 #include <queue> | 11 #include <queue> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
16 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" | 16 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
| 17 #include "chrome/browser/chromeos/gdata/gdata_cache.h" |
17 #include "chrome/browser/extensions/extension_function.h" | 18 #include "chrome/browser/extensions/extension_function.h" |
18 #include "chrome/browser/prefs/pref_service.h" | 19 #include "chrome/browser/prefs/pref_service.h" |
19 #include "googleurl/src/url_util.h" | 20 #include "googleurl/src/url_util.h" |
20 | 21 |
21 class GURL; | 22 class GURL; |
22 | 23 |
23 namespace ui { | 24 namespace ui { |
24 struct SelectedFileInfo; | 25 struct SelectedFileInfo; |
25 } | 26 } |
26 | 27 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // Builds list of file properies. Calls DoOperation for each file. | 444 // Builds list of file properies. Calls DoOperation for each file. |
444 void PrepareResults(); | 445 void PrepareResults(); |
445 | 446 |
446 private: | 447 private: |
447 void OnGetFileInfo(const FilePath& file_path, | 448 void OnGetFileInfo(const FilePath& file_path, |
448 base::DictionaryValue* property_dict, | 449 base::DictionaryValue* property_dict, |
449 base::PlatformFileError error, | 450 base::PlatformFileError error, |
450 scoped_ptr<gdata::GDataFileProto> file_proto); | 451 scoped_ptr<gdata::GDataFileProto> file_proto); |
451 | 452 |
452 void CacheStateReceived(base::DictionaryValue* property_dict, | 453 void CacheStateReceived(base::DictionaryValue* property_dict, |
453 base::PlatformFileError error, | 454 bool success, |
454 int cache_state); | 455 const gdata::GDataCache::CacheEntry& cache_entry); |
455 | 456 |
456 size_t current_index_; | 457 size_t current_index_; |
457 base::ListValue* path_list_; | 458 base::ListValue* path_list_; |
458 scoped_ptr<base::ListValue> file_properties_; | 459 scoped_ptr<base::ListValue> file_properties_; |
459 }; | 460 }; |
460 | 461 |
461 // Pin/unpin multiple files in the cache, returning a list of file | 462 // Pin/unpin multiple files in the cache, returning a list of file |
462 // properties with the updated cache state. The returned array is the | 463 // properties with the updated cache state. The returned array is the |
463 // same length as the input list of file URLs. If a particular file | 464 // same length as the input list of file URLs. If a particular file |
464 // has an error, then return a dictionary with the key "error" set to | 465 // has an error, then return a dictionary with the key "error" set to |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 DECLARE_EXTENSION_FUNCTION_NAME( | 693 DECLARE_EXTENSION_FUNCTION_NAME( |
693 "fileBrowserPrivate.requestDirectoryRefresh"); | 694 "fileBrowserPrivate.requestDirectoryRefresh"); |
694 | 695 |
695 protected: | 696 protected: |
696 virtual ~RequestDirectoryRefreshFunction() {} | 697 virtual ~RequestDirectoryRefreshFunction() {} |
697 | 698 |
698 virtual bool RunImpl() OVERRIDE; | 699 virtual bool RunImpl() OVERRIDE; |
699 }; | 700 }; |
700 | 701 |
701 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ | 702 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_PRIVATE_API_H_ |
OLD | NEW |