| 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 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h" | 5 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
| 9 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 9 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 11 #include "content/browser/tab_contents/tab_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 | 12 |
| 13 using content::WebContents; | 13 using content::WebContents; |
| 14 | 14 |
| 15 WebDragBookmarkHandlerMac::WebDragBookmarkHandlerMac() | 15 WebDragBookmarkHandlerMac::WebDragBookmarkHandlerMac() |
| 16 : tab_(NULL) { | 16 : tab_(NULL) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 WebDragBookmarkHandlerMac::~WebDragBookmarkHandlerMac() {} | 19 WebDragBookmarkHandlerMac::~WebDragBookmarkHandlerMac() {} |
| 20 | 20 |
| 21 void WebDragBookmarkHandlerMac::DragInitialize(WebContents* contents) { | 21 void WebDragBookmarkHandlerMac::DragInitialize(WebContents* contents) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 // This is non-null if tab_contents_ is showing an ExtensionWebUI with | 44 // This is non-null if tab_contents_ is showing an ExtensionWebUI with |
| 45 // support for (at the moment experimental) drag and drop extensions. | 45 // support for (at the moment experimental) drag and drop extensions. |
| 46 if (tab_) { | 46 if (tab_) { |
| 47 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { | 47 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { |
| 48 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop( | 48 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop( |
| 49 bookmark_drag_data_); | 49 bookmark_drag_data_); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Focus the target browser. | 52 // Focus the target browser. |
| 53 Browser* browser = Browser::GetBrowserForController( | 53 Browser* browser = Browser::GetBrowserForController( |
| 54 &tab_->tab_contents()->GetController(), NULL); | 54 &tab_->web_contents()->GetController(), NULL); |
| 55 if (browser) | 55 if (browser) |
| 56 browser->window()->Show(); | 56 browser->window()->Show(); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 void WebDragBookmarkHandlerMac::OnDragLeave() { | 60 void WebDragBookmarkHandlerMac::OnDragLeave() { |
| 61 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { | 61 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { |
| 62 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( | 62 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( |
| 63 bookmark_drag_data_); | 63 bookmark_drag_data_); |
| 64 } | 64 } |
| 65 } | 65 } |
| OLD | NEW |