Index: chrome/renderer/render_view.cc |
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc |
index d8adaaa5279182cfccf03a98883ea44e374f7c3f..f0cb4a81b4620b6e347fab5c0a71c1e22206e29f 100644 |
--- a/chrome/renderer/render_view.cc |
+++ b/chrome/renderer/render_view.cc |
@@ -394,8 +394,9 @@ static bool CrossesIntoExtensionExtent(WebFrame* frame, const GURL& new_url) { |
if (old_url.is_empty() && frame->opener()) |
old_url = frame->opener()->url(); |
- return !ExtensionRendererInfo::InSameExtent(old_url, new_url) && |
- !ExtensionRendererInfo::GetByURL(old_url); |
+ ExtensionRendererInfo* extensions = RenderThread::current()->extensions(); |
+ return !extensions->InSameExtent(old_url, new_url) && |
+ !extensions->GetByURL(old_url); |
} |
// Returns the ISO 639_1 language code of the specified |text|, or 'unknown' |
@@ -1887,14 +1888,14 @@ void RenderView::LoadNavigationErrorPage(WebFrame* frame, |
bool replace) { |
GURL failed_url = error.unreachableURL; |
std::string alt_html; |
- ExtensionRendererInfo* extension = NULL; |
+ scoped_refptr<const Extension> extension; |
Matt Perry
2011/01/24 20:08:34
just use raw ptrs
Aaron Boodman
2011/01/25 00:27:33
Done.
|
if (html.empty()) { |
// Use a local error page. |
int resource_id; |
DictionaryValue error_strings; |
if (failed_url.is_valid() && !failed_url.SchemeIs(chrome::kExtensionScheme)) |
- extension = ExtensionRendererInfo::GetByURL(failed_url); |
+ extension = RenderThread::current()->extensions()->GetByURL(failed_url); |
if (extension) { |
LocalizedError::GetAppErrorStrings(error, failed_url, extension, |
&error_strings); |
@@ -2625,7 +2626,7 @@ void RenderView::show(WebNavigationPolicy policy) { |
// Extensions and apps always allowed to create unrequested popups. The second |
// check is necessary to include content scripts. |
- if (ExtensionRendererInfo::GetByURL(creator_url_) || |
+ if (RenderThread::current()->extensions()->GetByURL(creator_url_) || |
bindings_utils::GetInfoForCurrentContext()) { |
opened_by_user_gesture_ = true; |
} |
@@ -3926,8 +3927,8 @@ webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( |
// appropriate permission, or when explicitly enabled on the command line. |
GURL main_frame_url(webview()->mainFrame()->url()); |
- ExtensionRendererInfo* extension = |
- ExtensionRendererInfo::GetByURL(main_frame_url); |
+ scoped_refptr<const Extension> extension = |
+ RenderThread::current()->extensions()->GetByURL(main_frame_url); |
bool in_ext = extension != NULL; |
bool explicit_enable = |
CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl); |
@@ -5395,24 +5396,16 @@ void RenderView::ExecuteCodeImpl(WebFrame* frame, |
frame_it != frame_vector.end(); ++frame_it) { |
WebFrame* frame = *frame_it; |
if (params.is_javascript) { |
- ExtensionRendererInfo* extension = |
- ExtensionRendererInfo::GetByID(params.extension_id); |
+ scoped_refptr<const Extension> extension = |
+ RenderThread::current()->extensions()->GetByID(params.extension_id); |
// Since extension info is sent separately from user script info, they can |
// be out of sync. We just ignore this situation. |
if (!extension) |
continue; |
- const std::vector<URLPattern> host_permissions = |
- extension->host_permissions(); |
- if (!Extension::CanExecuteScriptOnPage( |
- frame->url(), |
- extension->allowed_to_execute_script_everywhere(), |
- &host_permissions, |
- NULL, |
- NULL)) { |
+ if (!extension->CanExecuteScriptOnPage(frame->url(), NULL, NULL)) |
continue; |
- } |
std::vector<WebScriptSource> sources; |
sources.push_back( |