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_ash.h" | 7 #include "ash/screen_ash.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/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 image_ = rb.GetImageNamed(image_id).ToImageSkia(); | 72 image_ = rb.GetImageNamed(image_id).ToImageSkia(); |
73 } | 73 } |
74 | 74 |
75 // views::View overrides: | 75 // views::View overrides: |
76 virtual gfx::Size GetPreferredSize() OVERRIDE { | 76 virtual gfx::Size GetPreferredSize() OVERRIDE { |
77 return gfx::Size(image_->width(), image_->height()); | 77 return gfx::Size(image_->width(), image_->height()); |
78 } | 78 } |
79 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 79 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
80 canvas->DrawImageInt(*image_, 0, 0); | 80 canvas->DrawImageInt(*image_, 0, 0); |
81 } | 81 } |
82 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE { | 82 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { |
83 gfx::Point location(event.location()); | 83 gfx::Point location(event.location()); |
84 views::View::ConvertPointToScreen(this, &location); | 84 views::View::ConvertPointToScreen(this, &location); |
85 controller_->StartResize(location); | 85 controller_->StartResize(location); |
86 return true; | 86 return true; |
87 } | 87 } |
88 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE { | 88 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE { |
89 gfx::Point location(event.location()); | 89 gfx::Point location(event.location()); |
90 views::View::ConvertPointToScreen(this, &location); | 90 views::View::ConvertPointToScreen(this, &location); |
91 controller_->Resize(location, event.flags()); | 91 controller_->Resize(location, event.flags()); |
92 return true; | 92 return true; |
93 } | 93 } |
94 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE { | 94 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE { |
95 controller_->CompleteResize(event.flags()); | 95 controller_->CompleteResize(event.flags()); |
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 views::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 aura::shared::CompoundEventFilter::CursorForWindowComponent( | 103 return aura::shared::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 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 506 |
507 gfx::Point window_loc(location_in_screen); | 507 gfx::Point window_loc(location_in_screen); |
508 aura::Window::ConvertPointToTarget( | 508 aura::Window::ConvertPointToTarget( |
509 window->GetRootWindow(), window, &window_loc); | 509 window->GetRootWindow(), window, &window_loc); |
510 return window->HitTest(window_loc) && | 510 return window->HitTest(window_loc) && |
511 window->delegate()->GetNonClientComponent(window_loc) == component; | 511 window->delegate()->GetNonClientComponent(window_loc) == component; |
512 } | 512 } |
513 | 513 |
514 } // namespace internal | 514 } // namespace internal |
515 } // namespace ash | 515 } // namespace ash |
OLD | NEW |