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

Side by Side Diff: content/renderer/render_widget_fullscreen_pepper.cc

Issue 2915613004: [PointerLock] Move "silent mouse lock" logic from renderer to RWHI (Closed)
Patch Set: jochen's comment: Remove 'const' before local bool Created 3 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/render_widget_fullscreen_pepper.h" 5 #include "content/renderer/render_widget_fullscreen_pepper.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 namespace { 51 namespace {
52 52
53 class FullscreenMouseLockDispatcher : public MouseLockDispatcher { 53 class FullscreenMouseLockDispatcher : public MouseLockDispatcher {
54 public: 54 public:
55 explicit FullscreenMouseLockDispatcher(RenderWidgetFullscreenPepper* widget); 55 explicit FullscreenMouseLockDispatcher(RenderWidgetFullscreenPepper* widget);
56 ~FullscreenMouseLockDispatcher() override; 56 ~FullscreenMouseLockDispatcher() override;
57 57
58 private: 58 private:
59 // MouseLockDispatcher implementation. 59 // MouseLockDispatcher implementation.
60 void SendLockMouseRequest(bool unlocked_by_target) override; 60 void SendLockMouseRequest() override;
61 void SendUnlockMouseRequest() override; 61 void SendUnlockMouseRequest() override;
62 62
63 RenderWidgetFullscreenPepper* widget_; 63 RenderWidgetFullscreenPepper* widget_;
64 64
65 DISALLOW_COPY_AND_ASSIGN(FullscreenMouseLockDispatcher); 65 DISALLOW_COPY_AND_ASSIGN(FullscreenMouseLockDispatcher);
66 }; 66 };
67 67
68 WebMouseEvent WebMouseEventFromGestureEvent(const WebGestureEvent& gesture) { 68 WebMouseEvent WebMouseEventFromGestureEvent(const WebGestureEvent& gesture) {
69 69
70 // Only convert touch screen gesture events, do not convert 70 // Only convert touch screen gesture events, do not convert
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return mouse; 107 return mouse;
108 } 108 }
109 109
110 FullscreenMouseLockDispatcher::FullscreenMouseLockDispatcher( 110 FullscreenMouseLockDispatcher::FullscreenMouseLockDispatcher(
111 RenderWidgetFullscreenPepper* widget) : widget_(widget) { 111 RenderWidgetFullscreenPepper* widget) : widget_(widget) {
112 } 112 }
113 113
114 FullscreenMouseLockDispatcher::~FullscreenMouseLockDispatcher() { 114 FullscreenMouseLockDispatcher::~FullscreenMouseLockDispatcher() {
115 } 115 }
116 116
117 void FullscreenMouseLockDispatcher::SendLockMouseRequest( 117 void FullscreenMouseLockDispatcher::SendLockMouseRequest() {
118 bool unlocked_by_target) { 118 widget_->Send(new ViewHostMsg_LockMouse(widget_->routing_id(), false, true));
119 widget_->Send(new ViewHostMsg_LockMouse(widget_->routing_id(), false,
120 unlocked_by_target, true));
121 } 119 }
122 120
123 void FullscreenMouseLockDispatcher::SendUnlockMouseRequest() { 121 void FullscreenMouseLockDispatcher::SendUnlockMouseRequest() {
124 widget_->Send(new ViewHostMsg_UnlockMouse(widget_->routing_id())); 122 widget_->Send(new ViewHostMsg_UnlockMouse(widget_->routing_id()));
125 } 123 }
126 124
127 // WebWidget that simply wraps the pepper plugin. 125 // WebWidget that simply wraps the pepper plugin.
128 // TODO(piman): figure out IME and implement setComposition and friends if 126 // TODO(piman): figure out IME and implement setComposition and friends if
129 // necessary. 127 // necessary.
130 class PepperWidget : public WebWidget { 128 class PepperWidget : public WebWidget {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() { 372 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() {
375 return active_url_; 373 return active_url_;
376 } 374 }
377 375
378 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() { 376 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() {
379 if (compositor_) 377 if (compositor_)
380 compositor_->SetDeviceScaleFactor(device_scale_factor_); 378 compositor_->SetDeviceScaleFactor(device_scale_factor_);
381 } 379 }
382 380
383 } // namespace content 381 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mouse_lock_dispatcher.cc ('k') | content/renderer/render_widget_mouse_lock_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698