| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERER_SCRIPT_INJECTOR_H_ | 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
| 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ | 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "extensions/common/permissions/permissions_data.h" | 11 #include "extensions/common/permissions/permissions_data.h" |
| 12 #include "extensions/common/user_script.h" | 12 #include "extensions/common/user_script.h" |
| 13 #include "third_party/WebKit/public/web/WebScriptSource.h" | 13 #include "third_party/WebKit/public/web/WebScriptSource.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 class InjectionHost; | 16 class InjectionHost; |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 class WebLocalFrame; | 19 class WebLocalFrame; |
| 20 } | 20 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Fill scriptrs run info based on information about injection. | 75 // Fill scriptrs run info based on information about injection. |
| 76 virtual void GetRunInfo( | 76 virtual void GetRunInfo( |
| 77 ScriptsRunInfo* scripts_run_info, | 77 ScriptsRunInfo* scripts_run_info, |
| 78 UserScript::RunLocation run_location) const = 0; | 78 UserScript::RunLocation run_location) const = 0; |
| 79 | 79 |
| 80 // Notifies the script that injection has completed, with a possibly-populated | 80 // Notifies the script that injection has completed, with a possibly-populated |
| 81 // list of results (depending on whether or not ExpectsResults() was true). | 81 // list of results (depending on whether or not ExpectsResults() was true). |
| 82 // |render_frame| contains the render frame, or null if the frame was | 82 // |render_frame| contains the render frame, or null if the frame was |
| 83 // invalidated. | 83 // invalidated. |
| 84 virtual void OnInjectionComplete( | 84 virtual void OnInjectionComplete( |
| 85 scoped_ptr<base::Value> execution_result, | 85 std::unique_ptr<base::Value> execution_result, |
| 86 UserScript::RunLocation run_location, | 86 UserScript::RunLocation run_location, |
| 87 content::RenderFrame* render_frame) = 0; | 87 content::RenderFrame* render_frame) = 0; |
| 88 | 88 |
| 89 // Notifies the script that injection will never occur. | 89 // Notifies the script that injection will never occur. |
| 90 // |render_frame| contains the render frame, or null if the frame was | 90 // |render_frame| contains the render frame, or null if the frame was |
| 91 // invalidated. | 91 // invalidated. |
| 92 virtual void OnWillNotInject(InjectFailureReason reason, | 92 virtual void OnWillNotInject(InjectFailureReason reason, |
| 93 content::RenderFrame* render_frame) = 0; | 93 content::RenderFrame* render_frame) = 0; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace extensions | 96 } // namespace extensions |
| 97 | 97 |
| 98 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ | 98 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
| OLD | NEW |