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

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

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
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/extension_custom_bindings.h" 5 #include "chrome/renderer/extensions/extension_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/common/chrome_view_type.h" 10 #include "chrome/common/chrome_view_type.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 v8_extension->GetExtensionForCurrentRenderView(); 162 v8_extension->GetExtensionForCurrentRenderView();
163 if (!extension) 163 if (!extension)
164 return v8::Undefined(); 164 return v8::Undefined();
165 165
166 ExtensionViewAccumulator accumulator(extension->id(), browser_window_id, 166 ExtensionViewAccumulator accumulator(extension->id(), browser_window_id,
167 view_type); 167 view_type);
168 content::RenderView::ForEach(&accumulator); 168 content::RenderView::ForEach(&accumulator);
169 return accumulator.views(); 169 return accumulator.views();
170 } 170 }
171 171
172 v8::Handle<v8::FunctionTemplate> ExtensionCustomBindings::GetNativeFunction( 172 void ExtensionCustomBindings::SetNativeFunctions(
173 v8::Handle<v8::String> name) { 173 v8::Handle<v8::Object> object) {
174 if (name->Equals(v8::String::New("GetExtensionViews"))) { 174 RouteFunctionToStatic("GetExtensionViews", GetExtensionViews, object);
175 return v8::FunctionTemplate::New(GetExtensionViews,
176 v8::External::New(this));
177 }
178
179 return ChromeV8Extension::GetNativeFunction(name);
180 } 175 }
181 176
182 } // namespace extensions 177 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698