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 "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 // Initiates execution of file handler task for each element of |file_urls|. | 73 // Initiates execution of file handler task for each element of |file_urls|. |
74 // Return |false| if the execution cannot be initiated. | 74 // Return |false| if the execution cannot be initiated. |
75 // Otherwise returns |true| and then eventually calls |Done|. | 75 // Otherwise returns |true| and then eventually calls |Done|. |
76 bool Execute(const std::vector<GURL>& file_urls); | 76 bool Execute(const std::vector<GURL>& file_urls); |
77 | 77 |
78 protected: | 78 protected: |
79 virtual Browser* browser() = 0; | 79 virtual Browser* browser() = 0; |
80 virtual void Done(bool success) = 0; | 80 virtual void Done(bool success) = 0; |
81 | 81 |
| 82 Profile* profile() { return profile_; } |
| 83 |
82 private: | 84 private: |
83 struct FileDefinition { | 85 struct FileDefinition { |
84 FileDefinition(); | 86 FileDefinition(); |
85 ~FileDefinition(); | 87 ~FileDefinition(); |
86 | 88 |
87 GURL target_file_url; | 89 GURL target_file_url; |
88 FilePath virtual_path; | 90 FilePath virtual_path; |
89 FilePath absolute_path; | 91 FilePath absolute_path; |
90 bool is_directory; | 92 bool is_directory; |
91 }; | 93 }; |
(...skipping 16 matching lines...) Expand all Loading... |
108 | 110 |
109 Profile* profile_; | 111 Profile* profile_; |
110 const GURL source_url_; | 112 const GURL source_url_; |
111 const std::string extension_id_; | 113 const std::string extension_id_; |
112 const std::string action_id_; | 114 const std::string action_id_; |
113 }; | 115 }; |
114 | 116 |
115 } // namespace file_handler_util | 117 } // namespace file_handler_util |
116 | 118 |
117 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 119 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
OLD | NEW |