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

Unified Diff: chrome/browser/ui/views/tabs/base_tab_strip.cc

Issue 6750007: Scrolling Tabs (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressing Scott's review comments Created 9 years, 8 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/ui/views/tabs/base_tab_strip.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/base_tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.cc b/chrome/browser/ui/views/tabs/base_tab_strip.cc
index 48f6d69803a03b202928605dd0374fdba285f1c0..cfd0bc0e36801a4a0b21351753812dbb2b34c0ee 100644
--- a/chrome/browser/ui/views/tabs/base_tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/base_tab_strip.cc
@@ -378,16 +378,7 @@ BaseTab* BaseTabStrip::GetTabAt(BaseTab* tab,
const gfx::Point& tab_in_tab_coordinates) {
gfx::Point local_point = tab_in_tab_coordinates;
ConvertPointToView(tab, this, &local_point);
- views::View* view = GetEventHandlerForPoint(local_point);
- if (!view)
- return NULL; // No tab contains the point.
-
- // Walk up the view hierarchy until we find a tab, or the TabStrip.
- while (view && view != this && view->GetID() != VIEW_ID_TAB)
- view = view->parent();
-
- return view && view->GetID() == VIEW_ID_TAB ?
- static_cast<BaseTab*>(view) : NULL;
+ return GetTabAtLocal(local_point);
}
void BaseTabStrip::Layout() {
@@ -571,6 +562,20 @@ void BaseTabStrip::DoLayout() {
SchedulePaint();
}
+BaseTab* BaseTabStrip::GetTabAtLocal(
+ const gfx::Point& local_point) {
+ views::View* view = GetEventHandlerForPoint(local_point);
+ if (!view)
+ return NULL; // No tab contains the point.
+
+ // Walk up the view hierarchy until we find a tab, or the TabStrip.
+ while (view && view != this && view->GetID() != VIEW_ID_TAB)
+ view = view->parent();
+
+ return view && view->GetID() == VIEW_ID_TAB ?
+ static_cast<BaseTab*>(view) : NULL;
+}
+
void BaseTabStrip::StoppedDraggingTab(BaseTab* tab, bool* is_first_tab) {
int tab_data_index = TabIndexOfTab(tab);
if (tab_data_index == -1) {
« no previous file with comments | « chrome/browser/ui/views/tabs/base_tab_strip.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698