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

Unified Diff: chrome/browser/views/frame/browser_root_view.cc

Issue 155242: Add temporary TabStripWrapper interface that is implemented by both TabStrip ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/frame/browser_root_view.h ('k') | chrome/browser/views/frame/browser_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_root_view.cc
===================================================================
--- chrome/browser/views/frame/browser_root_view.cc (revision 20183)
+++ chrome/browser/views/frame/browser_root_view.cc (working copy)
@@ -8,7 +8,7 @@
#include "app/os_exchange_data.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/frame/browser_frame.h"
-#include "chrome/browser/views/tabs/tab_strip.h"
+#include "chrome/browser/views/tabs/tab_strip_wrapper.h"
BrowserRootView::BrowserRootView(views::Widget* widget)
: views::RootView(widget),
@@ -18,7 +18,7 @@
}
bool BrowserRootView::CanDrop(const OSExchangeData& data) {
- can_drop_ = (tabstrip_ && tabstrip_->IsVisible() &&
+ can_drop_ = (tabstrip_ && tabstrip_->GetView()->IsVisible() &&
!tabstrip_->IsAnimating() && data.HasURL());
return can_drop_;
}
@@ -27,7 +27,7 @@
if (can_drop_ && ShouldForwardToTabStrip(event)) {
forwarding_to_tab_strip_ = true;
scoped_ptr<views::DropTargetEvent> mapped_event(MapEventToTabStrip(event));
- tabstrip_->OnDragEntered(*mapped_event.get());
+ tabstrip_->GetView()->OnDragEntered(*mapped_event.get());
}
}
@@ -37,13 +37,13 @@
scoped_ptr<views::DropTargetEvent> mapped_event(
MapEventToTabStrip(event));
if (!forwarding_to_tab_strip_) {
- tabstrip_->OnDragEntered(*mapped_event.get());
+ tabstrip_->GetView()->OnDragEntered(*mapped_event.get());
forwarding_to_tab_strip_ = true;
}
- return tabstrip_->OnDragUpdated(*mapped_event.get());
+ return tabstrip_->GetView()->OnDragUpdated(*mapped_event.get());
} else if (forwarding_to_tab_strip_) {
forwarding_to_tab_strip_ = false;
- tabstrip_->OnDragExited();
+ tabstrip_->GetView()->OnDragExited();
}
}
return DragDropTypes::DRAG_NONE;
@@ -52,7 +52,7 @@
void BrowserRootView::OnDragExited() {
if (forwarding_to_tab_strip_) {
forwarding_to_tab_strip_ = false;
- tabstrip_->OnDragExited();
+ tabstrip_->GetView()->OnDragExited();
}
}
@@ -61,27 +61,27 @@
forwarding_to_tab_strip_ = false;
scoped_ptr<views::DropTargetEvent> mapped_event(
MapEventToTabStrip(event));
- return tabstrip_->OnPerformDrop(*mapped_event.get());
+ return tabstrip_->GetView()->OnPerformDrop(*mapped_event.get());
}
return DragDropTypes::DRAG_NONE;
}
bool BrowserRootView::ShouldForwardToTabStrip(
const views::DropTargetEvent& event) {
- if (!tabstrip_->IsVisible())
+ if (!tabstrip_->GetView()->IsVisible())
return false;
// Allow the drop as long as the mouse is over the tabstrip or vertically
// before it.
gfx::Point tab_loc_in_host;
- ConvertPointToView(tabstrip_, this, &tab_loc_in_host);
- return event.y() < tab_loc_in_host.y() + tabstrip_->height();
+ ConvertPointToView(tabstrip_->GetView(), this, &tab_loc_in_host);
+ return event.y() < tab_loc_in_host.y() + tabstrip_->GetView()->height();
}
views::DropTargetEvent* BrowserRootView::MapEventToTabStrip(
const views::DropTargetEvent& event) {
gfx::Point tab_strip_loc(event.location());
- ConvertPointToView(this, tabstrip_, &tab_strip_loc);
+ ConvertPointToView(this, tabstrip_->GetView(), &tab_strip_loc);
return new views::DropTargetEvent(event.GetData(), tab_strip_loc.x(),
tab_strip_loc.y(),
event.GetSourceOperations());
« no previous file with comments | « chrome/browser/views/frame/browser_root_view.h ('k') | chrome/browser/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698