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

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

Issue 1140173003: Allow whitelisted content scripts to be injected in WebViews. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@document_has_focus
Patch Set: Created 5 years, 7 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
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_USER_SCRIPT_SET_H_ 5 #ifndef EXTENSIONS_RENDERER_USER_SCRIPT_SET_H_
6 #define EXTENSIONS_RENDERER_USER_SCRIPT_SET_H_ 6 #define EXTENSIONS_RENDERER_USER_SCRIPT_SET_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 scoped_ptr<ScriptInjection> GetDeclarativeScriptInjection( 61 scoped_ptr<ScriptInjection> GetDeclarativeScriptInjection(
62 int script_id, 62 int script_id,
63 blink::WebFrame* web_frame, 63 blink::WebFrame* web_frame,
64 int tab_id, 64 int tab_id,
65 UserScript::RunLocation run_location, 65 UserScript::RunLocation run_location,
66 const GURL& document_url); 66 const GURL& document_url);
67 67
68 // Updates scripts given the shared memory region containing user scripts. 68 // Updates scripts given the shared memory region containing user scripts.
69 // Returns true if the scripts were successfully updated. 69 // Returns true if the scripts were successfully updated.
70 bool UpdateUserScripts(base::SharedMemoryHandle shared_memory, 70 bool UpdateUserScripts(base::SharedMemoryHandle shared_memory,
71 const std::set<HostID>& changed_hosts); 71 const std::set<HostID>& changed_hosts,
72 bool whitelisted_only);
72 73
73 const std::vector<UserScript*>& scripts() const { return scripts_.get(); } 74 const std::vector<UserScript*>& scripts() const { return scripts_.get(); }
74 75
75 private: 76 private:
76 // Returns a new ScriptInjection for the given |script| to execute in the 77 // Returns a new ScriptInjection for the given |script| to execute in the
77 // |web_frame|, or NULL if the script should not execute. 78 // |web_frame|, or NULL if the script should not execute.
78 scoped_ptr<ScriptInjection> GetInjectionForScript( 79 scoped_ptr<ScriptInjection> GetInjectionForScript(
79 UserScript* script, 80 UserScript* script,
80 blink::WebFrame* web_frame, 81 blink::WebFrame* web_frame,
81 int tab_id, 82 int tab_id,
(...skipping 12 matching lines...) Expand all
94 95
95 // The associated observers. 96 // The associated observers.
96 ObserverList<Observer> observers_; 97 ObserverList<Observer> observers_;
97 98
98 DISALLOW_COPY_AND_ASSIGN(UserScriptSet); 99 DISALLOW_COPY_AND_ASSIGN(UserScriptSet);
99 }; 100 };
100 101
101 } // namespace extensions 102 } // namespace extensions
102 103
103 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_SET_H_ 104 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_SET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698