| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 #include "web/ValidationMessageClientImpl.h" | 173 #include "web/ValidationMessageClientImpl.h" |
| 174 #include "web/ViewportAnchor.h" | 174 #include "web/ViewportAnchor.h" |
| 175 #include "web/WebDevToolsAgentImpl.h" | 175 #include "web/WebDevToolsAgentImpl.h" |
| 176 #include "web/WebInputEventConversion.h" | 176 #include "web/WebInputEventConversion.h" |
| 177 #include "web/WebLocalFrameImpl.h" | 177 #include "web/WebLocalFrameImpl.h" |
| 178 #include "web/WebPagePopupImpl.h" | 178 #include "web/WebPagePopupImpl.h" |
| 179 #include "web/WebPluginContainerImpl.h" | 179 #include "web/WebPluginContainerImpl.h" |
| 180 #include "web/WebRemoteFrameImpl.h" | 180 #include "web/WebRemoteFrameImpl.h" |
| 181 #include "web/WebSettingsImpl.h" | 181 #include "web/WebSettingsImpl.h" |
| 182 #include "wtf/CurrentTime.h" | 182 #include "wtf/CurrentTime.h" |
| 183 #include "wtf/PtrUtil.h" |
| 183 #include "wtf/RefPtr.h" | 184 #include "wtf/RefPtr.h" |
| 184 #include "wtf/TemporaryChange.h" | 185 #include "wtf/TemporaryChange.h" |
| 186 #include <memory> |
| 185 | 187 |
| 186 #if USE(DEFAULT_RENDER_THEME) | 188 #if USE(DEFAULT_RENDER_THEME) |
| 187 #include "core/layout/LayoutThemeDefault.h" | 189 #include "core/layout/LayoutThemeDefault.h" |
| 188 #endif | 190 #endif |
| 189 | 191 |
| 190 // Get rid of WTF's pow define so we can use std::pow. | 192 // Get rid of WTF's pow define so we can use std::pow. |
| 191 #undef pow | 193 #undef pow |
| 192 #include <cmath> // for std::pow | 194 #include <cmath> // for std::pow |
| 193 | 195 |
| 194 // The following constants control parameters for automated scaling of webpages | 196 // The following constants control parameters for automated scaling of webpages |
| (...skipping 27 matching lines...) Expand all Loading... |
| 222 // Change the text zoom level by kTextSizeMultiplierRatio each time the user | 224 // Change the text zoom level by kTextSizeMultiplierRatio each time the user |
| 223 // zooms text in or out (ie., change by 20%). The min and max values limit | 225 // zooms text in or out (ie., change by 20%). The min and max values limit |
| 224 // text zoom to half and 3x the original text size. These three values match | 226 // text zoom to half and 3x the original text size. These three values match |
| 225 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm | 227 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm |
| 226 const double WebView::textSizeMultiplierRatio = 1.2; | 228 const double WebView::textSizeMultiplierRatio = 1.2; |
| 227 const double WebView::minTextSizeMultiplier = 0.5; | 229 const double WebView::minTextSizeMultiplier = 0.5; |
| 228 const double WebView::maxTextSizeMultiplier = 3.0; | 230 const double WebView::maxTextSizeMultiplier = 3.0; |
| 229 | 231 |
| 230 // Used to defer all page activity in cases where the embedder wishes to run | 232 // Used to defer all page activity in cases where the embedder wishes to run |
| 231 // a nested event loop. Using a stack enables nesting of message loop invocation
s. | 233 // a nested event loop. Using a stack enables nesting of message loop invocation
s. |
| 232 static Vector<OwnPtr<ScopedPageLoadDeferrer>>& pageLoadDeferrerStack() | 234 static Vector<std::unique_ptr<ScopedPageLoadDeferrer>>& pageLoadDeferrerStack() |
| 233 { | 235 { |
| 234 DEFINE_STATIC_LOCAL(Vector<OwnPtr<ScopedPageLoadDeferrer>>, deferrerStack, (
)); | 236 DEFINE_STATIC_LOCAL(Vector<std::unique_ptr<ScopedPageLoadDeferrer>>, deferre
rStack, ()); |
| 235 return deferrerStack; | 237 return deferrerStack; |
| 236 } | 238 } |
| 237 | 239 |
| 238 // Ensure that the WebDragOperation enum values stay in sync with the original | 240 // Ensure that the WebDragOperation enum values stay in sync with the original |
| 239 // DragOperation constants. | 241 // DragOperation constants. |
| 240 #define STATIC_ASSERT_ENUM(a, b) \ | 242 #define STATIC_ASSERT_ENUM(a, b) \ |
| 241 static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 243 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| 242 "mismatching enum : " #a) | 244 "mismatching enum : " #a) |
| 243 STATIC_ASSERT_ENUM(DragOperationNone, WebDragOperationNone); | 245 STATIC_ASSERT_ENUM(DragOperationNone, WebDragOperationNone); |
| 244 STATIC_ASSERT_ENUM(DragOperationCopy, WebDragOperationCopy); | 246 STATIC_ASSERT_ENUM(DragOperationCopy, WebDragOperationCopy); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 Page::visitedStateChanged(linkHash); | 357 Page::visitedStateChanged(linkHash); |
| 356 } | 358 } |
| 357 | 359 |
| 358 void WebView::resetVisitedLinkState(bool invalidateVisitedLinkHashes) | 360 void WebView::resetVisitedLinkState(bool invalidateVisitedLinkHashes) |
| 359 { | 361 { |
| 360 Page::allVisitedStateChanged(invalidateVisitedLinkHashes); | 362 Page::allVisitedStateChanged(invalidateVisitedLinkHashes); |
| 361 } | 363 } |
| 362 | 364 |
| 363 void WebView::willEnterModalLoop() | 365 void WebView::willEnterModalLoop() |
| 364 { | 366 { |
| 365 pageLoadDeferrerStack().append(adoptPtr(new ScopedPageLoadDeferrer())); | 367 pageLoadDeferrerStack().append(wrapUnique(new ScopedPageLoadDeferrer())); |
| 366 } | 368 } |
| 367 | 369 |
| 368 void WebView::didExitModalLoop() | 370 void WebView::didExitModalLoop() |
| 369 { | 371 { |
| 370 DCHECK(pageLoadDeferrerStack().size()); | 372 DCHECK(pageLoadDeferrerStack().size()); |
| 371 pageLoadDeferrerStack().removeLast(); | 373 pageLoadDeferrerStack().removeLast(); |
| 372 } | 374 } |
| 373 | 375 |
| 374 void WebViewImpl::setMainFrame(WebFrame* frame) | 376 void WebViewImpl::setMainFrame(WebFrame* frame) |
| 375 { | 377 { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 , m_baseBackgroundColor(Color::white) | 443 , m_baseBackgroundColor(Color::white) |
| 442 , m_backgroundColorOverride(Color::transparent) | 444 , m_backgroundColorOverride(Color::transparent) |
| 443 , m_zoomFactorOverride(0) | 445 , m_zoomFactorOverride(0) |
| 444 , m_userGestureObserved(false) | 446 , m_userGestureObserved(false) |
| 445 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) | 447 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) |
| 446 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) | 448 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) |
| 447 , m_shouldDispatchFirstLayoutAfterFinishedLoading(false) | 449 , m_shouldDispatchFirstLayoutAfterFinishedLoading(false) |
| 448 , m_displayMode(WebDisplayModeBrowser) | 450 , m_displayMode(WebDisplayModeBrowser) |
| 449 , m_elasticOverscroll(FloatSize()) | 451 , m_elasticOverscroll(FloatSize()) |
| 450 , m_mutator(nullptr) | 452 , m_mutator(nullptr) |
| 451 , m_scheduler(adoptPtr(Platform::current()->currentThread()->scheduler()->cr
eateWebViewScheduler(this).release())) | 453 , m_scheduler(wrapUnique(Platform::current()->currentThread()->scheduler()->
createWebViewScheduler(this).release())) |
| 452 , m_lastFrameTimeMonotonic(0) | 454 , m_lastFrameTimeMonotonic(0) |
| 453 { | 455 { |
| 454 Page::PageClients pageClients; | 456 Page::PageClients pageClients; |
| 455 pageClients.chromeClient = m_chromeClientImpl.get(); | 457 pageClients.chromeClient = m_chromeClientImpl.get(); |
| 456 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 458 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
| 457 pageClients.editorClient = &m_editorClientImpl; | 459 pageClients.editorClient = &m_editorClientImpl; |
| 458 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 460 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
| 459 | 461 |
| 460 m_page = Page::createOrdinary(pageClients); | 462 m_page = Page::createOrdinary(pageClients); |
| 461 MediaKeysController::provideMediaKeysTo(*m_page, &m_mediaKeysClientImpl); | 463 MediaKeysController::provideMediaKeysTo(*m_page, &m_mediaKeysClientImpl); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 case WebInputEvent::GestureFlingStart: { | 733 case WebInputEvent::GestureFlingStart: { |
| 732 if (mainFrameImpl()->frame()->eventHandler().isScrollbarHandlingGestures
()) | 734 if (mainFrameImpl()->frame()->eventHandler().isScrollbarHandlingGestures
()) |
| 733 break; | 735 break; |
| 734 endActiveFlingAnimation(); | 736 endActiveFlingAnimation(); |
| 735 m_client->cancelScheduledContentIntents(); | 737 m_client->cancelScheduledContentIntents(); |
| 736 m_positionOnFlingStart = WebPoint(event.x, event.y); | 738 m_positionOnFlingStart = WebPoint(event.x, event.y); |
| 737 m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY); | 739 m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY); |
| 738 m_flingModifier = event.modifiers; | 740 m_flingModifier = event.modifiers; |
| 739 m_flingSourceDevice = event.sourceDevice; | 741 m_flingSourceDevice = event.sourceDevice; |
| 740 DCHECK_NE(m_flingSourceDevice, WebGestureDeviceUninitialized); | 742 DCHECK_NE(m_flingSourceDevice, WebGestureDeviceUninitialized); |
| 741 OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->creat
eFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.vel
ocityX, event.data.flingStart.velocityY), WebSize())); | 743 std::unique_ptr<WebGestureCurve> flingCurve = wrapUnique(Platform::curre
nt()->createFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.fli
ngStart.velocityX, event.data.flingStart.velocityY), WebSize())); |
| 742 DCHECK(flingCurve); | 744 DCHECK(flingCurve); |
| 743 m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(s
td::move(flingCurve), this); | 745 m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(s
td::move(flingCurve), this); |
| 744 scheduleAnimation(); | 746 scheduleAnimation(); |
| 745 eventResult = WebInputEventResult::HandledSystem; | 747 eventResult = WebInputEventResult::HandledSystem; |
| 746 | 748 |
| 747 // Plugins may need to see GestureFlingStart to balance | 749 // Plugins may need to see GestureFlingStart to balance |
| 748 // GestureScrollBegin (since the former replaces GestureScrollEnd when | 750 // GestureScrollBegin (since the former replaces GestureScrollEnd when |
| 749 // transitioning to a fling). | 751 // transitioning to a fling). |
| 750 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(),
event); | 752 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(),
event); |
| 751 // TODO(dtapuska): Why isn't the response used? | 753 // TODO(dtapuska): Why isn't the response used? |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 return handleInputEvent(wheelEvent); | 954 return handleInputEvent(wheelEvent); |
| 953 } | 955 } |
| 954 | 956 |
| 955 void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar
ameters& parameters) | 957 void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar
ameters& parameters) |
| 956 { | 958 { |
| 957 TRACE_EVENT0("blink", "WebViewImpl::transferActiveWheelFlingAnimation"); | 959 TRACE_EVENT0("blink", "WebViewImpl::transferActiveWheelFlingAnimation"); |
| 958 DCHECK(!m_gestureAnimation); | 960 DCHECK(!m_gestureAnimation); |
| 959 m_positionOnFlingStart = parameters.point; | 961 m_positionOnFlingStart = parameters.point; |
| 960 m_globalPositionOnFlingStart = parameters.globalPoint; | 962 m_globalPositionOnFlingStart = parameters.globalPoint; |
| 961 m_flingModifier = parameters.modifiers; | 963 m_flingModifier = parameters.modifiers; |
| 962 OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAni
mationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters
.cumulativeScroll)); | 964 std::unique_ptr<WebGestureCurve> curve = wrapUnique(Platform::current()->cre
ateFlingAnimationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta),
parameters.cumulativeScroll)); |
| 963 DCHECK(curve); | 965 DCHECK(curve); |
| 964 m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(std::mo
ve(curve), this, parameters.startTime); | 966 m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(std::mo
ve(curve), this, parameters.startTime); |
| 965 DCHECK_NE(parameters.sourceDevice, WebGestureDeviceUninitialized); | 967 DCHECK_NE(parameters.sourceDevice, WebGestureDeviceUninitialized); |
| 966 m_flingSourceDevice = parameters.sourceDevice; | 968 m_flingSourceDevice = parameters.sourceDevice; |
| 967 scheduleAnimation(); | 969 scheduleAnimation(); |
| 968 } | 970 } |
| 969 | 971 |
| 970 bool WebViewImpl::endActiveFlingAnimation() | 972 bool WebViewImpl::endActiveFlingAnimation() |
| 971 { | 973 { |
| 972 if (m_gestureAnimation) { | 974 if (m_gestureAnimation) { |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2183 | 2185 |
| 2184 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type))
{ | 2186 if (m_mouseCaptureNode && WebInputEvent::isMouseEventType(inputEvent.type))
{ |
| 2185 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type); | 2187 TRACE_EVENT1("input", "captured mouse event", "type", inputEvent.type); |
| 2186 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. | 2188 // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. |
| 2187 Node* node = m_mouseCaptureNode; | 2189 Node* node = m_mouseCaptureNode; |
| 2188 | 2190 |
| 2189 // Not all platforms call mouseCaptureLost() directly. | 2191 // Not all platforms call mouseCaptureLost() directly. |
| 2190 if (inputEvent.type == WebInputEvent::MouseUp) | 2192 if (inputEvent.type == WebInputEvent::MouseUp) |
| 2191 mouseCaptureLost(); | 2193 mouseCaptureLost(); |
| 2192 | 2194 |
| 2193 OwnPtr<UserGestureIndicator> gestureIndicator; | 2195 std::unique_ptr<UserGestureIndicator> gestureIndicator; |
| 2194 | 2196 |
| 2195 AtomicString eventType; | 2197 AtomicString eventType; |
| 2196 switch (inputEvent.type) { | 2198 switch (inputEvent.type) { |
| 2197 case WebInputEvent::MouseMove: | 2199 case WebInputEvent::MouseMove: |
| 2198 eventType = EventTypeNames::mousemove; | 2200 eventType = EventTypeNames::mousemove; |
| 2199 break; | 2201 break; |
| 2200 case WebInputEvent::MouseLeave: | 2202 case WebInputEvent::MouseLeave: |
| 2201 eventType = EventTypeNames::mouseout; | 2203 eventType = EventTypeNames::mouseout; |
| 2202 break; | 2204 break; |
| 2203 case WebInputEvent::MouseDown: | 2205 case WebInputEvent::MouseDown: |
| 2204 eventType = EventTypeNames::mousedown; | 2206 eventType = EventTypeNames::mousedown; |
| 2205 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProce
ssingNewUserGesture)); | 2207 gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyPro
cessingNewUserGesture)); |
| 2206 m_mouseCaptureGestureToken = gestureIndicator->currentToken(); | 2208 m_mouseCaptureGestureToken = gestureIndicator->currentToken(); |
| 2207 break; | 2209 break; |
| 2208 case WebInputEvent::MouseUp: | 2210 case WebInputEvent::MouseUp: |
| 2209 eventType = EventTypeNames::mouseup; | 2211 eventType = EventTypeNames::mouseup; |
| 2210 gestureIndicator = adoptPtr(new UserGestureIndicator(m_mouseCaptureG
estureToken.release())); | 2212 gestureIndicator = wrapUnique(new UserGestureIndicator(m_mouseCaptur
eGestureToken.release())); |
| 2211 break; | 2213 break; |
| 2212 default: | 2214 default: |
| 2213 NOTREACHED(); | 2215 NOTREACHED(); |
| 2214 } | 2216 } |
| 2215 | 2217 |
| 2216 node->dispatchMouseEvent( | 2218 node->dispatchMouseEvent( |
| 2217 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast<
const WebMouseEvent&>(inputEvent)), | 2219 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), static_cast<
const WebMouseEvent&>(inputEvent)), |
| 2218 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; | 2220 eventType, static_cast<const WebMouseEvent&>(inputEvent).clickCount)
; |
| 2219 return WebInputEventResult::HandledSystem; | 2221 return WebInputEventResult::HandledSystem; |
| 2220 } | 2222 } |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2830 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent); | 2832 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent); |
| 2831 if (hasPotentialPerformanceRegression) | 2833 if (hasPotentialPerformanceRegression) |
| 2832 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform
anceRegression); | 2834 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform
anceRegression); |
| 2833 } | 2835 } |
| 2834 | 2836 |
| 2835 // WebView -------------------------------------------------------------------- | 2837 // WebView -------------------------------------------------------------------- |
| 2836 | 2838 |
| 2837 WebSettingsImpl* WebViewImpl::settingsImpl() | 2839 WebSettingsImpl* WebViewImpl::settingsImpl() |
| 2838 { | 2840 { |
| 2839 if (!m_webSettings) | 2841 if (!m_webSettings) |
| 2840 m_webSettings = adoptPtr(new WebSettingsImpl(&m_page->settings(), m_devT
oolsEmulator.get())); | 2842 m_webSettings = wrapUnique(new WebSettingsImpl(&m_page->settings(), m_de
vToolsEmulator.get())); |
| 2841 DCHECK(m_webSettings); | 2843 DCHECK(m_webSettings); |
| 2842 return m_webSettings.get(); | 2844 return m_webSettings.get(); |
| 2843 } | 2845 } |
| 2844 | 2846 |
| 2845 WebSettings* WebViewImpl::settings() | 2847 WebSettings* WebViewImpl::settings() |
| 2846 { | 2848 { |
| 2847 return settingsImpl(); | 2849 return settingsImpl(); |
| 2848 } | 2850 } |
| 2849 | 2851 |
| 2850 WebString WebViewImpl::pageEncoding() const | 2852 WebString WebViewImpl::pageEncoding() const |
| (...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4467 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<
int>(visibilityState)), isInitialState); | 4469 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<
int>(visibilityState)), isInitialState); |
| 4468 | 4470 |
| 4469 bool visible = visibilityState == WebPageVisibilityStateVisible; | 4471 bool visible = visibilityState == WebPageVisibilityStateVisible; |
| 4470 if (m_layerTreeView) | 4472 if (m_layerTreeView) |
| 4471 m_layerTreeView->setVisible(visible); | 4473 m_layerTreeView->setVisible(visible); |
| 4472 m_scheduler->setPageVisible(visible); | 4474 m_scheduler->setPageVisible(visible); |
| 4473 } | 4475 } |
| 4474 | 4476 |
| 4475 void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event) | 4477 void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event) |
| 4476 { | 4478 { |
| 4477 OwnPtr<UserGestureIndicator> gestureIndicator; | 4479 std::unique_ptr<UserGestureIndicator> gestureIndicator; |
| 4478 AtomicString eventType; | 4480 AtomicString eventType; |
| 4479 switch (event.type) { | 4481 switch (event.type) { |
| 4480 case WebInputEvent::MouseDown: | 4482 case WebInputEvent::MouseDown: |
| 4481 eventType = EventTypeNames::mousedown; | 4483 eventType = EventTypeNames::mousedown; |
| 4482 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin
gNewUserGesture)); | 4484 gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProcess
ingNewUserGesture)); |
| 4483 m_pointerLockGestureToken = gestureIndicator->currentToken(); | 4485 m_pointerLockGestureToken = gestureIndicator->currentToken(); |
| 4484 break; | 4486 break; |
| 4485 case WebInputEvent::MouseUp: | 4487 case WebInputEvent::MouseUp: |
| 4486 eventType = EventTypeNames::mouseup; | 4488 eventType = EventTypeNames::mouseup; |
| 4487 gestureIndicator = adoptPtr(new UserGestureIndicator(m_pointerLockGestur
eToken.release())); | 4489 gestureIndicator = wrapUnique(new UserGestureIndicator(m_pointerLockGest
ureToken.release())); |
| 4488 break; | 4490 break; |
| 4489 case WebInputEvent::MouseMove: | 4491 case WebInputEvent::MouseMove: |
| 4490 eventType = EventTypeNames::mousemove; | 4492 eventType = EventTypeNames::mousemove; |
| 4491 break; | 4493 break; |
| 4492 default: | 4494 default: |
| 4493 NOTREACHED(); | 4495 NOTREACHED(); |
| 4494 } | 4496 } |
| 4495 | 4497 |
| 4496 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); | 4498 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); |
| 4497 | 4499 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4566 { | 4568 { |
| 4567 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4569 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4568 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4570 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4569 if (!page()) | 4571 if (!page()) |
| 4570 return 1; | 4572 return 1; |
| 4571 | 4573 |
| 4572 return page()->deviceScaleFactor(); | 4574 return page()->deviceScaleFactor(); |
| 4573 } | 4575 } |
| 4574 | 4576 |
| 4575 } // namespace blink | 4577 } // namespace blink |
| OLD | NEW |