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

Side by Side Diff: components/exo/pointer.cc

Issue 2572963002: exo: Produce an error if stylus delegate is already associated. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « components/exo/pointer.h ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/pointer.h" 5 #include "components/exo/pointer.h"
6 6
7 #include "ash/public/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "components/exo/pointer_delegate.h" 8 #include "components/exo/pointer_delegate.h"
9 #include "components/exo/pointer_stylus_delegate.h" 9 #include "components/exo/pointer_stylus_delegate.h"
10 #include "components/exo/surface.h" 10 #include "components/exo/surface.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 // Update cursor in case the registration of pointer as cursor provider 117 // Update cursor in case the registration of pointer as cursor provider
118 // caused the cursor to change. 118 // caused the cursor to change.
119 aura::client::CursorClient* cursor_client = 119 aura::client::CursorClient* cursor_client =
120 aura::client::GetCursorClient(focus_->window()->GetRootWindow()); 120 aura::client::GetCursorClient(focus_->window()->GetRootWindow());
121 if (cursor_client) 121 if (cursor_client)
122 cursor_client->SetCursor( 122 cursor_client->SetCursor(
123 focus_->window()->GetCursor(gfx::ToFlooredPoint(location_))); 123 focus_->window()->GetCursor(gfx::ToFlooredPoint(location_)));
124 } 124 }
125 125
126 bool Pointer::HasStylusDelegate() const {
127 return !!stylus_delegate_;
128 }
129
126 void Pointer::SetStylusDelegate(PointerStylusDelegate* delegate) { 130 void Pointer::SetStylusDelegate(PointerStylusDelegate* delegate) {
127 stylus_delegate_ = delegate; 131 stylus_delegate_ = delegate;
128 } 132 }
129 133
130 //////////////////////////////////////////////////////////////////////////////// 134 ////////////////////////////////////////////////////////////////////////////////
131 // ui::EventHandler overrides: 135 // ui::EventHandler overrides:
132 136
133 void Pointer::OnMouseEvent(ui::MouseEvent* event) { 137 void Pointer::OnMouseEvent(ui::MouseEvent* event) {
134 Surface* target = GetEffectiveTargetForEvent(event); 138 Surface* target = GetEffectiveTargetForEvent(event);
135 139
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 373
370 if (ui_scale != cursor_scale_) { 374 if (ui_scale != cursor_scale_) {
371 gfx::Transform transform; 375 gfx::Transform transform;
372 transform.Scale(ui_scale, ui_scale); 376 transform.Scale(ui_scale, ui_scale);
373 widget_->GetNativeWindow()->SetTransform(transform); 377 widget_->GetNativeWindow()->SetTransform(transform);
374 cursor_scale_ = ui_scale; 378 cursor_scale_ = ui_scale;
375 } 379 }
376 } 380 }
377 381
378 } // namespace exo 382 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/pointer.h ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698