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

Side by Side Diff: ash/wm/session_state_controller_impl2.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: fix win_aura 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
« no previous file with comments | « ash/wm/session_state_controller_impl.cc ('k') | ash/wm/window_manager_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 (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 "ash/wm/session_state_controller_impl2.h" 5 #include "ash/wm/session_state_controller_impl2.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 void SessionStateControllerImpl2::OnAppTerminating() { 164 void SessionStateControllerImpl2::OnAppTerminating() {
165 // If we hear that Chrome is exiting but didn't request it ourselves, all we 165 // If we hear that Chrome is exiting but didn't request it ourselves, all we
166 // can really hope for is that we'll have time to clear the screen. 166 // can really hope for is that we'll have time to clear the screen.
167 // This is also the case when the user signs off. 167 // This is also the case when the user signs off.
168 if (!shutting_down_) { 168 if (!shutting_down_) {
169 shutting_down_ = true; 169 shutting_down_ = true;
170 Shell* shell = ash::Shell::GetInstance(); 170 Shell* shell = ash::Shell::GetInstance();
171 shell->env_filter()->set_cursor_hidden_by_filter(false); 171 shell->env_filter()->set_cursor_hidden_by_filter(false);
172 shell->cursor_manager()->ShowCursor(false); 172 shell->cursor_manager()->DisableMouseEvents();
173 animator_->StartAnimation( 173 animator_->StartAnimation(
174 internal::SessionStateAnimator::kAllContainersMask, 174 internal::SessionStateAnimator::kAllContainersMask,
175 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY, 175 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY,
176 internal::SessionStateAnimator::ANIMATION_SPEED_IMMEDIATE); 176 internal::SessionStateAnimator::ANIMATION_SPEED_IMMEDIATE);
177 } 177 }
178 } 178 }
179 179
180 void SessionStateControllerImpl2::OnLockStateChanged(bool locked) { 180 void SessionStateControllerImpl2::OnLockStateChanged(bool locked) {
181 if (shutting_down_ || (system_is_locked_ == locked)) 181 if (shutting_down_ || (system_is_locked_ == locked))
182 return; 182 return;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (!shutting_down_) 270 if (!shutting_down_)
271 RequestShutdownImpl(); 271 RequestShutdownImpl();
272 } 272 }
273 273
274 void SessionStateControllerImpl2::RequestShutdownImpl() { 274 void SessionStateControllerImpl2::RequestShutdownImpl() {
275 DCHECK(!shutting_down_); 275 DCHECK(!shutting_down_);
276 shutting_down_ = true; 276 shutting_down_ = true;
277 277
278 Shell* shell = ash::Shell::GetInstance(); 278 Shell* shell = ash::Shell::GetInstance();
279 shell->env_filter()->set_cursor_hidden_by_filter(false); 279 shell->env_filter()->set_cursor_hidden_by_filter(false);
280 shell->cursor_manager()->ShowCursor(false); 280 shell->cursor_manager()->DisableMouseEvents();
281 281
282 StartShutdownAnimationImpl(); 282 StartShutdownAnimationImpl();
283 } 283 }
284 284
285 void SessionStateControllerImpl2::OnRootWindowHostCloseRequested( 285 void SessionStateControllerImpl2::OnRootWindowHostCloseRequested(
286 const aura::RootWindow*) { 286 const aura::RootWindow*) {
287 Shell::GetInstance()->delegate()->Exit(); 287 Shell::GetInstance()->delegate()->Exit();
288 } 288 }
289 289
290 void SessionStateControllerImpl2::OnLockFailTimeout() { 290 void SessionStateControllerImpl2::OnLockFailTimeout() {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 GetDuration(internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN), 329 GetDuration(internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN),
330 this, 330 this,
331 &SessionStateControllerImpl2::OnPreShutdownAnimationTimeout); 331 &SessionStateControllerImpl2::OnPreShutdownAnimationTimeout);
332 } 332 }
333 333
334 void SessionStateControllerImpl2::OnPreShutdownAnimationTimeout() { 334 void SessionStateControllerImpl2::OnPreShutdownAnimationTimeout() {
335 shutting_down_ = true; 335 shutting_down_ = true;
336 336
337 Shell* shell = ash::Shell::GetInstance(); 337 Shell* shell = ash::Shell::GetInstance();
338 shell->env_filter()->set_cursor_hidden_by_filter(false); 338 shell->env_filter()->set_cursor_hidden_by_filter(false);
339 shell->cursor_manager()->ShowCursor(false); 339 shell->cursor_manager()->DisableMouseEvents();
340 340
341 StartRealShutdownTimer(false); 341 StartRealShutdownTimer(false);
342 } 342 }
343 343
344 void SessionStateControllerImpl2::StartRealShutdownTimer( 344 void SessionStateControllerImpl2::StartRealShutdownTimer(
345 bool with_animation_time) { 345 bool with_animation_time) {
346 base::TimeDelta duration = 346 base::TimeDelta duration =
347 base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs); 347 base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs);
348 if (with_animation_time) { 348 if (with_animation_time) {
349 duration += animator_->GetDuration( 349 duration += animator_->GetDuration(
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 unlocked_properties_->background_is_hidden) { 604 unlocked_properties_->background_is_hidden) {
605 animator_->StartAnimationWithObserver( 605 animator_->StartAnimationWithObserver(
606 internal::SessionStateAnimator::DESKTOP_BACKGROUND, 606 internal::SessionStateAnimator::DESKTOP_BACKGROUND,
607 internal::SessionStateAnimator::ANIMATION_FADE_OUT, 607 internal::SessionStateAnimator::ANIMATION_FADE_OUT,
608 speed, 608 speed,
609 observer); 609 observer);
610 } 610 }
611 } 611 }
612 612
613 } // namespace ash 613 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/session_state_controller_impl.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698