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

Side by Side Diff: Source/core/inspector/InspectorFrontendHost.cpp

Issue 396213010: [DevTools] Scale context menu position by pageZoomFactor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698