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

Unified Diff: chrome/renderer/extensions/event_bindings.cc

Issue 249026: Use the current frame's URL when initializing the extension framework for a frame. (Closed)
Patch Set: Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/event_bindings.cc
diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc
index c30c36496cb528fb4f2efd836309c24e641d9a5b..446cacb4bf8c9a5773a88fc7fadba37fbb41e8bb 100644
--- a/chrome/renderer/extensions/event_bindings.cc
+++ b/chrome/renderer/extensions/event_bindings.cc
@@ -220,12 +220,11 @@ void EventBindings::HandleContextCreated(WebFrame* frame, bool content_script) {
DCHECK(!context.IsEmpty());
DCHECK(bindings_utils::FindContext(context) == contexts.end());
- // Figure out the URL for the toplevel frame. If the top frame is loading,
- // use its provisional URL, since we get this notification before commit.
- WebFrame* main_frame = frame->view()->GetMainFrame();
- WebKit::WebDataSource* ds = main_frame->provisionalDataSource();
+ // Figure out the frame's URL. If the frame is loading, use its provisional
+ // URL, since we get this notification before commit.
+ WebKit::WebDataSource* ds = frame->provisionalDataSource();
if (!ds)
- ds = main_frame->dataSource();
+ ds = frame->dataSource();
GURL url = ds->request().url();
std::string extension_id;
if (url.SchemeIs(chrome::kExtensionScheme)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698