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

Unified Diff: chrome/browser/views/tabs/tab_overview_controller.h

Issue 126185: Improved tab overview animations with better animation and wiring to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
Index: chrome/browser/views/tabs/tab_overview_controller.h
===================================================================
--- chrome/browser/views/tabs/tab_overview_controller.h (revision 18480)
+++ chrome/browser/views/tabs/tab_overview_controller.h (working copy)
@@ -9,6 +9,7 @@
#include "base/scoped_ptr.h"
#include "chrome/browser/tabs/tab_strip_model.h"
+class Animation;
class Browser;
class TabOverviewCell;
class TabOverviewContainer;
@@ -27,8 +28,9 @@
explicit TabOverviewController(const gfx::Point& monitor_origin);
~TabOverviewController();
- // Sets the browser we're showing the tab strip for.
- void SetBrowser(Browser* browser);
+ // Sets the browser we're showing the tab strip for. |horizontal_center|
+ // gives the center of the window.
+ void SetBrowser(Browser* browser, int horizontal_center);
Browser* browser() const { return browser_; }
TabOverviewGrid* grid() const { return grid_; }
TabStripModel* model() const;
@@ -44,11 +46,16 @@
void ConfigureCell(TabOverviewCell* cell, TabContents* contents);
// Invoked from TabOverviewDragController.
- virtual void DragStarted();
- virtual void DragEnded();
- virtual void MoveOffscreen();
- virtual void SelectTabContents(TabContents* contents);
+ void DragStarted();
+ void DragEnded();
+ void MoveOffscreen();
+ void SelectTabContents(TabContents* contents);
+ // Forwarded from TabOverviewGrid as the animation of the grid changes.
+ void GridAnimationEnded();
+ void GridAnimationProgressed();
+ void GridAnimationCanceled();
+
// TabStripModelObserver overrides.
virtual void TabInsertedAt(TabContents* contents,
int index,
@@ -75,10 +82,15 @@
// Removes all the cells in the grid and populates it from the model.
void RecreateCells();
- // Invoked when the count of the model changes. Notifies the host the pref
- // size changed.
- void TabCountChanged();
+ // Updates the target and start bounds.
+ void UpdateStartAndTargetBounds();
+ // Sets the bounds of the hosting window to |bounds|.
+ void SetHostBounds(const gfx::Rect& bounds);
+
+ // Returns the bounds for the window based on the current content.
+ gfx::Rect CalculateHostBounds();
+
// The widget showing the view.
views::Widget* host_;
@@ -104,6 +116,23 @@
// Has Show been invoked?
bool shown_;
+ // Position of the center of the window along the horizontal axis. This is
+ // used to position the overview window.
+ int horizontal_center_;
+
+ // Should we change the window bounds on animate? This is true while the
+ // animation is running on the grid to move things around.
+ bool change_window_bounds_on_animate_;
+
+ // When the model changes we animate the bounds of the window. These two
+ // give the start and target bounds of the window.
+ gfx::Rect start_bounds_;
+ gfx::Rect target_bounds_;
+
+ // Are we in the process of mutating the grid? This is used to avoid changing
+ // bounds when we're responsible for the mutation.
+ bool mutating_grid_;
+
DISALLOW_COPY_AND_ASSIGN(TabOverviewController);
};

Powered by Google App Engine
This is Rietveld 408576698