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

Unified Diff: trunk/src/ui/wm/core/cursor_manager.cc

Issue 233693002: Revert 263043 "Remove obsolete scale related APIs for cursor" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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 | « trunk/src/ui/wm/core/cursor_manager.h ('k') | trunk/src/ui/wm/core/native_cursor_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/wm/core/cursor_manager.cc
===================================================================
--- trunk/src/ui/wm/core/cursor_manager.cc (revision 263047)
+++ trunk/src/ui/wm/core/cursor_manager.cc (working copy)
@@ -21,6 +21,7 @@
CursorState()
: cursor_(ui::kCursorNone),
visible_(true),
+ scale_(1.f),
cursor_set_(ui::CURSOR_SET_NORMAL),
mouse_events_enabled_(true),
visible_on_mouse_events_enabled_(true) {
@@ -36,6 +37,11 @@
// Ignores the call when mouse events disabled.
}
+ float scale() const { return scale_; }
+ void set_scale(float scale) {
+ scale_ = scale;
+ }
+
ui::CursorSetType cursor_set() const { return cursor_set_; }
void set_cursor_set(ui::CursorSetType cursor_set) {
cursor_set_ = cursor_set;
@@ -59,6 +65,7 @@
private:
gfx::NativeCursor cursor_;
bool visible_;
+ float scale_;
ui::CursorSetType cursor_set_;
bool mouse_events_enabled_;
@@ -116,6 +123,16 @@
return current_state_->visible();
}
+void CursorManager::SetScale(float scale) {
+ state_on_unlock_->set_scale(scale);
+ if (GetScale() != state_on_unlock_->scale())
+ delegate_->SetScale(state_on_unlock_->scale(), this);
+}
+
+float CursorManager::GetScale() const {
+ return current_state_->scale();
+}
+
void CursorManager::SetCursorSet(ui::CursorSetType cursor_set) {
state_on_unlock_->set_cursor_set(cursor_set);
if (GetCursorSet() != state_on_unlock_->cursor_set())
@@ -206,6 +223,10 @@
current_state_->SetVisible(visible);
}
+void CursorManager::CommitScale(float scale) {
+ current_state_->set_scale(scale);
+}
+
void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) {
current_state_->set_cursor_set(cursor_set);
}
« no previous file with comments | « trunk/src/ui/wm/core/cursor_manager.h ('k') | trunk/src/ui/wm/core/native_cursor_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698