| 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/partial_screenshot_view.h" | 5 #include "ash/wm/partial_screenshot_view.h" |
| 6 | 6 |
| 7 #include "ash/screenshot_delegate.h" | 7 #include "ash/screenshot_delegate.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/overlay_event_filter.h" | 10 #include "ash/wm/overlay_event_filter.h" |
| 11 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 12 #include "ui/base/cursor/cursor.h" | 12 #include "ui/base/cursor/cursor.h" |
| 13 #include "ui/base/event.h" | 13 #include "ui/base/events/event.h" |
| 14 #include "ui/gfx/canvas.h" | 14 #include "ui/gfx/canvas.h" |
| 15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 16 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
| 17 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
| 18 | 18 |
| 19 namespace ash { | 19 namespace ash { |
| 20 | 20 |
| 21 PartialScreenshotView::PartialScreenshotView( | 21 PartialScreenshotView::PartialScreenshotView( |
| 22 ScreenshotDelegate* screenshot_delegate) | 22 ScreenshotDelegate* screenshot_delegate) |
| 23 : is_dragging_(false), | 23 : is_dragging_(false), |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 gfx::Rect PartialScreenshotView::GetScreenshotRect() const { | 129 gfx::Rect PartialScreenshotView::GetScreenshotRect() const { |
| 130 int left = std::min(start_position_.x(), current_position_.x()); | 130 int left = std::min(start_position_.x(), current_position_.x()); |
| 131 int top = std::min(start_position_.y(), current_position_.y()); | 131 int top = std::min(start_position_.y(), current_position_.y()); |
| 132 int width = ::abs(start_position_.x() - current_position_.x()); | 132 int width = ::abs(start_position_.x() - current_position_.x()); |
| 133 int height = ::abs(start_position_.y() - current_position_.y()); | 133 int height = ::abs(start_position_.y() - current_position_.y()); |
| 134 return gfx::Rect(left, top, width, height); | 134 return gfx::Rect(left, top, width, height); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace ash | 137 } // namespace ash |
| OLD | NEW |