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

Side by Side Diff: ash/display/cursor_window_controller.cc

Issue 1137303004: Always update cursor visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/display/cursor_window_controller_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/display/cursor_window_controller.h" 5 #include "ash/display/cursor_window_controller.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/mirror_window_controller.h" 8 #include "ash/display/mirror_window_controller.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 UpdateCursorImage(); 174 UpdateCursorImage();
175 UpdateCursorVisibility(); 175 UpdateCursorVisibility();
176 } 176 }
177 177
178 void CursorWindowController::SetCursorSet(ui::CursorSetType cursor_set) { 178 void CursorWindowController::SetCursorSet(ui::CursorSetType cursor_set) {
179 cursor_set_ = cursor_set; 179 cursor_set_ = cursor_set;
180 UpdateCursorImage(); 180 UpdateCursorImage();
181 } 181 }
182 182
183 void CursorWindowController::SetVisibility(bool visible) { 183 void CursorWindowController::SetVisibility(bool visible) {
184 if (!cursor_window_)
185 return;
186 visible_ = visible; 184 visible_ = visible;
187 UpdateCursorVisibility(); 185 UpdateCursorVisibility();
188 } 186 }
189 187
190 void CursorWindowController::SetContainer(aura::Window* container) { 188 void CursorWindowController::SetContainer(aura::Window* container) {
191 if (container_ == container) 189 if (container_ == container)
192 return; 190 return;
193 container_ = container; 191 container_ = container;
194 if (!container) { 192 if (!container) {
195 cursor_window_.reset(); 193 cursor_window_.reset();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (!cursor_window_) 270 if (!cursor_window_)
273 return; 271 return;
274 bool visible = (visible_ && cursor_type_ != ui::kCursorNone); 272 bool visible = (visible_ && cursor_type_ != ui::kCursorNone);
275 if (visible) 273 if (visible)
276 cursor_window_->Show(); 274 cursor_window_->Show();
277 else 275 else
278 cursor_window_->Hide(); 276 cursor_window_->Hide();
279 } 277 }
280 278
281 } // namespace ash 279 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/cursor_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698