| 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_HANDLER_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_HANDLER_API_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_HANDLER_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_HANDLER_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 protected: | 50 protected: |
| 51 virtual ~FileHandlerSelectFileFunction() OVERRIDE; | 51 virtual ~FileHandlerSelectFileFunction() OVERRIDE; |
| 52 virtual bool RunImpl() OVERRIDE; | 52 virtual bool RunImpl() OVERRIDE; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 // Calls |DoCreateFile| on file thread and invokes the callback. | 55 // Calls |DoCreateFile| on file thread and invokes the callback. |
| 56 void CreateFileOnFileThread(bool success, | 56 void CreateFileOnFileThread(bool success, |
| 57 const std::string& file_system_name, | 57 const std::string& file_system_name, |
| 58 const GURL& file_system_root); | 58 const GURL& file_system_root); |
| 59 | 59 |
| 60 // Creates file on provided file path. | |
| 61 bool DoCreateFile(); | |
| 62 | |
| 63 // Called on UI thread after the file gets created. | 60 // Called on UI thread after the file gets created. |
| 64 void OnFileCreated(bool success, | 61 void OnFileCreated(bool success, |
| 65 const std::string& file_system_name, | 62 const std::string& file_system_name, |
| 66 const GURL& file_system_root); | 63 const GURL& file_system_root); |
| 67 | 64 |
| 68 // Grants file access permissions for the created file to the extension with | 65 // Grants file access permissions for the created file to the extension with |
| 69 // cros mount point provider and child process security policy. | 66 // cros mount point provider and child process security policy. |
| 70 // Returns virtual path for which has been given permission. | 67 // Returns virtual path for which has been given permission. |
| 71 FilePath GrantPermissions(); | 68 FilePath GrantPermissions(); |
| 72 | 69 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 86 // |file_selector_for_test_| and |disable_geture_check_for_test_| are used | 83 // |file_selector_for_test_| and |disable_geture_check_for_test_| are used |
| 87 // primary in testing to override file selector to be used in the function | 84 // primary in testing to override file selector to be used in the function |
| 88 // implementation and disable user gesture check. | 85 // implementation and disable user gesture check. |
| 89 // Once set they will be used for every extension function call. | 86 // Once set they will be used for every extension function call. |
| 90 static file_handler::FileSelector* file_selector_for_test_; | 87 static file_handler::FileSelector* file_selector_for_test_; |
| 91 static bool gesture_check_disabled_for_test_; | 88 static bool gesture_check_disabled_for_test_; |
| 92 }; | 89 }; |
| 93 | 90 |
| 94 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_HANDLER_API_H_ | 91 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_HANDLER_API_H_ |
| 95 | 92 |
| OLD | NEW |