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/web_contents_view_win.h" | 5 #include "chrome/browser/web_contents_view_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 9 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // TODO(tc): Generate an appropriate drag image. | 94 // TODO(tc): Generate an appropriate drag image. |
95 | 95 |
96 // We set the file contents before the URL because the URL also sets file | 96 // We set the file contents before the URL because the URL also sets file |
97 // contents (to a .URL shortcut). We want to prefer file content data over a | 97 // contents (to a .URL shortcut). We want to prefer file content data over a |
98 // shortcut so we add it first. | 98 // shortcut so we add it first. |
99 if (!drop_data.file_contents.empty()) { | 99 if (!drop_data.file_contents.empty()) { |
100 data->SetFileContents(drop_data.file_description_filename, | 100 data->SetFileContents(drop_data.file_description_filename, |
101 drop_data.file_contents); | 101 drop_data.file_contents); |
102 } | 102 } |
103 if (!drop_data.cf_html.empty()) | 103 if (!drop_data.text_html.empty()) |
104 data->SetCFHtml(drop_data.cf_html); | 104 data->SetHtml(drop_data.text_html, drop_data.html_base_url); |
105 if (drop_data.url.is_valid()) { | 105 if (drop_data.url.is_valid()) { |
106 if (drop_data.url.SchemeIs("javascript")) { | 106 if (drop_data.url.SchemeIs("javascript")) { |
107 // We don't want to allow javascript URLs to be dragged to the desktop, | 107 // We don't want to allow javascript URLs to be dragged to the desktop, |
108 // but we do want to allow them to be added to the bookmarks bar | 108 // but we do want to allow them to be added to the bookmarks bar |
109 // (bookmarklets). | 109 // (bookmarklets). |
110 BookmarkDragData::Element bm_elt; | 110 BookmarkDragData::Element bm_elt; |
111 bm_elt.is_url = true; | 111 bm_elt.is_url = true; |
112 bm_elt.url = drop_data.url; | 112 bm_elt.url = drop_data.url; |
113 bm_elt.title = drop_data.url_title; | 113 bm_elt.title = drop_data.url_title; |
114 | 114 |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 } | 668 } |
669 return false; | 669 return false; |
670 } | 670 } |
671 | 671 |
672 void WebContentsViewWin::WheelZoom(int distance) { | 672 void WebContentsViewWin::WheelZoom(int distance) { |
673 if (web_contents_->delegate()) { | 673 if (web_contents_->delegate()) { |
674 bool zoom_in = distance > 0; | 674 bool zoom_in = distance > 0; |
675 web_contents_->delegate()->ContentsZoomChange(zoom_in); | 675 web_contents_->delegate()->ContentsZoomChange(zoom_in); |
676 } | 676 } |
677 } | 677 } |
OLD | NEW |