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

Side by Side Diff: third_party/WebKit/Source/core/inspector/DevToolsHost.cpp

Issue 2290233007: Move convertViewportToWindow and convertWindowToViewport from (Closed)
Patch Set: add client to WebSharedWorkerImpl Created 4 years, 2 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
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 float DevToolsHost::zoomFactor() 164 float DevToolsHost::zoomFactor()
165 { 165 {
166 if (!m_frontendFrame) 166 if (!m_frontendFrame)
167 return 1; 167 return 1;
168 float zoomFactor = m_frontendFrame->pageZoomFactor(); 168 float zoomFactor = m_frontendFrame->pageZoomFactor();
169 // Cancel the device scale factor applied to the zoom factor in 169 // Cancel the device scale factor applied to the zoom factor in
170 // use-zoom-for-dsf mode. 170 // use-zoom-for-dsf mode.
171 const HostWindow* hostWindow = m_frontendFrame->view()->getHostWindow(); 171 const HostWindow* hostWindow = m_frontendFrame->view()->getHostWindow();
172 float windowToViewportRatio = hostWindow->windowToViewportScalar(1.0f); 172 float windowToViewportRatio = hostWindow->windowToViewportScalar(*m_frontend Frame->view(), 1.0f);
173 return zoomFactor / windowToViewportRatio; 173 return zoomFactor / windowToViewportRatio;
174 } 174 }
175 175
176 void DevToolsHost::setInjectedScriptForOrigin(const String& origin, const String & script) 176 void DevToolsHost::setInjectedScriptForOrigin(const String& origin, const String & script)
177 { 177 {
178 if (m_client) 178 if (m_client)
179 m_client->setInjectedScriptForOrigin(origin, script); 179 m_client->setInjectedScriptForOrigin(origin, script);
180 } 180 }
181 181
182 void DevToolsHost::copyText(const String& text) 182 void DevToolsHost::copyText(const String& text)
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 { 239 {
240 return m_client && m_client->isUnderTest(); 240 return m_client && m_client->isUnderTest();
241 } 241 }
242 242
243 bool DevToolsHost::isHostedMode() 243 bool DevToolsHost::isHostedMode()
244 { 244 {
245 return false; 245 return false;
246 } 246 }
247 247
248 } // namespace blink 248 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698