OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_aura.h" | 5 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_aura.h" |
6 | 6 |
7 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 7 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void WebDragBookmarkHandlerAura::OnDrop() { | 62 void WebDragBookmarkHandlerAura::OnDrop() { |
63 if (tab_) { | 63 if (tab_) { |
64 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { | 64 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { |
65 if (bookmark_drag_data_.is_valid()) { | 65 if (bookmark_drag_data_.is_valid()) { |
66 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop( | 66 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop( |
67 bookmark_drag_data_); | 67 bookmark_drag_data_); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 // Focus the target browser. | 71 // Focus the target browser. |
72 Browser* browser = browser::FindBrowserForController( | 72 Browser* browser = browser::FindBrowserWithWebContents( |
73 &tab_->web_contents()->GetController(), NULL); | 73 tab_->web_contents()); |
74 if (browser) | 74 if (browser) |
75 browser->window()->Show(); | 75 browser->window()->Show(); |
76 } | 76 } |
77 | 77 |
78 bookmark_drag_data_.Clear(); | 78 bookmark_drag_data_.Clear(); |
79 } | 79 } |
80 | 80 |
81 void WebDragBookmarkHandlerAura::OnDragLeave() { | 81 void WebDragBookmarkHandlerAura::OnDragLeave() { |
82 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { | 82 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { |
83 if (bookmark_drag_data_.is_valid()) | 83 if (bookmark_drag_data_.is_valid()) |
84 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( | 84 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( |
85 bookmark_drag_data_); | 85 bookmark_drag_data_); |
86 } | 86 } |
87 | 87 |
88 bookmark_drag_data_.Clear(); | 88 bookmark_drag_data_.Clear(); |
89 } | 89 } |
OLD | NEW |