summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs/tab_overview_controller.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-01 21:06:29 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-01 21:06:29 +0000
commit4dab725746e1cea9430833de820d27999b5f0c43 (patch)
tree1a5e815ee568f4c5ca1db6116ca01ed55142ec20 /chrome/browser/views/tabs/tab_overview_controller.cc
parent59470077c6e1b77fdb11aec535958b1fdd8e623a (diff)
downloadchromium_src-4dab725746e1cea9430833de820d27999b5f0c43.zip
chromium_src-4dab725746e1cea9430833de820d27999b5f0c43.tar.gz
chromium_src-4dab725746e1cea9430833de820d27999b5f0c43.tar.bz2
Improves tab overview.
BUG=none TEST=none Review URL: http://codereview.chromium.org/151169 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs/tab_overview_controller.cc')
-rw-r--r--chrome/browser/views/tabs/tab_overview_controller.cc33
1 files changed, 30 insertions, 3 deletions
diff --git a/chrome/browser/views/tabs/tab_overview_controller.cc b/chrome/browser/views/tabs/tab_overview_controller.cc
index eeb8347..c2f245b 100644
--- a/chrome/browser/views/tabs/tab_overview_controller.cc
+++ b/chrome/browser/views/tabs/tab_overview_controller.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/tab_contents/thumbnail_generator.h"
#include "chrome/browser/views/tabs/tab_overview_cell.h"
#include "chrome/browser/views/tabs/tab_overview_container.h"
+#include "chrome/browser/views/tabs/tab_overview_drag_controller.h"
#include "chrome/browser/views/tabs/tab_overview_grid.h"
#include "chrome/browser/views/tabs/tab_overview_types.h"
#include "chrome/browser/window_sizer.h"
@@ -85,21 +86,38 @@ void TabOverviewController::SetBrowser(Browser* browser,
browser_ = browser;
if (browser_)
model()->AddObserver(this);
+
+ show_thumbnails_ = false;
+ StartDelayTimer();
+
gfx::Rect host_bounds = CalculateHostBounds();
if (moved_offscreen_ && model() && model()->count()) {
// Need to reset the bounds if we were offscreen.
host_->SetBounds(host_bounds);
moved_offscreen_ = false;
+ } else if (!model() && shown_) {
+ MoveOffscreen();
}
+ if (!moved_offscreen_)
+ container_->SchedulePaint();
+
RecreateCells();
container_->set_arrow_center(horizontal_center_ - host_bounds.x());
+
+ if (!moved_offscreen_)
+ container_->SchedulePaint();
}
TabStripModel* TabOverviewController::model() const {
return browser_ ? browser_->tabstrip_model() : NULL;
}
+void TabOverviewController::SetMouseOverMiniWindow(bool over_mini_window) {
+ if (grid_->drag_controller())
+ grid_->drag_controller()->set_mouse_over_mini_window(over_mini_window);
+}
+
void TabOverviewController::Show() {
if (host_->IsVisible())
return;
@@ -107,9 +125,9 @@ void TabOverviewController::Show() {
shown_ = true;
DCHECK(model()); // The model needs to be set before showing.
host_->Show();
- delay_timer_.Start(
- base::TimeDelta::FromMilliseconds(350), this,
- &TabOverviewController::StartConfiguring);
+
+ show_thumbnails_ = false;
+ StartDelayTimer();
}
void TabOverviewController::ConfigureCell(TabOverviewCell* cell,
@@ -321,6 +339,7 @@ gfx::Rect TabOverviewController::CalculateHostBounds() {
void TabOverviewController::StartConfiguring() {
show_thumbnails_ = true;
+ configure_timer_.Stop();
configure_timer_.Start(
base::TimeDelta::FromMilliseconds(10), this,
&TabOverviewController::ConfigureNextUnconfiguredCell);
@@ -336,3 +355,11 @@ void TabOverviewController::ConfigureNextUnconfiguredCell() {
}
configure_timer_.Stop();
}
+
+void TabOverviewController::StartDelayTimer() {
+ configure_timer_.Stop();
+ delay_timer_.Stop();
+ delay_timer_.Start(
+ base::TimeDelta::FromMilliseconds(350), this,
+ &TabOverviewController::StartConfiguring);
+}