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

Unified Diff: content/browser/pointer_lock_browsertest_mac.mm

Issue 2768263005: Fix PointerLockBrowserTest on Mac. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/pointer_lock_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/pointer_lock_browsertest_mac.mm
diff --git a/content/browser/pointer_lock_browsertest_mac.mm b/content/browser/pointer_lock_browsertest_mac.mm
index a8b334ca4a62d9d021857eb8dce490464a6debe3..26adc174a328d70a06e1f6f009c2db10fd081cb3 100644
--- a/content/browser/pointer_lock_browsertest_mac.mm
+++ b/content/browser/pointer_lock_browsertest_mac.mm
@@ -15,8 +15,7 @@ namespace {
class MockRenderWidgetHostView : public RenderWidgetHostViewMac {
public:
MockRenderWidgetHostView(RenderWidgetHost* host, bool is_guest_view_hack)
- : RenderWidgetHostViewMac(host, is_guest_view_hack),
- host_(RenderWidgetHostImpl::From(host)) {}
+ : RenderWidgetHostViewMac(host, is_guest_view_hack) {}
~MockRenderWidgetHostView() override {
if (mouse_locked_)
UnlockMouse();
@@ -29,15 +28,16 @@ class MockRenderWidgetHostView : public RenderWidgetHostViewMac {
}
void UnlockMouse() override {
- host_->LostMouseLock();
+ if (RenderWidgetHostImpl* host =
+ RenderWidgetHostImpl::From(GetRenderWidgetHost())) {
+ host->LostMouseLock();
+ }
mouse_locked_ = false;
}
bool IsMouseLocked() override { return mouse_locked_; }
bool HasFocus() const override { return true; }
-
- RenderWidgetHostImpl* host_;
};
} // namespace
« no previous file with comments | « content/browser/pointer_lock_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698