OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 devtoolsHost->showContextMenu(event, items); | 124 devtoolsHost->showContextMenu(event, items); |
125 } | 125 } |
126 | 126 |
127 void V8DevToolsHost::showContextMenuAtPointMethodCustom(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 127 void V8DevToolsHost::showContextMenuAtPointMethodCustom(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
128 { | 128 { |
129 if (info.Length() < 3) | 129 if (info.Length() < 3) |
130 return; | 130 return; |
131 | 131 |
132 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showContext
MenuAtPoint", "DevToolsHost", info.Holder(), info.GetIsolate()); | 132 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showContext
MenuAtPoint", "DevToolsHost", info.Holder(), info.GetIsolate()); |
133 | 133 |
134 TONATIVE_VOID_EXCEPTIONSTATE(float, x, toRestrictedFloat(info[0], exceptionS
tate), exceptionState); | 134 TONATIVE_VOID_EXCEPTIONSTATE(float, x, toRestrictedFloat(info.GetIsolate(),
info[0], exceptionState), exceptionState); |
135 TONATIVE_VOID_EXCEPTIONSTATE(float, y, toRestrictedFloat(info[1], exceptionS
tate), exceptionState); | 135 TONATIVE_VOID_EXCEPTIONSTATE(float, y, toRestrictedFloat(info.GetIsolate(),
info[1], exceptionState), exceptionState); |
136 | 136 |
137 v8::Local<v8::Value> array = v8::Local<v8::Value>::Cast(info[2]); | 137 v8::Local<v8::Value> array = v8::Local<v8::Value>::Cast(info[2]); |
138 if (!array->IsArray()) | 138 if (!array->IsArray()) |
139 return; | 139 return; |
140 ContextMenu menu; | 140 ContextMenu menu; |
141 if (!populateContextMenuItems(v8::Local<v8::Array>::Cast(array), menu, info.
GetIsolate())) | 141 if (!populateContextMenuItems(v8::Local<v8::Array>::Cast(array), menu, info.
GetIsolate())) |
142 return; | 142 return; |
143 | 143 |
144 Document* document = nullptr; | 144 Document* document = nullptr; |
145 if (info.Length() >= 4 && v8::Local<v8::Value>::Cast(info[3])->IsObject()) { | 145 if (info.Length() >= 4 && v8::Local<v8::Value>::Cast(info[3])->IsObject()) { |
(...skipping 12 matching lines...) Expand all Loading... |
158 if (!document || !document->frame()) | 158 if (!document || !document->frame()) |
159 return; | 159 return; |
160 | 160 |
161 DevToolsHost* devtoolsHost = V8DevToolsHost::toImpl(info.Holder()); | 161 DevToolsHost* devtoolsHost = V8DevToolsHost::toImpl(info.Holder()); |
162 Vector<ContextMenuItem> items = menu.items(); | 162 Vector<ContextMenuItem> items = menu.items(); |
163 devtoolsHost->showContextMenu(document->frame(), x, y, items); | 163 devtoolsHost->showContextMenu(document->frame(), x, y, items); |
164 } | 164 } |
165 | 165 |
166 } // namespace blink | 166 } // namespace blink |
167 | 167 |
OLD | NEW |