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

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

Issue 8827013: Move/replace/rename URL-based extension getters from ExtensionService to/in ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: id Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (!renderview) 104 if (!renderview)
105 return NULL; // this can happen as a tab is closing. 105 return NULL; // this can happen as a tab is closing.
106 106
107 WebDocument document = renderview->GetWebView()->mainFrame()->document(); 107 WebDocument document = renderview->GetWebView()->mainFrame()->document();
108 GURL url = document.url(); 108 GURL url = document.url();
109 const ExtensionSet* extensions = extension_dispatcher_->extensions(); 109 const ExtensionSet* extensions = extension_dispatcher_->extensions();
110 if (!extensions->ExtensionBindingsAllowed( 110 if (!extensions->ExtensionBindingsAllowed(
111 ExtensionURLInfo(document.securityOrigin(), url))) 111 ExtensionURLInfo(document.securityOrigin(), url)))
112 return NULL; 112 return NULL;
113 113
114 return extensions->GetByURL( 114 return extensions->GetExtensionOrAppByURL(
115 ExtensionURLInfo(document.securityOrigin(), url)); 115 ExtensionURLInfo(document.securityOrigin(), url));
116 } 116 }
117 117
118 bool ChromeV8Extension::CheckCurrentContextAccessToExtensionAPI( 118 bool ChromeV8Extension::CheckCurrentContextAccessToExtensionAPI(
119 const std::string& function_name) const { 119 const std::string& function_name) const {
120 ChromeV8Context* context = 120 ChromeV8Context* context =
121 extension_dispatcher_->v8_context_set().GetCurrent(); 121 extension_dispatcher_->v8_context_set().GetCurrent();
122 if (!context) { 122 if (!context) {
123 DLOG(ERROR) << "Not in a v8::Context"; 123 DLOG(ERROR) << "Not in a v8::Context";
124 return false; 124 return false;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (args.Length() < 1) 203 if (args.Length() < 1)
204 return v8::Undefined(); 204 return v8::Undefined();
205 205
206 std::vector<std::string> components; 206 std::vector<std::string> components;
207 for (int i = 0; i < args.Length(); ++i) 207 for (int i = 0; i < args.Length(); ++i)
208 components.push_back(*v8::String::Utf8Value(args[i]->ToString())); 208 components.push_back(*v8::String::Utf8Value(args[i]->ToString()));
209 209
210 LOG(ERROR) << JoinString(components, ','); 210 LOG(ERROR) << JoinString(components, ',');
211 return v8::Undefined(); 211 return v8::Undefined();
212 } 212 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/app_bindings.cc ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698