Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc |
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
index 1997b873a2349ff601ee1869a531a63314eee050..0eff41ef5f725a517a302a4ebb93fb50dd086889 100644 |
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
@@ -823,7 +823,7 @@ TabDragController::Liveness TabDragController::GetTargetTabStripForPoint( |
// behavior. See crbug.com/336691 |
if (!GetModalTransient(local_window)) { |
TabStrip* result = GetTabStripForWindow(local_window); |
- if (result && DoesTabStripContain(result, point_in_screen)) { |
+ if (result && DoesTabStripContain(result, point_in_screen, local_window)) { |
*tab_strip = result; |
return Liveness::ALIVE; |
} |
@@ -853,17 +853,40 @@ TabStrip* TabDragController::GetTabStripForWindow(gfx::NativeWindow window) { |
other_tabstrip : NULL; |
} |
-bool TabDragController::DoesTabStripContain( |
- TabStrip* tabstrip, |
- const gfx::Point& point_in_screen) const { |
+bool TabDragController::DoesTabStripContain(TabStrip* tabstrip, |
+ const gfx::Point& point_in_screen, |
+ gfx::NativeWindow window) const { |
// Make sure the specified screen point is actually within the bounds of the |
- // specified tabstrip... |
+ // specified tabstrip. |
gfx::Rect tabstrip_bounds = GetViewScreenBounds(tabstrip); |
- return point_in_screen.x() < tabstrip_bounds.right() && |
+#if defined(OS_CHROMEOS) |
sky
2017/01/17 18:07:01
Why does this need to be chromeos specific? Immers
Qiang(Joe) Xu
2017/01/18 01:13:52
done
|
+ DCHECK(window); |
+ BrowserView* browser_view = |
+ BrowserView::GetBrowserViewForNativeWindow(window); |
+ DCHECK(browser_view); |
+ bool hidden_top_views = |
+ browser_view->immersive_mode_controller()->ShouldHideTopViews(); |
+ // When |window| is immersive non-revealed mode, get |tabstrip_bounds| from |
+ // non-client view coordinates where tabstrip should be laid when revealed. |
+ if (hidden_top_views) { |
+ tabstrip_bounds = browser_view->frame()->GetBoundsForTabStrip(tabstrip); |
+ aura::Window::ConvertRectToTarget(window, window->GetRootWindow(), |
+ &tabstrip_bounds); |
+ } |
+#endif |
+ |
+ bool res = |
+ point_in_screen.x() < tabstrip_bounds.right() && |
point_in_screen.x() >= tabstrip_bounds.x() && |
- DoesRectContainVerticalPointExpanded(tabstrip_bounds, |
- kVerticalDetachMagnetism, |
- point_in_screen.y()); |
+ DoesRectContainVerticalPointExpanded( |
+ tabstrip_bounds, kVerticalDetachMagnetism, point_in_screen.y()); |
+#if defined(OS_CHROMEOS) |
+ if (res && hidden_top_views) { |
+ tabstrip->SetVisible(true); |
sky
2017/01/17 18:07:01
This function is meant to check whether the tabstr
Qiang(Joe) Xu
2017/01/18 01:13:52
done by moving to DragBrowserToNewTabStrip
|
+ tabstrip->SetBoundsRect(tabstrip_bounds); |
+ } |
+#endif |
+ return res; |
} |
void TabDragController::Attach(TabStrip* attached_tabstrip, |