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/browser/views/tab_contents/tab_contents_view_win.h" | 5 #include "chrome/browser/views/tab_contents/tab_contents_view_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "app/gfx/canvas_paint.h" | 9 #include "app/gfx/canvas_paint.h" |
10 #include "app/os_exchange_data.h" | 10 #include "app/os_exchange_data.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Pass in NULL as the profile so that the bookmark always adds the url | 171 // Pass in NULL as the profile so that the bookmark always adds the url |
172 // rather than trying to move an existing url. | 172 // rather than trying to move an existing url. |
173 bm_drag_data.Write(NULL, data); | 173 bm_drag_data.Write(NULL, data); |
174 } else { | 174 } else { |
175 data->SetURL(drop_data.url, drop_data.url_title); | 175 data->SetURL(drop_data.url, drop_data.url_title); |
176 } | 176 } |
177 } | 177 } |
178 if (!drop_data.plain_text.empty()) | 178 if (!drop_data.plain_text.empty()) |
179 data->SetString(drop_data.plain_text); | 179 data->SetString(drop_data.plain_text); |
180 | 180 |
181 drag_source_ = new WebDragSource(GetNativeView(), | 181 drag_source_ = new WebDragSource(GetNativeView(), tab_contents()); |
182 tab_contents()->render_view_host()); | |
183 | 182 |
184 DWORD effects; | 183 DWORD effects; |
185 | 184 |
186 // We need to enable recursive tasks on the message loop so we can get | 185 // We need to enable recursive tasks on the message loop so we can get |
187 // updates while in the system DoDragDrop loop. | 186 // updates while in the system DoDragDrop loop. |
188 bool old_state = MessageLoop::current()->NestableTasksAllowed(); | 187 bool old_state = MessageLoop::current()->NestableTasksAllowed(); |
189 MessageLoop::current()->SetNestableTasksAllowed(true); | 188 MessageLoop::current()->SetNestableTasksAllowed(true); |
190 DoDragDrop(data, drag_source_, DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); | 189 DoDragDrop(data, drag_source_, DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); |
191 MessageLoop::current()->SetNestableTasksAllowed(old_state); | 190 MessageLoop::current()->SetNestableTasksAllowed(old_state); |
192 | 191 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 } | 669 } |
671 return false; | 670 return false; |
672 } | 671 } |
673 | 672 |
674 void TabContentsViewWin::WheelZoom(int distance) { | 673 void TabContentsViewWin::WheelZoom(int distance) { |
675 if (tab_contents()->delegate()) { | 674 if (tab_contents()->delegate()) { |
676 bool zoom_in = distance > 0; | 675 bool zoom_in = distance > 0; |
677 tab_contents()->delegate()->ContentsZoomChange(zoom_in); | 676 tab_contents()->delegate()->ContentsZoomChange(zoom_in); |
678 } | 677 } |
679 } | 678 } |
OLD | NEW |