diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 19:53:56 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 19:53:56 +0000 |
commit | 791f74e8cd6eb1204b04c23e6378daeb4f688ee6 (patch) | |
tree | f99b805785739ad3601623ca2720a09359bfd32b /chrome/browser/views | |
parent | be6201369c7e36d720fc21a2d75bdac6c4350369 (diff) | |
download | chromium_src-791f74e8cd6eb1204b04c23e6378daeb4f688ee6.zip chromium_src-791f74e8cd6eb1204b04c23e6378daeb4f688ee6.tar.gz chromium_src-791f74e8cd6eb1204b04c23e6378daeb4f688ee6.tar.bz2 |
Makes tab overview show the arrow at the right location.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/147218
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
5 files changed, 11 insertions, 10 deletions
diff --git a/chrome/browser/views/tabs/tab_overview_container.cc b/chrome/browser/views/tabs/tab_overview_container.cc index 09b5f9b..6843b1e 100644 --- a/chrome/browser/views/tabs/tab_overview_container.cc +++ b/chrome/browser/views/tabs/tab_overview_container.cc @@ -61,11 +61,11 @@ void TabOverviewContainer::Paint(gfx::Canvas* canvas) { int arrow_center = arrow_center_ - bounds().x(); if (arrow_center >= kArrowHeight && arrow_center < width() - kArrowHeight) { // Only draw the arrow if we have enough space. - outline.lineTo(SkIntToScalar(width() / 2 + kArrowHeight / 2), + outline.lineTo(SkIntToScalar(arrow_center + kArrowHeight / 2), SkIntToScalar(bottom)); outline.lineTo(SkIntToScalar(arrow_center), SkIntToScalar(bottom + kArrowHeight)); - outline.lineTo(SkIntToScalar(width() / 2 - kArrowHeight / 2), + outline.lineTo(SkIntToScalar(arrow_center - kArrowHeight / 2), SkIntToScalar(bottom)); } outline.arcTo(SkIntToScalar(0), SkIntToScalar(bottom), diff --git a/chrome/browser/views/tabs/tab_overview_controller.cc b/chrome/browser/views/tabs/tab_overview_controller.cc index f4027b3..eeb8347 100644 --- a/chrome/browser/views/tabs/tab_overview_controller.cc +++ b/chrome/browser/views/tabs/tab_overview_controller.cc @@ -65,7 +65,6 @@ TabOverviewController::TabOverviewController( container_->SetMaxSize(CalculateHostBounds().size()); - // TODO: remove this when we get mid point. horizontal_center_ = monitor_bounds_.x() + monitor_bounds_.width() / 2; } @@ -80,8 +79,7 @@ TabOverviewController::~TabOverviewController() { void TabOverviewController::SetBrowser(Browser* browser, int horizontal_center) { - // TODO: update this when we horizontal_center is correct. - // horizontal_center_ = horizontal_center; + horizontal_center_ = horizontal_center; if (browser_) model()->RemoveObserver(this); browser_ = browser; diff --git a/chrome/browser/views/tabs/tab_overview_message_listener.cc b/chrome/browser/views/tabs/tab_overview_message_listener.cc index 0f3b1f3..71b12a6 100644 --- a/chrome/browser/views/tabs/tab_overview_message_listener.cc +++ b/chrome/browser/views/tabs/tab_overview_message_listener.cc @@ -52,7 +52,7 @@ void TabOverviewMessageListener::ProcessMessage( BrowserWindowGtk::GetBrowserWindowForXID( x11_util::GetX11WindowFromGdkWindow(window))); if (browser_window) - ShowOverview(browser_window->browser()); + ShowOverview(browser_window->browser(), message.param(1)); else HideOverview(); } @@ -78,13 +78,13 @@ void TabOverviewMessageListener::ProcessMessage( } } -void TabOverviewMessageListener::ShowOverview(Browser* browser) { +void TabOverviewMessageListener::ShowOverview(Browser* browser, + int horizontal_center) { if (!controller_.get()) { controller_.reset(new TabOverviewController( browser->window()->GetNormalBounds().origin())); } - // TODO: get x-coordinate when available. - controller_->SetBrowser(browser, -1); + controller_->SetBrowser(browser, horizontal_center); controller_->Show(); } diff --git a/chrome/browser/views/tabs/tab_overview_message_listener.h b/chrome/browser/views/tabs/tab_overview_message_listener.h index dd5472a..2456de1 100644 --- a/chrome/browser/views/tabs/tab_overview_message_listener.h +++ b/chrome/browser/views/tabs/tab_overview_message_listener.h @@ -39,7 +39,7 @@ class TabOverviewMessageListener : public MessageLoopForUI::Observer { GdkWindow* window); // Shows the tab overview for |browser|. - void ShowOverview(Browser* browser); + void ShowOverview(Browser* browser, int horizontal_center); // Hids the tab overview. void HideOverview(); diff --git a/chrome/browser/views/tabs/tab_overview_types.h b/chrome/browser/views/tabs/tab_overview_types.h index dc40fed..dc3af64 100644 --- a/chrome/browser/views/tabs/tab_overview_types.h +++ b/chrome/browser/views/tabs/tab_overview_types.h @@ -88,6 +88,9 @@ class TabOverviewTypes { // Instruct a top-level Chrome window to change the visibility of its // tab summary window. // param[0]: desired visibility (0 means hide, 1 means show) + // param[1]: X position (relative to the left edge of the root + // window) of the center of the top-level window. Only + // relevant for "show" messages CHROME_SET_TAB_SUMMARY_VISIBILITY, // Tell the WM to collapse or expand a panel. |