Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: chrome/browser/tab_contents/web_drag_bookmark_handler_aura.cc

Issue 10391158: Moves methods for finding browsers to browser_finder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include fixs Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_window.h" 10 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" 11 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #include "ui/base/dragdrop/os_exchange_data.h" 14 #include "ui/base/dragdrop/os_exchange_data.h"
14 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" 15 #include "ui/base/dragdrop/os_exchange_data_provider_aura.h"
15 #include "webkit/glue/webdropdata.h" 16 #include "webkit/glue/webdropdata.h"
16 17
17 using content::WebContents; 18 using content::WebContents;
18 19
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void WebDragBookmarkHandlerAura::OnDrop() { 62 void WebDragBookmarkHandlerAura::OnDrop() {
62 if (tab_) { 63 if (tab_) {
63 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { 64 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) {
64 if (bookmark_drag_data_.is_valid()) { 65 if (bookmark_drag_data_.is_valid()) {
65 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop( 66 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop(
66 bookmark_drag_data_); 67 bookmark_drag_data_);
67 } 68 }
68 } 69 }
69 70
70 // Focus the target browser. 71 // Focus the target browser.
71 Browser* browser = Browser::GetBrowserForController( 72 Browser* browser = browser::FindBrowserForController(
72 &tab_->web_contents()->GetController(), NULL); 73 &tab_->web_contents()->GetController(), NULL);
73 if (browser) 74 if (browser)
74 browser->window()->Show(); 75 browser->window()->Show();
75 } 76 }
76 77
77 bookmark_drag_data_.Clear(); 78 bookmark_drag_data_.Clear();
78 } 79 }
79 80
80 void WebDragBookmarkHandlerAura::OnDragLeave() { 81 void WebDragBookmarkHandlerAura::OnDragLeave() {
81 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { 82 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) {
82 if (bookmark_drag_data_.is_valid()) 83 if (bookmark_drag_data_.is_valid())
83 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( 84 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave(
84 bookmark_drag_data_); 85 bookmark_drag_data_);
85 } 86 }
86 87
87 bookmark_drag_data_.Clear(); 88 bookmark_drag_data_.Clear();
88 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698