| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 NSPoint viewPoint = [self flipWindowPointToView:windowPoint view:view]; | 194 NSPoint viewPoint = [self flipWindowPointToView:windowPoint view:view]; |
| 195 NSPoint screenPoint = [self flipWindowPointToScreen:windowPoint view:view]; | 195 NSPoint screenPoint = [self flipWindowPointToScreen:windowPoint view:view]; |
| 196 tabContents_->render_view_host()->DragTargetDrop( | 196 tabContents_->render_view_host()->DragTargetDrop( |
| 197 gfx::Point(viewPoint.x, viewPoint.y), | 197 gfx::Point(viewPoint.x, viewPoint.y), |
| 198 gfx::Point(screenPoint.x, screenPoint.y)); | 198 gfx::Point(screenPoint.x, screenPoint.y)); |
| 199 | 199 |
| 200 // Focus the target browser. | 200 // Focus the target browser. |
| 201 Browser* browser = Browser::GetBrowserForController( | 201 Browser* browser = Browser::GetBrowserForController( |
| 202 &tabContents_->controller(), NULL); | 202 &tabContents_->controller(), NULL); |
| 203 if (browser) | 203 if (browser) |
| 204 browser->window()->Show(); | 204 browser->window()->Show(BrowserWindow::SHOW_CONTEXT_NORMAL); |
| 205 | 205 |
| 206 return YES; | 206 return YES; |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Given |data|, which should not be nil, fill it in using the contents of the | 209 // Given |data|, which should not be nil, fill it in using the contents of the |
| 210 // given pasteboard. | 210 // given pasteboard. |
| 211 - (void)populateWebDropData:(WebDropData*)data | 211 - (void)populateWebDropData:(WebDropData*)data |
| 212 fromPasteboard:(NSPasteboard*)pboard { | 212 fromPasteboard:(NSPasteboard*)pboard { |
| 213 DCHECK(data); | 213 DCHECK(data); |
| 214 DCHECK(pboard); | 214 DCHECK(pboard); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 if (exists && !isDir) | 248 if (exists && !isDir) |
| 249 data->filenames.push_back(base::SysNSStringToUTF16(filename)); | 249 data->filenames.push_back(base::SysNSStringToUTF16(filename)); |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 | 253 |
| 254 // TODO(pinkerton): Get file contents. http://crbug.com/34661 | 254 // TODO(pinkerton): Get file contents. http://crbug.com/34661 |
| 255 } | 255 } |
| 256 | 256 |
| 257 @end | 257 @end |
| OLD | NEW |