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

Side by Side Diff: chrome/renderer/extensions/user_script_slave.h

Issue 226663003: Allow content script insertion on about:-URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no about:blank for user scripts, remove permission from test Created 6 years, 8 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 (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_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ 5 #ifndef CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_
6 #define CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ 6 #define CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 18 matching lines...) Expand all
29 class Extension; 29 class Extension;
30 class ExtensionSet; 30 class ExtensionSet;
31 31
32 // Manages installed UserScripts for a render process. 32 // Manages installed UserScripts for a render process.
33 class UserScriptSlave { 33 class UserScriptSlave {
34 public: 34 public:
35 // Utility to get the URL we will match against for a frame. If the frame has 35 // Utility to get the URL we will match against for a frame. If the frame has
36 // committed, this is the commited URL. Otherwise it is the provisional URL. 36 // committed, this is the commited URL. Otherwise it is the provisional URL.
37 static GURL GetDataSourceURLForFrame(const blink::WebFrame* frame); 37 static GURL GetDataSourceURLForFrame(const blink::WebFrame* frame);
38 38
39 // Get the URL of a frame, based on its securityOrigin. If the security origin
40 // is unique, the frame's URL is returned instead.
41 static GURL GetOriginURLForFrame(const blink::WebFrame* frame);
42
39 explicit UserScriptSlave(const ExtensionSet* extensions); 43 explicit UserScriptSlave(const ExtensionSet* extensions);
40 ~UserScriptSlave(); 44 ~UserScriptSlave();
41 45
42 // Returns the unique set of extension IDs this UserScriptSlave knows about. 46 // Returns the unique set of extension IDs this UserScriptSlave knows about.
43 void GetActiveExtensions(std::set<std::string>* extension_ids); 47 void GetActiveExtensions(std::set<std::string>* extension_ids);
44 48
45 // Update the parsed scripts from shared memory. 49 // Update the parsed scripts from shared memory.
46 bool UpdateScripts(base::SharedMemoryHandle shared_memory); 50 bool UpdateScripts(base::SharedMemoryHandle shared_memory);
47 51
48 // Inject the appropriate scripts into a frame based on its URL. 52 // Inject the appropriate scripts into a frame based on its URL.
(...skipping 30 matching lines...) Expand all
79 83
80 typedef std::map<std::string, int> IsolatedWorldMap; 84 typedef std::map<std::string, int> IsolatedWorldMap;
81 IsolatedWorldMap isolated_world_ids_; 85 IsolatedWorldMap isolated_world_ids_;
82 86
83 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave); 87 DISALLOW_COPY_AND_ASSIGN(UserScriptSlave);
84 }; 88 };
85 89
86 } // namespace extensions 90 } // namespace extensions
87 91
88 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_ 92 #endif // CHROME_RENDERER_EXTENSIONS_USER_SCRIPT_SLAVE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698