Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: extensions/renderer/script_injector.h

Issue 1150683007: [Extensions] Use document url (not top url) for tab-specific permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/renderer/script_injection.cc ('k') | extensions/renderer/user_script_injector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // |run_location|. 53 // |run_location|.
54 virtual bool ShouldInjectJs(UserScript::RunLocation run_location) const = 0; 54 virtual bool ShouldInjectJs(UserScript::RunLocation run_location) const = 0;
55 55
56 // Returns true if the script should inject CSS at the given |run_location|. 56 // Returns true if the script should inject CSS at the given |run_location|.
57 virtual bool ShouldInjectCss(UserScript::RunLocation run_location) const = 0; 57 virtual bool ShouldInjectCss(UserScript::RunLocation run_location) const = 0;
58 58
59 // Returns true if the script should execute on the given |frame|. 59 // Returns true if the script should execute on the given |frame|.
60 virtual PermissionsData::AccessType CanExecuteOnFrame( 60 virtual PermissionsData::AccessType CanExecuteOnFrame(
61 const InjectionHost* injection_host, 61 const InjectionHost* injection_host,
62 blink::WebFrame* web_frame, 62 blink::WebFrame* web_frame,
63 int tab_id, 63 int tab_id) const = 0;
64 const GURL& top_url) const = 0;
65 64
66 // Returns the javascript sources to inject at the given |run_location|. 65 // Returns the javascript sources to inject at the given |run_location|.
67 // Only called if ShouldInjectJs() is true. 66 // Only called if ShouldInjectJs() is true.
68 virtual std::vector<blink::WebScriptSource> GetJsSources( 67 virtual std::vector<blink::WebScriptSource> GetJsSources(
69 UserScript::RunLocation run_location) const = 0; 68 UserScript::RunLocation run_location) const = 0;
70 69
71 // Returns the css to inject at the given |run_location|. 70 // Returns the css to inject at the given |run_location|.
72 // Only called if ShouldInjectCss() is true. 71 // Only called if ShouldInjectCss() is true.
73 virtual std::vector<std::string> GetCssSources( 72 virtual std::vector<std::string> GetCssSources(
74 UserScript::RunLocation run_location) const = 0; 73 UserScript::RunLocation run_location) const = 0;
75 74
76 // Fill scriptrs run info based on information about injection. 75 // Fill scriptrs run info based on information about injection.
77 virtual void GetRunInfo( 76 virtual void GetRunInfo(
78 ScriptsRunInfo* scripts_run_info, 77 ScriptsRunInfo* scripts_run_info,
79 UserScript::RunLocation run_location) const = 0; 78 UserScript::RunLocation run_location) const = 0;
80 79
81 // Notifies the script that injection has completed, with a possibly-populated 80 // Notifies the script that injection has completed, with a possibly-populated
82 // list of results (depending on whether or not ExpectsResults() was true). 81 // list of results (depending on whether or not ExpectsResults() was true).
83 virtual void OnInjectionComplete( 82 virtual void OnInjectionComplete(
84 scoped_ptr<base::Value> execution_result, 83 scoped_ptr<base::Value> execution_result,
85 UserScript::RunLocation run_location) = 0; 84 UserScript::RunLocation run_location) = 0;
86 85
87 // Notifies the script that injection will never occur. 86 // Notifies the script that injection will never occur.
88 virtual void OnWillNotInject(InjectFailureReason reason) = 0; 87 virtual void OnWillNotInject(InjectFailureReason reason) = 0;
89 }; 88 };
90 89
91 } // namespace extensions 90 } // namespace extensions
92 91
93 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ 92 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_
OLDNEW
« no previous file with comments | « extensions/renderer/script_injection.cc ('k') | extensions/renderer/user_script_injector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698