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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/display/mouse_cursor_event_filter.h" | 9 #include "ash/display/mouse_cursor_event_filter.h" |
10 #include "ash/screenshot_delegate.h" | 10 #include "ash/screenshot_delegate.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 is_dragging_ = true; | 156 is_dragging_ = true; |
157 } | 157 } |
158 | 158 |
159 void PartialScreenshotView::OnSelectionFinished() { | 159 void PartialScreenshotView::OnSelectionFinished() { |
160 overlay_delegate_->Cancel(); | 160 overlay_delegate_->Cancel(); |
161 if (!is_dragging_) | 161 if (!is_dragging_) |
162 return; | 162 return; |
163 | 163 |
164 is_dragging_ = false; | 164 is_dragging_ = false; |
165 if (screenshot_delegate_) { | 165 if (screenshot_delegate_) { |
166 aura::RootWindow *root_window = | 166 aura::Window*root_window = |
167 GetWidget()->GetNativeWindow()->GetRootWindow(); | 167 GetWidget()->GetNativeWindow()->GetRootWindow(); |
168 screenshot_delegate_->HandleTakePartialScreenshot( | 168 screenshot_delegate_->HandleTakePartialScreenshot( |
169 root_window, | 169 root_window, |
170 gfx::IntersectRects(root_window->bounds(), GetScreenshotRect())); | 170 gfx::IntersectRects(root_window->bounds(), GetScreenshotRect())); |
171 } | 171 } |
172 } | 172 } |
173 | 173 |
174 gfx::NativeCursor PartialScreenshotView::GetCursor( | 174 gfx::NativeCursor PartialScreenshotView::GetCursor( |
175 const ui::MouseEvent& event) { | 175 const ui::MouseEvent& event) { |
176 // Always use "crosshair" cursor. | 176 // Always use "crosshair" cursor. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 OnSelectionFinished(); | 234 OnSelectionFinished(); |
235 break; | 235 break; |
236 default: | 236 default: |
237 break; | 237 break; |
238 } | 238 } |
239 | 239 |
240 event->SetHandled(); | 240 event->SetHandled(); |
241 } | 241 } |
242 | 242 |
243 } // namespace ash | 243 } // namespace ash |
OLD | NEW |