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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

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

Powered by Google App Engine
This is Rietveld 408576698