| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 void V8DevToolsHost::showContextMenuAtPointMethodCustom(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 114 void V8DevToolsHost::showContextMenuAtPointMethodCustom(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 115 { | 115 { |
| 116 if (info.Length() < 3) | 116 if (info.Length() < 3) |
| 117 return; | 117 return; |
| 118 | 118 |
| 119 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showContext
MenuAtPoint", "DevToolsHost", info.Holder(), info.GetIsolate()); | 119 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showContext
MenuAtPoint", "DevToolsHost", info.Holder(), info.GetIsolate()); |
| 120 v8::Isolate* isolate = info.GetIsolate(); | 120 v8::Isolate* isolate = info.GetIsolate(); |
| 121 | 121 |
| 122 float x = toRestrictedFloat(isolate, info[0], exceptionState); | 122 float x = toRestrictedFloat(isolate, info[0], exceptionState); |
| 123 if (exceptionState.throwIfNeeded()) | 123 if (exceptionState.hadException()) |
| 124 return; | 124 return; |
| 125 float y = toRestrictedFloat(isolate, info[1], exceptionState); | 125 float y = toRestrictedFloat(isolate, info[1], exceptionState); |
| 126 if (exceptionState.throwIfNeeded()) | 126 if (exceptionState.hadException()) |
| 127 return; | 127 return; |
| 128 | 128 |
| 129 v8::Local<v8::Value> array = v8::Local<v8::Value>::Cast(info[2]); | 129 v8::Local<v8::Value> array = v8::Local<v8::Value>::Cast(info[2]); |
| 130 if (!array->IsArray()) | 130 if (!array->IsArray()) |
| 131 return; | 131 return; |
| 132 ContextMenu menu; | 132 ContextMenu menu; |
| 133 if (!populateContextMenuItems(isolate, v8::Local<v8::Array>::Cast(array), me
nu)) | 133 if (!populateContextMenuItems(isolate, v8::Local<v8::Array>::Cast(array), me
nu)) |
| 134 return; | 134 return; |
| 135 | 135 |
| 136 Document* document = nullptr; | 136 Document* document = nullptr; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 148 } | 148 } |
| 149 if (!document || !document->frame()) | 149 if (!document || !document->frame()) |
| 150 return; | 150 return; |
| 151 | 151 |
| 152 DevToolsHost* devtoolsHost = V8DevToolsHost::toImpl(info.Holder()); | 152 DevToolsHost* devtoolsHost = V8DevToolsHost::toImpl(info.Holder()); |
| 153 Vector<ContextMenuItem> items = menu.items(); | 153 Vector<ContextMenuItem> items = menu.items(); |
| 154 devtoolsHost->showContextMenu(document->frame(), x, y, items); | 154 devtoolsHost->showContextMenu(document->frame(), x, y, items); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace blink | 157 } // namespace blink |
| 158 | |
| OLD | NEW |