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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 885493007: Refactoring: de-couple Extensions from "script injection System" [render side] : 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/extensions.gypi ('k') | extensions/renderer/extension_injection_host.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 #include "extensions/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return is_active; 228 return is_active;
229 } 229 }
230 230
231 const Extension* Dispatcher::GetExtensionFromFrameAndWorld( 231 const Extension* Dispatcher::GetExtensionFromFrameAndWorld(
232 const WebFrame* frame, 232 const WebFrame* frame,
233 int world_id, 233 int world_id,
234 bool use_effective_url) { 234 bool use_effective_url) {
235 std::string extension_id; 235 std::string extension_id;
236 if (world_id != 0) { 236 if (world_id != 0) {
237 // Isolated worlds (content script). 237 // Isolated worlds (content script).
238 extension_id = ScriptInjection::GetExtensionIdForIsolatedWorld(world_id); 238 extension_id = ScriptInjection::GetHostIdForIsolatedWorld(world_id);
239 } else if (!frame->document().securityOrigin().isUnique()) { 239 } else if (!frame->document().securityOrigin().isUnique()) {
240 // TODO(kalman): Delete the above check. 240 // TODO(kalman): Delete the above check.
241 241
242 // Extension pages (chrome-extension:// URLs). 242 // Extension pages (chrome-extension:// URLs).
243 GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame); 243 GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame);
244 frame_url = ScriptContext::GetEffectiveDocumentURL( 244 frame_url = ScriptContext::GetEffectiveDocumentURL(
245 frame, frame_url, use_effective_url); 245 frame, frame_url, use_effective_url);
246 extension_id = extensions_.GetExtensionOrAppIDByURL(frame_url); 246 extension_id = extensions_.GetExtensionOrAppIDByURL(frame_url);
247 } 247 }
248 248
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 return v8::Handle<v8::Object>(); 1544 return v8::Handle<v8::Object>();
1545 1545
1546 if (bind_name) 1546 if (bind_name)
1547 *bind_name = split.back(); 1547 *bind_name = split.back();
1548 1548
1549 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1549 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1550 : bind_object; 1550 : bind_object;
1551 } 1551 }
1552 1552
1553 } // namespace extensions 1553 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/extensions.gypi ('k') | extensions/renderer/extension_injection_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698