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 14 matching lines...) Expand all Loading... |
25 bool HasPermission() override; | 25 bool HasPermission() override; |
26 bool RunAsync() override; | 26 bool RunAsync() override; |
27 | 27 |
28 // Initialize |details_| if it hasn't already been. | 28 // Initialize |details_| if it hasn't already been. |
29 virtual bool Init() = 0; | 29 virtual bool Init() = 0; |
30 virtual bool ShouldInsertCSS() const = 0; | 30 virtual bool ShouldInsertCSS() const = 0; |
31 virtual bool CanExecuteScriptOnPage() = 0; | 31 virtual bool CanExecuteScriptOnPage() = 0; |
32 virtual ScriptExecutor* GetScriptExecutor() = 0; | 32 virtual ScriptExecutor* GetScriptExecutor() = 0; |
33 virtual bool IsWebView() const = 0; | 33 virtual bool IsWebView() const = 0; |
34 virtual const GURL& GetWebViewSrc() const = 0; | 34 virtual const GURL& GetWebViewSrc() const = 0; |
| 35 virtual int GetScriptInjectionInstanceId() const = 0; |
35 virtual void OnExecuteCodeFinished(const std::string& error, | 36 virtual void OnExecuteCodeFinished(const std::string& error, |
36 const GURL& on_url, | 37 const GURL& on_url, |
37 const base::ListValue& result); | 38 const base::ListValue& result); |
38 | 39 |
39 // The injection details. | 40 // The injection details. |
40 scoped_ptr<core_api::extension_types::InjectDetails> details_; | 41 scoped_ptr<core_api::extension_types::InjectDetails> details_; |
41 | 42 |
42 private: | 43 private: |
43 // Called when contents from the file whose path is specified in JSON | 44 // Called when contents from the file whose path is specified in JSON |
44 // arguments has been loaded. | 45 // arguments has been loaded. |
(...skipping 18 matching lines...) Expand all Loading... |
63 // specified in JSON arguments. | 64 // specified in JSON arguments. |
64 ExtensionResource resource_; | 65 ExtensionResource resource_; |
65 | 66 |
66 // The URL of the file being injected into the page. | 67 // The URL of the file being injected into the page. |
67 GURL file_url_; | 68 GURL file_url_; |
68 }; | 69 }; |
69 | 70 |
70 } // namespace extensions | 71 } // namespace extensions |
71 | 72 |
72 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ | 73 #endif // EXTENSIONS_BROWSER_API_EXECUTE_CODE_FUNCTION_H_ |
OLD | NEW |