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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return; | 153 return; |
154 | 154 |
155 Document* document = nullptr; | 155 Document* document = nullptr; |
156 if (info.Length() >= 4 && v8::Local<v8::Value>::Cast(info[3])->IsObject()) { | 156 if (info.Length() >= 4 && v8::Local<v8::Value>::Cast(info[3])->IsObject()) { |
157 v8::Local<v8::Object> documentWrapper = v8::Local<v8::Object>::Cast(info
[3]); | 157 v8::Local<v8::Object> documentWrapper = v8::Local<v8::Object>::Cast(info
[3]); |
158 if (!V8HTMLDocument::wrapperTypeInfo.equals(toWrapperTypeInfo(documentWr
apper))) | 158 if (!V8HTMLDocument::wrapperTypeInfo.equals(toWrapperTypeInfo(documentWr
apper))) |
159 return; | 159 return; |
160 document = V8HTMLDocument::toImpl(documentWrapper); | 160 document = V8HTMLDocument::toImpl(documentWrapper); |
161 } else { | 161 } else { |
162 v8::Isolate* isolate = info.GetIsolate(); | 162 v8::Isolate* isolate = info.GetIsolate(); |
163 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototype
Chain(isolate->GetEnteredContext()->Global(), isolate); | 163 v8::Local<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeC
hain(isolate->GetEnteredContext()->Global(), isolate); |
164 if (windowWrapper.IsEmpty()) | 164 if (windowWrapper.IsEmpty()) |
165 return; | 165 return; |
166 DOMWindow* window = V8Window::toImpl(windowWrapper); | 166 DOMWindow* window = V8Window::toImpl(windowWrapper); |
167 document = window ? toLocalDOMWindow(window)->document() : nullptr; | 167 document = window ? toLocalDOMWindow(window)->document() : nullptr; |
168 } | 168 } |
169 if (!document || !document->frame()) | 169 if (!document || !document->frame()) |
170 return; | 170 return; |
171 | 171 |
172 DevToolsHost* devtoolsHost = V8DevToolsHost::toImpl(info.Holder()); | 172 DevToolsHost* devtoolsHost = V8DevToolsHost::toImpl(info.Holder()); |
173 Vector<ContextMenuItem> items = menu.items(); | 173 Vector<ContextMenuItem> items = menu.items(); |
174 devtoolsHost->showContextMenu(document->frame(), x, y, items); | 174 devtoolsHost->showContextMenu(document->frame(), x, y, items); |
175 } | 175 } |
176 | 176 |
177 } // namespace blink | 177 } // namespace blink |
178 | 178 |
OLD | NEW |