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

Side by Side Diff: Source/web/WebDevToolsAgentImpl.cpp

Issue 205403004: [DevTools] Allow overriding only the device scale factor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase, one test fixed Created 6 years, 9 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
« no previous file with comments | « Source/devtools/front_end/OverridesSupport.js ('k') | 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) 2010-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2010-2011 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) { 318 if (WebInputEvent::isKeyboardEventType(inputEvent.type)) {
319 PlatformKeyboardEvent keyboardEvent = PlatformKeyboardEventBuilder(*stat ic_cast<const WebKeyboardEvent*>(&inputEvent)); 319 PlatformKeyboardEvent keyboardEvent = PlatformKeyboardEventBuilder(*stat ic_cast<const WebKeyboardEvent*>(&inputEvent));
320 return ic->handleKeyboardEvent(page->mainFrame(), keyboardEvent); 320 return ic->handleKeyboardEvent(page->mainFrame(), keyboardEvent);
321 } 321 }
322 return false; 322 return false;
323 } 323 }
324 324
325 void WebDevToolsAgentImpl::overrideDeviceMetrics(int width, int height, float de viceScaleFactor, bool emulateViewport, bool fitWindow) 325 void WebDevToolsAgentImpl::overrideDeviceMetrics(int width, int height, float de viceScaleFactor, bool emulateViewport, bool fitWindow)
326 { 326 {
327 if (!width && !height) { 327 if (!width && !height && !deviceScaleFactor) {
328 if (m_deviceMetricsEnabled) { 328 if (m_deviceMetricsEnabled) {
329 m_deviceMetricsEnabled = false; 329 m_deviceMetricsEnabled = false;
330 m_webViewImpl->setBackgroundColorOverride(Color::transparent); 330 m_webViewImpl->setBackgroundColorOverride(Color::transparent);
331 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_isOverlayScrol lbarsEnabled); 331 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(m_isOverlayScrol lbarsEnabled);
332 disableViewportEmulation(); 332 disableViewportEmulation();
333 m_client->disableDeviceEmulation(); 333 m_client->disableDeviceEmulation();
334 } 334 }
335 } else { 335 } else {
336 if (!m_deviceMetricsEnabled) { 336 if (!m_deviceMetricsEnabled) {
337 m_deviceMetricsEnabled = true; 337 m_deviceMetricsEnabled = true;
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kProfiler_startCmd) 664 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kProfiler_startCmd)
665 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kProfiler_stopCmd); 665 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke ndDispatcher::kProfiler_stopCmd);
666 } 666 }
667 667
668 void WebDevToolsAgent::processPendingMessages() 668 void WebDevToolsAgent::processPendingMessages()
669 { 669 {
670 PageScriptDebugServer::shared().runPendingTasks(); 670 PageScriptDebugServer::shared().runPendingTasks();
671 } 671 }
672 672
673 } // namespace blink 673 } // namespace blink
OLDNEW
« no previous file with comments | « Source/devtools/front_end/OverridesSupport.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698