OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/widget/root_view.h" | 5 #include "views/widget/root_view.h" |
6 | 6 |
7 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
8 #include "app/gfx/canvas_paint.h" | |
9 #include "app/os_exchange_data.h" | 8 #include "app/os_exchange_data.h" |
10 #include "app/os_exchange_data_provider_win.h" | 9 #include "app/os_exchange_data_provider_win.h" |
11 #include "base/base_drag_source.h" | 10 #include "base/base_drag_source.h" |
12 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "gfx/canvas_paint.h" |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 void RootView::OnPaint(HWND hwnd) { | 16 void RootView::OnPaint(HWND hwnd) { |
17 gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize(); | 17 gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize(); |
18 if (!original_dirty_region.IsEmpty()) { | 18 if (!original_dirty_region.IsEmpty()) { |
19 // Invoke InvalidateRect so that the dirty region of the window includes the | 19 // Invoke InvalidateRect so that the dirty region of the window includes the |
20 // region we need to paint. If we didn't do this and the region didn't | 20 // region we need to paint. If we didn't do this and the region didn't |
21 // include the dirty region, ProcessPaint would incorrectly mark everything | 21 // include the dirty region, ProcessPaint would incorrectly mark everything |
22 // as clean. This can happen if a WM_PAINT is generated by the system before | 22 // as clean. This can happen if a WM_PAINT is generated by the system before |
(...skipping 23 matching lines...) Expand all Loading... |
46 // If the view is removed during the drag operation, drag_view_ is set to | 46 // If the view is removed during the drag operation, drag_view_ is set to |
47 // NULL. | 47 // NULL. |
48 if (view && drag_view_ == view) { | 48 if (view && drag_view_ == view) { |
49 View* drag_view = drag_view_; | 49 View* drag_view = drag_view_; |
50 drag_view_ = NULL; | 50 drag_view_ = NULL; |
51 drag_view->OnDragDone(); | 51 drag_view->OnDragDone(); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 } | 55 } |
OLD | NEW |