Chromium Code Reviews

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

Issue 2769823002: Add decode() functionality to image elements. (Closed)
Patch Set: update Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "web/WebFrameWidgetBase.h" 5 #include "web/WebFrameWidgetBase.h"
6 6
7 #include "core/dom/DocumentUserGestureToken.h" 7 #include "core/dom/DocumentUserGestureToken.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/VisualViewport.h" 9 #include "core/frame/VisualViewport.h"
10 #include "core/input/EventHandler.h" 10 #include "core/input/EventHandler.h"
(...skipping 225 matching lines...)
236 236
237 void WebFrameWidgetBase::DidNotAcquirePointerLock() { 237 void WebFrameWidgetBase::DidNotAcquirePointerLock() {
238 GetPage()->GetPointerLockController().DidNotAcquirePointerLock(); 238 GetPage()->GetPointerLockController().DidNotAcquirePointerLock();
239 } 239 }
240 240
241 void WebFrameWidgetBase::DidLosePointerLock() { 241 void WebFrameWidgetBase::DidLosePointerLock() {
242 pointer_lock_gesture_token_.Clear(); 242 pointer_lock_gesture_token_.Clear();
243 GetPage()->GetPointerLockController().DidLosePointerLock(); 243 GetPage()->GetPointerLockController().DidLosePointerLock();
244 } 244 }
245 245
246 void WebFrameWidgetBase::RequestDecode(
247 sk_sp<SkImage> image,
248 std::unique_ptr<WTF::Function<void(bool)>> callback) {
249 View()->RequestDecode(std::move(image), std::move(callback));
250 }
251
246 void WebFrameWidgetBase::PointerLockMouseEvent(const WebInputEvent& event) { 252 void WebFrameWidgetBase::PointerLockMouseEvent(const WebInputEvent& event) {
247 std::unique_ptr<UserGestureIndicator> gesture_indicator; 253 std::unique_ptr<UserGestureIndicator> gesture_indicator;
248 AtomicString event_type; 254 AtomicString event_type;
249 switch (event.GetType()) { 255 switch (event.GetType()) {
250 case WebInputEvent::kMouseDown: 256 case WebInputEvent::kMouseDown:
251 event_type = EventTypeNames::mousedown; 257 event_type = EventTypeNames::mousedown;
252 if (!GetPage() || !GetPage()->GetPointerLockController().GetElement()) 258 if (!GetPage() || !GetPage()->GetPointerLockController().GetElement())
253 break; 259 break;
254 gesture_indicator = WTF::WrapUnique(new UserGestureIndicator( 260 gesture_indicator = WTF::WrapUnique(new UserGestureIndicator(
255 DocumentUserGestureToken::Create(&GetPage() 261 DocumentUserGestureToken::Create(&GetPage()
(...skipping 19 matching lines...)
275 281
276 if (GetPage()) { 282 if (GetPage()) {
277 WebMouseEvent transformed_event = TransformWebMouseEvent( 283 WebMouseEvent transformed_event = TransformWebMouseEvent(
278 ToWebLocalFrameImpl(LocalRoot())->GetFrameView(), mouse_event); 284 ToWebLocalFrameImpl(LocalRoot())->GetFrameView(), mouse_event);
279 GetPage()->GetPointerLockController().DispatchLockedMouseEvent( 285 GetPage()->GetPointerLockController().DispatchLockedMouseEvent(
280 transformed_event, event_type); 286 transformed_event, event_type);
281 } 287 }
282 } 288 }
283 289
284 } // namespace blink 290 } // namespace blink
OLDNEW

Powered by Google App Engine