OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 void InspectorFrontendHost::showContextMenu(Page* page, float x, float y, const
Vector<ContextMenuItem>& items) | 199 void InspectorFrontendHost::showContextMenu(Page* page, float x, float y, const
Vector<ContextMenuItem>& items) |
200 { | 200 { |
201 ASSERT(m_frontendPage); | 201 ASSERT(m_frontendPage); |
202 ScriptState* frontendScriptState = ScriptState::forMainWorld(m_frontendPage-
>deprecatedLocalMainFrame()); | 202 ScriptState* frontendScriptState = ScriptState::forMainWorld(m_frontendPage-
>deprecatedLocalMainFrame()); |
203 ScriptValue frontendApiObject = frontendScriptState->getFromGlobalObject("In
spectorFrontendAPI"); | 203 ScriptValue frontendApiObject = frontendScriptState->getFromGlobalObject("In
spectorFrontendAPI"); |
204 ASSERT(frontendApiObject.isObject()); | 204 ASSERT(frontendApiObject.isObject()); |
205 | 205 |
206 RefPtr<FrontendMenuProvider> menuProvider = FrontendMenuProvider::create(thi
s, frontendApiObject, items); | 206 RefPtr<FrontendMenuProvider> menuProvider = FrontendMenuProvider::create(thi
s, frontendApiObject, items); |
207 m_menuProvider = menuProvider.get(); | 207 m_menuProvider = menuProvider.get(); |
208 page->inspectorController().showContextMenu(x, y, menuProvider); | 208 float zoom = page->deprecatedLocalMainFrame()->pageZoomFactor(); |
| 209 page->inspectorController().showContextMenu(x * zoom, y * zoom, menuProvider
); |
209 } | 210 } |
210 | 211 |
211 void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMe
nuItem>& items) | 212 void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMe
nuItem>& items) |
212 { | 213 { |
213 if (!event) | 214 if (!event) |
214 return; | 215 return; |
215 | 216 |
216 ASSERT(m_frontendPage); | 217 ASSERT(m_frontendPage); |
217 ScriptState* frontendScriptState = ScriptState::forMainWorld(m_frontendPage-
>deprecatedLocalMainFrame()); | 218 ScriptState* frontendScriptState = ScriptState::forMainWorld(m_frontendPage-
>deprecatedLocalMainFrame()); |
218 ScriptValue frontendApiObject = frontendScriptState->getFromGlobalObject("In
spectorFrontendAPI"); | 219 ScriptValue frontendApiObject = frontendScriptState->getFromGlobalObject("In
spectorFrontendAPI"); |
(...skipping 25 matching lines...) Expand all Loading... |
244 { | 245 { |
245 return m_client && m_client->isUnderTest(); | 246 return m_client && m_client->isUnderTest(); |
246 } | 247 } |
247 | 248 |
248 bool InspectorFrontendHost::isStub() | 249 bool InspectorFrontendHost::isStub() |
249 { | 250 { |
250 return false; | 251 return false; |
251 } | 252 } |
252 | 253 |
253 } // namespace WebCore | 254 } // namespace WebCore |
OLD | NEW |