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

Side by Side Diff: chrome/renderer/extensions/tabs_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/tabs_custom_bindings.h" 5 #include "chrome/renderer/extensions/tabs_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/common/extensions/extension_action.h" 9 #include "chrome/common/extensions/extension_action.h"
10 #include "chrome/common/extensions/extension_messages.h" 10 #include "chrome/common/extensions/extension_messages.h"
(...skipping 29 matching lines...) Expand all
40 std::string channel_name = *v8::String::Utf8Value(args[2]->ToString()); 40 std::string channel_name = *v8::String::Utf8Value(args[2]->ToString());
41 int port_id = -1; 41 int port_id = -1;
42 renderview->Send(new ExtensionHostMsg_OpenChannelToTab( 42 renderview->Send(new ExtensionHostMsg_OpenChannelToTab(
43 renderview->GetRoutingId(), tab_id, extension_id, channel_name, 43 renderview->GetRoutingId(), tab_id, extension_id, channel_name,
44 &port_id)); 44 &port_id));
45 return v8::Integer::New(port_id); 45 return v8::Integer::New(port_id);
46 } 46 }
47 return v8::Undefined(); 47 return v8::Undefined();
48 } 48 }
49 49
50 v8::Handle<v8::FunctionTemplate> TabsCustomBindings::GetNativeFunction( 50 void TabsCustomBindings::SetNativeFunctions(v8::Handle<v8::Object> object) {
51 v8::Handle<v8::String> name) { 51 RouteFunctionToStatic("OpenChannelToTab", OpenChannelToTab, object);
52 if (name->Equals(v8::String::New("OpenChannelToTab")))
53 return v8::FunctionTemplate::New(OpenChannelToTab);
54
55 return ChromeV8Extension::GetNativeFunction(name);
56 } 52 }
57 53
58 } // extensions 54 } // extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698