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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.h

Issue 80323002: Restores maximized browser before dragging a tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restores maximized browser before dragging a tab (ash only) Created 7 years, 1 month 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
Index: chrome/browser/ui/views/tabs/tab_drag_controller.h
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.h b/chrome/browser/ui/views/tabs/tab_drag_controller.h
index cbd4f5bbeac22758108be4f2416f63287e7da5fa..0a35a88f45c146a29ae2be3790602e31f22452c7 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.h
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.h
@@ -457,6 +457,25 @@ class TabDragController : public content::WebContentsDelegate,
// |source_tabstrip_|.
bool AreTabsConsecutive();
+ // Calculates and returns new bounds for the dragged browser window.
+ // Takes into consideration current and restore bounds of |source| tab strip
+ // preventing the dragged size from being too small. Positions the new bounds
+ // such that the tab that was dragged remains under the |point_in_screen|.
+ // Offsets |drag_bounds| if necessary when dragging to the right from the
+ // source browser.
+ gfx::Rect CalculateDraggedBrowserBounds(TabStrip* source,
+ const gfx::Point& point_in_screen,
+ std::vector<gfx::Rect>* drag_bounds);
+
+ // Calculates scaled |drag_bounds| for dragged tabs and sets the tabs bounds.
+ // Layout of the tabstrip is performed and a new tabstrip width calculated.
+ // When |last_tabstrip_width| is larger than the new tabstrip width the tabs
+ // in attached tabstrip are scaled and the attached browser is positioned such
+ // that the tab that was dragged remains under the |point_in_screen|.
+ void AdjustBrowserAndTabBoundsForDrag(int last_tabstrip_width,
+ const gfx::Point& point_in_screen,
+ std::vector<gfx::Rect>* drag_bounds);
+
// Creates and returns a new Browser to handle the drag.
Browser* CreateBrowserForDrag(TabStrip* source,
const gfx::Point& point_in_screen,

Powered by Google App Engine
This is Rietveld 408576698