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

Side by Side Diff: ui/aura/test/test_cursor_client.cc

Issue 25336003: Use root window's coordinates when updating cursor in Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-specific hack removed Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/test/test_cursor_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/aura/test/test_cursor_client.h" 5 #include "ui/aura/test/test_cursor_client.h"
6 6
7 #include "ui/aura/client/cursor_client_observer.h" 7 #include "ui/aura/client/cursor_client_observer.h"
8 8
9 namespace aura { 9 namespace aura {
10 namespace test { 10 namespace test {
11 11
12 TestCursorClient::TestCursorClient(aura::Window* root_window) 12 TestCursorClient::TestCursorClient(aura::Window* root_window)
13 : visible_(true), 13 : visible_(true),
14 mouse_events_enabled_(true), 14 mouse_events_enabled_(true),
15 cursor_lock_count_(0), 15 cursor_lock_count_(0),
16 calls_to_set_cursor_(0),
16 root_window_(root_window) { 17 root_window_(root_window) {
17 client::SetCursorClient(root_window, this); 18 client::SetCursorClient(root_window, this);
18 } 19 }
19 20
20 TestCursorClient::~TestCursorClient() { 21 TestCursorClient::~TestCursorClient() {
21 client::SetCursorClient(root_window_, NULL); 22 client::SetCursorClient(root_window_, NULL);
22 } 23 }
23 24
24 void TestCursorClient::SetCursor(gfx::NativeCursor cursor) { 25 void TestCursorClient::SetCursor(gfx::NativeCursor cursor) {
26 calls_to_set_cursor_++;
25 } 27 }
26 28
27 gfx::NativeCursor TestCursorClient::GetCursor() const { 29 gfx::NativeCursor TestCursorClient::GetCursor() const {
28 return ui::kCursorNull; 30 return ui::kCursorNull;
29 } 31 }
30 32
31 void TestCursorClient::ShowCursor() { 33 void TestCursorClient::ShowCursor() {
32 visible_ = true; 34 visible_ = true;
33 FOR_EACH_OBSERVER(aura::client::CursorClientObserver, observers_, 35 FOR_EACH_OBSERVER(aura::client::CursorClientObserver, observers_,
34 OnCursorVisibilityChanged(true)); 36 OnCursorVisibilityChanged(true));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 observers_.AddObserver(observer); 94 observers_.AddObserver(observer);
93 } 95 }
94 96
95 void TestCursorClient::RemoveObserver( 97 void TestCursorClient::RemoveObserver(
96 aura::client::CursorClientObserver* observer) { 98 aura::client::CursorClientObserver* observer) {
97 observers_.RemoveObserver(observer); 99 observers_.RemoveObserver(observer);
98 } 100 }
99 101
100 } // namespace test 102 } // namespace test
101 } // namespace aura 103 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/test_cursor_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698