| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 UserScript::RunLocation run_at, | 87 UserScript::RunLocation run_at, |
| 87 WorldType world_type, | 88 WorldType world_type, |
| 88 ProcessType process_type, | 89 ProcessType process_type, |
| 89 const GURL& webview_src, | 90 const GURL& webview_src, |
| 90 const GURL& file_url, | 91 const GURL& file_url, |
| 91 bool user_gesture, | 92 bool user_gesture, |
| 92 ResultType result_type, | 93 ResultType result_type, |
| 93 const ExecuteScriptCallback& callback); | 94 const ExecuteScriptCallback& callback); |
| 94 | 95 |
| 95 private: | 96 private: |
| 97 // Called upon a request being given to execute the script. |
| 98 void ExecuteScriptHelper(scoped_ptr<ExtensionMsg_ExecuteCode_Params> params, |
| 99 const ExecuteScriptCallback& callback); |
| 100 |
| 96 // The next value to use for request_id in ExtensionMsg_ExecuteCode_Params. | 101 // The next value to use for request_id in ExtensionMsg_ExecuteCode_Params. |
| 97 int next_request_id_; | 102 int next_request_id_; |
| 98 | 103 |
| 99 content::WebContents* web_contents_; | 104 content::WebContents* web_contents_; |
| 100 | 105 |
| 101 ObserverList<TabHelper::ScriptExecutionObserver>* script_observers_; | 106 ObserverList<TabHelper::ScriptExecutionObserver>* script_observers_; |
| 102 }; | 107 }; |
| 103 | 108 |
| 104 } // namespace extensions | 109 } // namespace extensions |
| 105 | 110 |
| 106 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ | 111 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ |
| OLD | NEW |