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

Side by Side Diff: chrome/renderer/extensions/chrome_v8_extension.cc

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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 #include "chrome/renderer/extensions/chrome_v8_extension.h" 5 #include "chrome/renderer/extensions/chrome_v8_extension.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 ChromeV8Extension::~ChromeV8Extension() { 56 ChromeV8Extension::~ChromeV8Extension() {
57 g_instances.Get().erase(this); 57 g_instances.Get().erase(this);
58 } 58 }
59 59
60 // static 60 // static
61 const ChromeV8Extension::InstanceSet& ChromeV8Extension::GetAll() { 61 const ChromeV8Extension::InstanceSet& ChromeV8Extension::GetAll() {
62 return g_instances.Get(); 62 return g_instances.Get();
63 } 63 }
64 64
65 const Extension* ChromeV8Extension::GetExtensionForCurrentRenderView() const { 65 const extensions::Extension*
66 ChromeV8Extension::GetExtensionForCurrentRenderView() const {
66 content::RenderView* renderview = GetCurrentRenderView(); 67 content::RenderView* renderview = GetCurrentRenderView();
67 if (!renderview) 68 if (!renderview)
68 return NULL; // this can happen as a tab is closing. 69 return NULL; // this can happen as a tab is closing.
69 70
70 WebDocument document = renderview->GetWebView()->mainFrame()->document(); 71 WebDocument document = renderview->GetWebView()->mainFrame()->document();
71 GURL url = document.url(); 72 GURL url = document.url();
72 const ExtensionSet* extensions = extension_dispatcher_->extensions(); 73 const ExtensionSet* extensions = extension_dispatcher_->extensions();
73 if (!extensions->ExtensionBindingsAllowed( 74 if (!extensions->ExtensionBindingsAllowed(
74 ExtensionURLInfo(document.securityOrigin(), url))) 75 ExtensionURLInfo(document.securityOrigin(), url)))
75 return NULL; 76 return NULL;
76 77
77 return extensions->GetExtensionOrAppByURL( 78 return extensions->GetExtensionOrAppByURL(
78 ExtensionURLInfo(document.securityOrigin(), url)); 79 ExtensionURLInfo(document.securityOrigin(), url));
79 } 80 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/chrome_v8_extension.h ('k') | chrome/renderer/extensions/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698