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_HANDLER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 // Initiates execution of file handler task for each element of |file_urls|. | 76 // Initiates execution of file handler task for each element of |file_urls|. |
77 // Return |false| if the execution cannot be initiated. | 77 // Return |false| if the execution cannot be initiated. |
78 // Otherwise returns |true| and then eventually calls |Done|. | 78 // Otherwise returns |true| and then eventually calls |Done|. |
79 bool Execute(const std::vector<GURL>& file_urls); | 79 bool Execute(const std::vector<GURL>& file_urls); |
80 | 80 |
81 protected: | 81 protected: |
82 virtual Browser* browser() = 0; | 82 virtual Browser* browser() = 0; |
83 virtual void Done(bool success) = 0; | 83 virtual void Done(bool success) = 0; |
84 | 84 |
| 85 Profile* profile() { return profile_; } |
| 86 |
85 private: | 87 private: |
86 struct FileDefinition { | 88 struct FileDefinition { |
87 FileDefinition(); | 89 FileDefinition(); |
88 ~FileDefinition(); | 90 ~FileDefinition(); |
89 | 91 |
90 GURL target_file_url; | 92 GURL target_file_url; |
91 FilePath virtual_path; | 93 FilePath virtual_path; |
92 FilePath absolute_path; | 94 FilePath absolute_path; |
93 bool is_directory; | 95 bool is_directory; |
94 }; | 96 }; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const std::string extension_id_; | 129 const std::string extension_id_; |
128 const std::string action_id_; | 130 const std::string action_id_; |
129 | 131 |
130 // (File path, permission for file path) pairs for the handler. | 132 // (File path, permission for file path) pairs for the handler. |
131 std::vector<std::pair<FilePath, int> > handler_host_permissions_; | 133 std::vector<std::pair<FilePath, int> > handler_host_permissions_; |
132 }; | 134 }; |
133 | 135 |
134 } // namespace file_handler_util | 136 } // namespace file_handler_util |
135 | 137 |
136 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 138 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
OLD | NEW |