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

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

Issue 1945433002: [Extensions] Update more bindings and allow for multiple feature access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Antony's Created 4 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
« no previous file with comments | « extensions/renderer/blob_native_handler.cc ('k') | extensions/renderer/file_system_natives.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/renderer/context_menus_custom_bindings.h" 5 #include "extensions/renderer/context_menus_custom_bindings.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "content/public/renderer/render_thread.h" 10 #include "content/public/renderer/render_thread.h"
11 #include "extensions/common/extension_messages.h" 11 #include "extensions/common/extension_messages.h"
12 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
13 13
14 namespace { 14 namespace {
15 15
16 void GetNextContextMenuId(const v8::FunctionCallbackInfo<v8::Value>& args) { 16 void GetNextContextMenuId(const v8::FunctionCallbackInfo<v8::Value>& args) {
17 int context_menu_id = -1; 17 int context_menu_id = -1;
18 content::RenderThread::Get()->Send( 18 content::RenderThread::Get()->Send(
19 new ExtensionHostMsg_GenerateUniqueID(&context_menu_id)); 19 new ExtensionHostMsg_GenerateUniqueID(&context_menu_id));
20 args.GetReturnValue().Set(static_cast<int32_t>(context_menu_id)); 20 args.GetReturnValue().Set(static_cast<int32_t>(context_menu_id));
21 } 21 }
22 22
23 } // namespace 23 } // namespace
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 ContextMenusCustomBindings::ContextMenusCustomBindings(ScriptContext* context) 27 ContextMenusCustomBindings::ContextMenusCustomBindings(ScriptContext* context)
28 : ObjectBackedNativeHandler(context) { 28 : ObjectBackedNativeHandler(context) {
29 RouteFunction("GetNextContextMenuId", base::Bind(&GetNextContextMenuId)); 29 RouteFunction("GetNextContextMenuId",
30 std::vector<std::string>({"contextMenus",
31 "chromeWebViewInternal"}),
32 base::Bind(&GetNextContextMenuId));
30 } 33 }
31 34
32 } // extensions 35 } // extensions
OLDNEW
« no previous file with comments | « extensions/renderer/blob_native_handler.cc ('k') | extensions/renderer/file_system_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698