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

Side by Side Diff: extensions/renderer/context_menus_custom_bindings.cc

Issue 235943018: Move extensions bindings code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 8 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/context_menus_custom_bindings.h" 5 #include "extensions/renderer/context_menus_custom_bindings.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/public/renderer/render_thread.h" 8 #include "content/public/renderer/render_thread.h"
9 #include "extensions/common/extension_messages.h" 9 #include "extensions/common/extension_messages.h"
10 #include "grit/renderer_resources.h"
11 #include "v8/include/v8.h" 10 #include "v8/include/v8.h"
12 11
13 namespace { 12 namespace {
14 13
15 void GetNextContextMenuId(const v8::FunctionCallbackInfo<v8::Value>& args) { 14 void GetNextContextMenuId(const v8::FunctionCallbackInfo<v8::Value>& args) {
16 int context_menu_id = -1; 15 int context_menu_id = -1;
17 content::RenderThread::Get()->Send( 16 content::RenderThread::Get()->Send(
18 new ExtensionHostMsg_GenerateUniqueID(&context_menu_id)); 17 new ExtensionHostMsg_GenerateUniqueID(&context_menu_id));
19 args.GetReturnValue().Set(static_cast<int32_t>(context_menu_id)); 18 args.GetReturnValue().Set(static_cast<int32_t>(context_menu_id));
20 } 19 }
21 20
22 } // namespace 21 } // namespace
23 22
24 namespace extensions { 23 namespace extensions {
25 24
26 ContextMenusCustomBindings::ContextMenusCustomBindings( 25 ContextMenusCustomBindings::ContextMenusCustomBindings(ScriptContext* context)
27 Dispatcher* dispatcher, ChromeV8Context* context) 26 : ObjectBackedNativeHandler(context) {
28 : ChromeV8Extension(dispatcher, context) {
29 RouteFunction("GetNextContextMenuId", base::Bind(&GetNextContextMenuId)); 27 RouteFunction("GetNextContextMenuId", base::Bind(&GetNextContextMenuId));
30 } 28 }
31 29
32 } // extensions 30 } // extensions
OLDNEW
« no previous file with comments | « extensions/renderer/context_menus_custom_bindings.h ('k') | extensions/renderer/css_native_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698