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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_cursor_client.cc

Issue 11412315: Make the cursor have separate mode for disabled mouse events and invisible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 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
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 "ui/views/widget/desktop_aura/desktop_cursor_client.h" 5 #include "ui/views/widget/desktop_aura/desktop_cursor_client.h"
6 6
7 #include "ui/aura/root_window.h" 7 #include "ui/aura/root_window.h"
8 #include "ui/base/cursor/cursor_loader.h" 8 #include "ui/base/cursor/cursor_loader.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 void DesktopCursorClient::ShowCursor(bool show) { 29 void DesktopCursorClient::ShowCursor(bool show) {
30 if (cursor_visible_ == show) 30 if (cursor_visible_ == show)
31 return; 31 return;
32 cursor_visible_ = show; 32 cursor_visible_ = show;
33 if (cursor_visible_) 33 if (cursor_visible_)
34 root_window_->SetCursor(current_cursor_); 34 root_window_->SetCursor(current_cursor_);
35 else 35 else
36 root_window_->SetCursor(ui::kCursorNone); 36 root_window_->SetCursor(ui::kCursorNone);
37 root_window_->OnCursorVisibilityChanged(cursor_visible_); 37 root_window_->OnCursorEnableStateChanged(cursor_visible_);
38 } 38 }
39 39
40 bool DesktopCursorClient::IsCursorVisible() const { 40 bool DesktopCursorClient::IsCursorVisible() const {
41 return cursor_visible_; 41 return cursor_visible_;
42 } 42 }
43 43
44 void DesktopCursorClient::EnableCursor(bool enabled) {
45 // TODO(mazda): Separete cursor visibility and enable state.
46 ShowCursor(enabled);
47 }
48
44 void DesktopCursorClient::SetDeviceScaleFactor(float device_scale_factor) { 49 void DesktopCursorClient::SetDeviceScaleFactor(float device_scale_factor) {
45 cursor_loader_->UnloadAll(); 50 cursor_loader_->UnloadAll();
46 cursor_loader_->set_device_scale_factor(device_scale_factor); 51 cursor_loader_->set_device_scale_factor(device_scale_factor);
47 } 52 }
48 53
49 void DesktopCursorClient::LockCursor() { 54 void DesktopCursorClient::LockCursor() {
50 // TODO(mazda): Implement this. 55 // TODO(mazda): Implement this.
51 NOTIMPLEMENTED(); 56 NOTIMPLEMENTED();
52 } 57 }
53 58
54 void DesktopCursorClient::UnlockCursor() { 59 void DesktopCursorClient::UnlockCursor() {
55 // TODO(mazda): Implement this. 60 // TODO(mazda): Implement this.
56 NOTIMPLEMENTED(); 61 NOTIMPLEMENTED();
57 } 62 }
58 63
59 } // namespace views 64 } // namespace views
OLDNEW
« ui/aura/root_window.cc ('K') | « ui/views/widget/desktop_aura/desktop_cursor_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698