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

Side by Side Diff: chrome/browser/tab_contents/web_drag_bookmark_handler_mac.mm

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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) 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 12
12 WebDragBookmarkHandlerMac::WebDragBookmarkHandlerMac() 13 WebDragBookmarkHandlerMac::WebDragBookmarkHandlerMac()
13 : tab_(NULL) { 14 : tab_(NULL) {
14 } 15 }
15 16
16 WebDragBookmarkHandlerMac::~WebDragBookmarkHandlerMac() {} 17 WebDragBookmarkHandlerMac::~WebDragBookmarkHandlerMac() {}
17 18
18 void WebDragBookmarkHandlerMac::DragInitialize(TabContents* contents) { 19 void WebDragBookmarkHandlerMac::DragInitialize(TabContents* contents) {
19 DCHECK(tab_ ? (tab_->tab_contents() == contents) : true); 20 DCHECK(tab_ ? (tab_->tab_contents() == contents) : true);
20 if (!tab_) 21 if (!tab_)
(...skipping 20 matching lines...) Expand all
41 // This is non-null if tab_contents_ is showing an ExtensionWebUI with 42 // This is non-null if tab_contents_ is showing an ExtensionWebUI with
42 // support for (at the moment experimental) drag and drop extensions. 43 // support for (at the moment experimental) drag and drop extensions.
43 if (tab_) { 44 if (tab_) {
44 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { 45 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) {
45 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop( 46 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDrop(
46 bookmark_drag_data_); 47 bookmark_drag_data_);
47 } 48 }
48 49
49 // Focus the target browser. 50 // Focus the target browser.
50 Browser* browser = Browser::GetBrowserForController( 51 Browser* browser = Browser::GetBrowserForController(
51 &tab_->controller(), NULL); 52 &tab_->tab_contents()->controller(), NULL);
52 if (browser) 53 if (browser)
53 browser->window()->Show(); 54 browser->window()->Show();
54 } 55 }
55 } 56 }
56 57
57 void WebDragBookmarkHandlerMac::OnDragLeave() { 58 void WebDragBookmarkHandlerMac::OnDragLeave() {
58 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { 59 if (tab_ && tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) {
59 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( 60 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave(
60 bookmark_drag_data_); 61 bookmark_drag_data_);
61 } 62 }
62 } 63 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.cc ('k') | chrome/browser/tabs/pinned_tab_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698