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_EXTENSIONS_SCRIPT_EXECUTOR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "chrome/browser/extensions/tab_helper.h" | 12 #include "chrome/browser/extensions/tab_helper.h" |
13 #include "extensions/common/user_script.h" | 13 #include "extensions/common/user_script.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
| 16 struct ExtensionMsg_ExecuteCode_Params; |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class ListValue; | 19 class ListValue; |
19 } // namespace base | 20 } // namespace base |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 class WebContents; | 23 class WebContents; |
23 } | 24 } |
24 | 25 |
25 namespace extensions { | 26 namespace extensions { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 UserScript::RunLocation run_at, | 95 UserScript::RunLocation run_at, |
95 WorldType world_type, | 96 WorldType world_type, |
96 ProcessType process_type, | 97 ProcessType process_type, |
97 const GURL& webview_src, | 98 const GURL& webview_src, |
98 const GURL& file_url, | 99 const GURL& file_url, |
99 bool user_gesture, | 100 bool user_gesture, |
100 ResultType result_type, | 101 ResultType result_type, |
101 const ExecuteScriptCallback& callback); | 102 const ExecuteScriptCallback& callback); |
102 | 103 |
103 private: | 104 private: |
| 105 // Called upon a request being given to execute the script. |
| 106 void ExecuteScriptHelper(scoped_ptr<ExtensionMsg_ExecuteCode_Params> params, |
| 107 const ExecuteScriptCallback& callback); |
| 108 |
104 // The next value to use for request_id in ExtensionMsg_ExecuteCode_Params. | 109 // The next value to use for request_id in ExtensionMsg_ExecuteCode_Params. |
105 int next_request_id_; | 110 int next_request_id_; |
106 | 111 |
107 content::WebContents* web_contents_; | 112 content::WebContents* web_contents_; |
108 | 113 |
109 ObserverList<TabHelper::ScriptExecutionObserver>* script_observers_; | 114 ObserverList<TabHelper::ScriptExecutionObserver>* script_observers_; |
110 }; | 115 }; |
111 | 116 |
112 } // namespace extensions | 117 } // namespace extensions |
113 | 118 |
114 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ | 119 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ |
OLD | NEW |