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