| 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/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE { | 94 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE { |
| 95 controller_->CompleteResize(); | 95 controller_->CompleteResize(); |
| 96 } | 96 } |
| 97 virtual void OnMouseCaptureLost() OVERRIDE { | 97 virtual void OnMouseCaptureLost() OVERRIDE { |
| 98 controller_->CancelResize(); | 98 controller_->CancelResize(); |
| 99 } | 99 } |
| 100 virtual gfx::NativeCursor GetCursor( | 100 virtual gfx::NativeCursor GetCursor( |
| 101 const ui::MouseEvent& event) OVERRIDE { | 101 const ui::MouseEvent& event) OVERRIDE { |
| 102 int component = (direction_ == LEFT_RIGHT) ? HTRIGHT : HTBOTTOM; | 102 int component = (direction_ == LEFT_RIGHT) ? HTRIGHT : HTBOTTOM; |
| 103 return views::corewm::CompoundEventFilter::CursorForWindowComponent( | 103 return ::wm::CompoundEventFilter::CursorForWindowComponent( |
| 104 component); | 104 component); |
| 105 } | 105 } |
| 106 | 106 |
| 107 private: | 107 private: |
| 108 MultiWindowResizeController* controller_; | 108 MultiWindowResizeController* controller_; |
| 109 const Direction direction_; | 109 const Direction direction_; |
| 110 const gfx::ImageSkia* image_; | 110 const gfx::ImageSkia* image_; |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(ResizeView); | 112 DISALLOW_COPY_AND_ASSIGN(ResizeView); |
| 113 }; | 113 }; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 386 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 387 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 387 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 388 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 388 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 389 params.parent = Shell::GetContainer( | 389 params.parent = Shell::GetContainer( |
| 390 Shell::GetTargetRootWindow(), | 390 Shell::GetTargetRootWindow(), |
| 391 internal::kShellWindowId_AlwaysOnTopContainer); | 391 internal::kShellWindowId_AlwaysOnTopContainer); |
| 392 params.can_activate = false; | 392 params.can_activate = false; |
| 393 ResizeView* view = new ResizeView(this, windows_.direction); | 393 ResizeView* view = new ResizeView(this, windows_.direction); |
| 394 resize_widget_->set_focus_on_creation(false); | 394 resize_widget_->set_focus_on_creation(false); |
| 395 resize_widget_->Init(params); | 395 resize_widget_->Init(params); |
| 396 views::corewm::SetWindowVisibilityAnimationType( | 396 ::wm::SetWindowVisibilityAnimationType( |
| 397 resize_widget_->GetNativeWindow(), | 397 resize_widget_->GetNativeWindow(), |
| 398 views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); | 398 ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); |
| 399 resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController"); | 399 resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController"); |
| 400 resize_widget_->SetContentsView(view); | 400 resize_widget_->SetContentsView(view); |
| 401 show_bounds_in_screen_ = ScreenUtil::ConvertRectToScreen( | 401 show_bounds_in_screen_ = ScreenUtil::ConvertRectToScreen( |
| 402 windows_.window1->parent(), | 402 windows_.window1->parent(), |
| 403 CalculateResizeWidgetBounds(show_location_in_parent_)); | 403 CalculateResizeWidgetBounds(show_location_in_parent_)); |
| 404 resize_widget_->SetBounds(show_bounds_in_screen_); | 404 resize_widget_->SetBounds(show_bounds_in_screen_); |
| 405 resize_widget_->Show(); | 405 resize_widget_->Show(); |
| 406 mouse_watcher_.reset(new views::MouseWatcher( | 406 mouse_watcher_.reset(new views::MouseWatcher( |
| 407 new ResizeMouseWatcherHost(this), | 407 new ResizeMouseWatcherHost(this), |
| 408 this)); | 408 this)); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 | 538 |
| 539 gfx::Point window_loc(location_in_screen); | 539 gfx::Point window_loc(location_in_screen); |
| 540 aura::Window::ConvertPointToTarget( | 540 aura::Window::ConvertPointToTarget( |
| 541 window->GetRootWindow(), window, &window_loc); | 541 window->GetRootWindow(), window, &window_loc); |
| 542 return window->ContainsPoint(window_loc) && | 542 return window->ContainsPoint(window_loc) && |
| 543 window->delegate()->GetNonClientComponent(window_loc) == component; | 543 window->delegate()->GetNonClientComponent(window_loc) == component; |
| 544 } | 544 } |
| 545 | 545 |
| 546 } // namespace internal | 546 } // namespace internal |
| 547 } // namespace ash | 547 } // namespace ash |
| OLD | NEW |