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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 direction_(direction), | 64 direction_(direction), |
65 image_(NULL) { | 65 image_(NULL) { |
66 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 66 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
67 int image_id = | 67 int image_id = |
68 direction == TOP_BOTTOM ? IDR_AURA_MULTI_WINDOW_RESIZE_H : | 68 direction == TOP_BOTTOM ? IDR_AURA_MULTI_WINDOW_RESIZE_H : |
69 IDR_AURA_MULTI_WINDOW_RESIZE_V; | 69 IDR_AURA_MULTI_WINDOW_RESIZE_V; |
70 image_ = rb.GetImageNamed(image_id).ToImageSkia(); | 70 image_ = rb.GetImageNamed(image_id).ToImageSkia(); |
71 } | 71 } |
72 | 72 |
73 // views::View overrides: | 73 // views::View overrides: |
74 virtual gfx::Size GetPreferredSize() OVERRIDE { | 74 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
75 return gfx::Size(image_->width(), image_->height()); | 75 return gfx::Size(image_->width(), image_->height()); |
76 } | 76 } |
77 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 77 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
78 canvas->DrawImageInt(*image_, 0, 0); | 78 canvas->DrawImageInt(*image_, 0, 0); |
79 } | 79 } |
80 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { | 80 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE { |
81 gfx::Point location(event.location()); | 81 gfx::Point location(event.location()); |
82 views::View::ConvertPointToScreen(this, &location); | 82 views::View::ConvertPointToScreen(this, &location); |
83 controller_->StartResize(location); | 83 controller_->StartResize(location); |
84 return true; | 84 return true; |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 return false; | 533 return false; |
534 | 534 |
535 gfx::Point window_loc(location_in_screen); | 535 gfx::Point window_loc(location_in_screen); |
536 aura::Window::ConvertPointToTarget( | 536 aura::Window::ConvertPointToTarget( |
537 window->GetRootWindow(), window, &window_loc); | 537 window->GetRootWindow(), window, &window_loc); |
538 return window->ContainsPoint(window_loc) && | 538 return window->ContainsPoint(window_loc) && |
539 window->delegate()->GetNonClientComponent(window_loc) == component; | 539 window->delegate()->GetNonClientComponent(window_loc) == component; |
540 } | 540 } |
541 | 541 |
542 } // namespace ash | 542 } // namespace ash |
OLD | NEW |