OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_IMPL_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_IMPL_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/extensions/script_executor.h" | |
10 | |
11 #include "base/compiler_specific.h" | |
12 | |
13 namespace extensions { | |
14 | |
15 // Standard implementation of ScriptExecutor which just sends an IPC to | |
16 // |web_contents_| to execute the script. | |
17 class ScriptExecutorImpl : public ScriptExecutor { | |
18 public: | |
19 explicit ScriptExecutorImpl(content::WebContents* web_contents); | |
20 | |
21 virtual ~ScriptExecutorImpl(); | |
22 | |
23 virtual void ExecuteScript(const std::string& extension_id, | |
24 ScriptType script_type, | |
25 const std::string& code, | |
26 FrameScope frame_scope, | |
27 UserScript::RunLocation run_at, | |
28 WorldType world_type, | |
29 const ExecuteScriptCallback& callback) OVERRIDE; | |
30 private: | |
31 // The next value to use for request_id inExtensionMsg_ExecuteCode_Params. | |
32 int next_request_id_; | |
33 | |
34 // The WebContents this is bound to. | |
35 content::WebContents* web_contents_; | |
36 }; | |
37 | |
38 } // namespace extensions | |
39 | |
40 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_IMPL_H_ | |
OLD | NEW |