OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ |
6 #define EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ | 6 #define EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ |
7 | 7 |
8 #include "extensions/browser/extension_function.h" | 8 #include "extensions/browser/extension_function.h" |
9 #include "extensions/browser/script_executor.h" | 9 #include "extensions/browser/script_executor.h" |
10 #include "extensions/common/api/extension_types.h" | 10 #include "extensions/common/api/extension_types.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 // ValidationFailure override to match RunAsync(). | 45 // ValidationFailure override to match RunAsync(). |
46 static bool ValidationFailure(T* function); | 46 static bool ValidationFailure(T* function); |
47 | 47 |
48 private: | 48 private: |
49 // Called when contents from the file whose path is specified in JSON | 49 // Called when contents from the file whose path is specified in JSON |
50 // arguments has been loaded. | 50 // arguments has been loaded. |
51 void DidLoadFile(bool success, const std::string& data); | 51 void DidLoadFile(bool success, const std::string& data); |
52 | 52 |
53 // Runs on FILE thread. Loads message bundles for the extension and | 53 // Runs on FILE thread. Loads message bundles for the extension and |
54 // localizes the CSS data. Calls back DidLoadAndLocalizeFile on the UI thread. | 54 // localizes the CSS data. Calls back DidLoadAndLocalizeFile on the UI thread. |
55 void GetFileURLAndLocalizeCSS( | 55 void GetFileURLAndLocalizeCSS(ScriptExecutor::ScriptType script_type, |
Fady Samuel
2014/09/04 20:41:09
Can you make this change in the ExecuteCodeFunctio
| |
56 ScriptExecutor::ScriptType script_type, | 56 const std::string& data, |
57 const std::string& data, | 57 const std::string& extension_id, |
58 const std::string& extension_id, | 58 const base::FilePath& extension_path, |
59 const base::FilePath& extension_path, | 59 const std::string& extension_default_locale); |
60 const std::string& extension_default_locale); | |
61 | 60 |
62 // Called when contents from the loaded file have been localized. | 61 // Called when contents from the loaded file have been localized. |
63 void DidLoadAndLocalizeFile(bool success, const std::string& data); | 62 void DidLoadAndLocalizeFile(bool success, const std::string& data); |
64 | 63 |
65 // Run in UI thread. Code string contains the code to be executed. Returns | 64 // Run in UI thread. Code string contains the code to be executed. Returns |
66 // true on success. If true is returned, this does an AddRef. | 65 // true on success. If true is returned, this does an AddRef. |
67 bool Execute(const std::string& code_string); | 66 bool Execute(const std::string& code_string); |
68 | 67 |
69 // Contains extension resource built from path of file which is | 68 // Contains extension resource built from path of file which is |
70 // specified in JSON arguments. | 69 // specified in JSON arguments. |
71 ExtensionResource resource_; | 70 ExtensionResource resource_; |
72 | 71 |
73 // The URL of the file being injected into the page. | 72 // The URL of the file being injected into the page. |
74 GURL file_url_; | 73 GURL file_url_; |
75 }; | 74 }; |
76 | 75 |
77 } // namespace extensions | 76 } // namespace extensions |
78 | 77 |
79 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ | 78 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ |
80 | |
OLD | NEW |