OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/tab_contents/web_drop_target.h" | 5 #import "chrome/browser/ui/cocoa/tab_contents/web_drop_target.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 8 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
9 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" | 9 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" |
10 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 10 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 if (currentRVH_ != tabContents_->render_view_host()) | 163 if (currentRVH_ != tabContents_->render_view_host()) |
164 [self draggingEntered:info view:view]; | 164 [self draggingEntered:info view:view]; |
165 | 165 |
166 // Check if we only allow navigation and navigate to a url on the pasteboard. | 166 // Check if we only allow navigation and navigate to a url on the pasteboard. |
167 if ([self onlyAllowsNavigation]) { | 167 if ([self onlyAllowsNavigation]) { |
168 NSPasteboard* pboard = [info draggingPasteboard]; | 168 NSPasteboard* pboard = [info draggingPasteboard]; |
169 if ([pboard containsURLData]) { | 169 if ([pboard containsURLData]) { |
170 GURL url; | 170 GURL url; |
171 drag_util::PopulateURLAndTitleFromPasteBoard(&url, NULL, pboard, YES); | 171 drag_util::PopulateURLAndTitleFromPasteBoard(&url, NULL, pboard, YES); |
172 tabContents_->OpenURL(url, GURL(), CURRENT_TAB, | 172 tabContents_->OpenURL(url, GURL(), CURRENT_TAB, |
173 PageTransition::AUTO_BOOKMARK); | 173 content::PAGE_TRANSITION_AUTO_BOOKMARK); |
174 return YES; | 174 return YES; |
175 } | 175 } |
176 return NO; | 176 return NO; |
177 } | 177 } |
178 | 178 |
179 // If the tab is showing the bookmark manager, send BookmarkDrag events | 179 // If the tab is showing the bookmark manager, send BookmarkDrag events |
180 BookmarkTabHelper::BookmarkDrag* dragDelegate = | 180 BookmarkTabHelper::BookmarkDrag* dragDelegate = |
181 tab_ ? tab_->bookmark_tab_helper()->GetBookmarkDragDelegate() : NULL; | 181 tab_ ? tab_->bookmark_tab_helper()->GetBookmarkDragDelegate() : NULL; |
182 BookmarkNodeData dragData; | 182 BookmarkNodeData dragData; |
183 if(dragDelegate && dragData.ReadFromDragClipboard()) | 183 if(dragDelegate && dragData.ReadFromDragClipboard()) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 if (exists && !isDir) | 245 if (exists && !isDir) |
246 data->filenames.push_back(base::SysNSStringToUTF16(filename)); | 246 data->filenames.push_back(base::SysNSStringToUTF16(filename)); |
247 } | 247 } |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 // TODO(pinkerton): Get file contents. http://crbug.com/34661 | 251 // TODO(pinkerton): Get file contents. http://crbug.com/34661 |
252 } | 252 } |
253 | 253 |
254 @end | 254 @end |
OLD | NEW |