diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 00:05:22 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 00:05:22 +0000 |
commit | 7ab32597bca70587fc48dba135a9fc2b8f5ba3ac (patch) | |
tree | 82362f8ce79f3f4f1cc1d6aa5be1ec40f5a85a39 /chrome/renderer/extensions/event_bindings.cc | |
parent | 9c8574e82b0371650ebb55237ef94a3630587703 (diff) | |
download | chromium_src-7ab32597bca70587fc48dba135a9fc2b8f5ba3ac.zip chromium_src-7ab32597bca70587fc48dba135a9fc2b8f5ba3ac.tar.gz chromium_src-7ab32597bca70587fc48dba135a9fc2b8f5ba3ac.tar.bz2 |
Use the current frame's URL when initializing the extension framework for a frame.
Previously we were using the toplevel frame's URL.
BUG=22658
TEST=no
Review URL: http://codereview.chromium.org/249026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/event_bindings.cc')
-rw-r--r-- | chrome/renderer/extensions/event_bindings.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc index c30c364..446cacb 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)) { |