| 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 "chrome/views/widget/root_view.h" | 5 #include "chrome/views/widget/root_view.h" |
| 6 | 6 |
| 7 #include "base/base_drag_source.h" | 7 #include "base/base_drag_source.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/common/gfx/chrome_canvas.h" | 9 #include "chrome/common/gfx/chrome_canvas.h" |
| 10 #include "chrome/common/drag_drop_types.h" | 10 #include "chrome/common/drag_drop_types.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 ChromeCanvasPaint canvas(hwnd); | 43 ChromeCanvasPaint canvas(hwnd); |
| 44 if (!canvas.isEmpty()) { | 44 if (!canvas.isEmpty()) { |
| 45 const PAINTSTRUCT& ps = canvas.paintStruct(); | 45 const PAINTSTRUCT& ps = canvas.paintStruct(); |
| 46 SchedulePaint(gfx::Rect(ps.rcPaint), false); | 46 SchedulePaint(gfx::Rect(ps.rcPaint), false); |
| 47 if (NeedsPainting(false)) | 47 if (NeedsPainting(false)) |
| 48 ProcessPaint(&canvas); | 48 ProcessPaint(&canvas); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool RootView::GetAccessibleRole(VARIANT* role) { | |
| 53 DCHECK(role); | |
| 54 | |
| 55 role->vt = VT_I4; | |
| 56 role->lVal = ROLE_SYSTEM_APPLICATION; | |
| 57 return true; | |
| 58 } | |
| 59 | |
| 60 void RootView::StartDragForViewFromMouseEvent( | 52 void RootView::StartDragForViewFromMouseEvent( |
| 61 View* view, | 53 View* view, |
| 62 IDataObject* data, | 54 IDataObject* data, |
| 63 int operation) { | 55 int operation) { |
| 64 drag_view_ = view; | 56 drag_view_ = view; |
| 65 scoped_refptr<BaseDragSource> drag_source(new BaseDragSource); | 57 scoped_refptr<BaseDragSource> drag_source(new BaseDragSource); |
| 66 DWORD effects; | 58 DWORD effects; |
| 67 DoDragDrop(data, drag_source, | 59 DoDragDrop(data, drag_source, |
| 68 DragDropTypes::DragOperationToDropEffect(operation), &effects); | 60 DragDropTypes::DragOperationToDropEffect(operation), &effects); |
| 69 // If the view is removed during the drag operation, drag_view_ is set to | 61 // If the view is removed during the drag operation, drag_view_ is set to |
| 70 // NULL. | 62 // NULL. |
| 71 if (drag_view_ == view) { | 63 if (drag_view_ == view) { |
| 72 View* drag_view = drag_view_; | 64 View* drag_view = drag_view_; |
| 73 drag_view_ = NULL; | 65 drag_view_ = NULL; |
| 74 drag_view->OnDragDone(); | 66 drag_view->OnDragDone(); |
| 75 } | 67 } |
| 76 } | 68 } |
| 77 | 69 |
| 78 } | 70 } |
| OLD | NEW |