OLD | NEW |
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/workspace/multi_window_resize_controller.h" | 5 #include "ash/wm/workspace/multi_window_resize_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/root_window_event_filter.h" | 9 #include "ash/wm/root_window_event_filter.h" |
10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 resize_widget_->GetNativeWindow(), | 366 resize_widget_->GetNativeWindow(), |
367 WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); | 367 WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); |
368 resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController"); | 368 resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController"); |
369 resize_widget_->SetContentsView(view); | 369 resize_widget_->SetContentsView(view); |
370 show_bounds_ = CalculateResizeWidgetBounds(show_location_); | 370 show_bounds_ = CalculateResizeWidgetBounds(show_location_); |
371 resize_widget_->SetBounds(show_bounds_); | 371 resize_widget_->SetBounds(show_bounds_); |
372 resize_widget_->Show(); | 372 resize_widget_->Show(); |
373 mouse_watcher_.reset(new views::MouseWatcher( | 373 mouse_watcher_.reset(new views::MouseWatcher( |
374 new ResizeMouseWatcherHost(this), | 374 new ResizeMouseWatcherHost(this), |
375 this)); | 375 this)); |
376 mouse_watcher_->set_notify_on_exit_time_ms(kHideDelayMS); | 376 mouse_watcher_->set_notify_on_exit_time( |
| 377 base::TimeDelta::FromMilliseconds(kHideDelayMS)); |
377 mouse_watcher_->Start(); | 378 mouse_watcher_->Start(); |
378 } | 379 } |
379 | 380 |
380 bool MultiWindowResizeController::IsShowing() const { | 381 bool MultiWindowResizeController::IsShowing() const { |
381 return resize_widget_ || show_timer_.IsRunning(); | 382 return resize_widget_ || show_timer_.IsRunning(); |
382 } | 383 } |
383 | 384 |
384 void MultiWindowResizeController::StartResize( | 385 void MultiWindowResizeController::StartResize( |
385 const gfx::Point& screen_location) { | 386 const gfx::Point& screen_location) { |
386 DCHECK(!window_resizer_.get()); | 387 DCHECK(!window_resizer_.get()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 489 |
489 gfx::Point window_loc(screen_location); | 490 gfx::Point window_loc(screen_location); |
490 aura::Window::ConvertPointToWindow( | 491 aura::Window::ConvertPointToWindow( |
491 window->GetRootWindow(), window, &window_loc); | 492 window->GetRootWindow(), window, &window_loc); |
492 return window->HitTest(window_loc) && | 493 return window->HitTest(window_loc) && |
493 window->delegate()->GetNonClientComponent(window_loc) == component; | 494 window->delegate()->GetNonClientComponent(window_loc) == component; |
494 } | 495 } |
495 | 496 |
496 } // namespace internal | 497 } // namespace internal |
497 } // namespace ash | 498 } // namespace ash |
OLD | NEW |