diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-02 17:29:43 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-02 17:29:43 +0000 |
commit | 8a34e660e7b6627b71a3b24e6800090f239075bb (patch) | |
tree | e76c3a12d82cd6e6d8dc467596316f0666fd1296 /chrome/browser/gtk | |
parent | 0b4158e6bc07aea93651c05c3bf26c2152bd9842 (diff) | |
download | chromium_src-8a34e660e7b6627b71a3b24e6800090f239075bb.zip chromium_src-8a34e660e7b6627b71a3b24e6800090f239075bb.tar.gz chromium_src-8a34e660e7b6627b71a3b24e6800090f239075bb.tar.bz2 |
Rip out phantom tabs and corresponding unit tests.
Also get rid of the type enum passed to TabReplacedAt since it can only be one option after phantom tabs are removed.
BUG=none
TEST=compile? good. pass tests? good.
Review URL: http://codereview.chromium.org/3539010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/dragged_tab_gtk.cc | 1 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_gtk.h | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_renderer_gtk.cc | 9 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_renderer_gtk.h | 13 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 6 |
8 files changed, 11 insertions, 38 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index e6062c1..58b1db5 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1408,7 +1408,7 @@ bool BrowserWindowGtk::CanClose() const { if (!browser_->ShouldCloseWindow()) return false; - if (browser_->tabstrip_model()->HasNonPhantomTabs()) { + if (!browser_->tabstrip_model()->empty()) { // Tab strip isn't empty. Hide the window (so it appears to have closed // immediately) and close all the tabs, allowing the renderers to shut // down. When the tab strip is empty we'll be called back again. diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc index 551aeb8..5df0ea7 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc @@ -424,7 +424,7 @@ void DraggedTabControllerGtk::Detach() { } // If we've removed the last tab from the tabstrip, hide the frame now. - if (!attached_model->HasNonPhantomTabs()) + if (attached_model->empty()) HideWindow(); // Update the dragged tab. This NULL check is necessary apparently in some @@ -736,7 +736,7 @@ void DraggedTabControllerGtk::ShowWindow() { void DraggedTabControllerGtk::CleanUpHiddenFrame() { // If the model we started dragging from is now empty, we must ask the // delegate to close the frame. - if (!source_tabstrip_->model()->HasNonPhantomTabs()) + if (source_tabstrip_->model()->empty()) source_tabstrip_->model()->delegate()->CloseFrameAfterDragSession(); } diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index 27a1846..9929f10 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -55,7 +55,6 @@ DraggedTabGtk::DraggedTabGtk(TabContents* datasource, contents_size_(contents_size), close_animation_(this) { renderer_->UpdateData(datasource, - false, // phantom datasource->is_app(), false); // loading_only renderer_->set_mini(mini); diff --git a/chrome/browser/gtk/tabs/tab_gtk.cc b/chrome/browser/gtk/tabs/tab_gtk.cc index 148e7ea..3d1eb07 100644 --- a/chrome/browser/gtk/tabs/tab_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_gtk.cc @@ -315,11 +315,8 @@ void TabGtk::CloseButtonClicked() { delegate_->CloseTab(this); } -void TabGtk::UpdateData(TabContents* contents, - bool phantom, - bool app, - bool loading_only) { - TabRendererGtk::UpdateData(contents, phantom, app, loading_only); +void TabGtk::UpdateData(TabContents* contents, bool app, bool loading_only) { + TabRendererGtk::UpdateData(contents, app, loading_only); // Cache the title width so we don't recalculate it every time the tab is // resized. title_width_ = GetTitleWidth(title_font(), GetTitle()); diff --git a/chrome/browser/gtk/tabs/tab_gtk.h b/chrome/browser/gtk/tabs/tab_gtk.h index 64c5513..586e306 100644 --- a/chrome/browser/gtk/tabs/tab_gtk.h +++ b/chrome/browser/gtk/tabs/tab_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -99,10 +99,7 @@ class TabGtk : public TabRendererGtk, virtual bool IsVisible() const; virtual void SetVisible(bool visible) const; virtual void CloseButtonClicked(); - virtual void UpdateData(TabContents* contents, - bool phantom, - bool app, - bool loading_only); + virtual void UpdateData(TabContents* contents, bool app, bool loading_only); virtual void SetBounds(const gfx::Rect& bounds); private: diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc index 4dc40a7..51c71cc 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc @@ -275,7 +275,6 @@ TabRendererGtk::~TabRendererGtk() { } void TabRendererGtk::UpdateData(TabContents* contents, - bool phantom, bool app, bool loading_only) { DCHECK(contents); @@ -292,7 +291,6 @@ void TabRendererGtk::UpdateData(TabContents* contents, else data_.favicon = contents->GetFavIcon(); - data_.phantom = phantom; data_.app = app; // This is kind of a hacky way to determine whether our icon is the default // favicon. But the plumbing that would be necessary to do it right would @@ -612,12 +610,7 @@ void TabRendererGtk::Paint(gfx::Canvas* canvas) { show_close_button != showing_close_button_) Layout(); - if (!phantom()) { - // TODO: this isn't quite right. To match the Windows side we need to render - // phantom tabs to a separate layer than alpha composite that. This will do - // for now though. - PaintTabBackground(canvas); - } + PaintTabBackground(canvas); if (!mini() || width() > kMiniTabRendererAsNormalTabWidth) PaintTitle(canvas); diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.h b/chrome/browser/gtk/tabs/tab_renderer_gtk.h index 092843d..f3a9763 100644 --- a/chrome/browser/gtk/tabs/tab_renderer_gtk.h +++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -105,10 +105,7 @@ class TabRendererGtk : public AnimationDelegate, // TabContents. If only the loading state was updated, the loading_only flag // should be specified. If other things change, set this flag to false to // update everything. - virtual void UpdateData(TabContents* contents, - bool phantom, - bool app, - bool loading_only); + virtual void UpdateData(TabContents* contents, bool app, bool loading_only); // Sets the blocked state of the tab. void SetBlocked(bool pinned); @@ -118,10 +115,6 @@ class TabRendererGtk : public AnimationDelegate, void set_mini(bool mini) { data_.mini = mini; } bool mini() const { return data_.mini; } - // Sets the phantom state of the tab. - void set_phantom(bool phantom) { data_.phantom = phantom; } - bool phantom() const { return data_.phantom; } - // Sets the app state of the tab. void set_app(bool app) { data_.app = app; } bool app() const { return data_.app; } @@ -264,7 +257,6 @@ class TabRendererGtk : public AnimationDelegate, mini(false), blocked(false), animating_mini_change(false), - phantom(false), app(false) { } @@ -278,7 +270,6 @@ class TabRendererGtk : public AnimationDelegate, bool mini; bool blocked; bool animating_mini_change; - bool phantom; bool app; }; diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 88ef6a8..3d026b1 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -961,8 +961,7 @@ void TabStripGtk::TabInsertedAt(TabContents* contents, if (!contains_tab) { TabData d = { tab, gfx::Rect() }; tab_data_.insert(tab_data_.begin() + index, d); - tab->UpdateData(contents, model_->IsPhantomTab(index), - model_->IsAppTab(index), false); + tab->UpdateData(contents, model_->IsAppTab(index), false); } tab->set_mini(model_->IsMiniTab(index)); tab->set_app(model_->IsAppTab(index)); @@ -1023,8 +1022,6 @@ void TabStripGtk::TabMoved(TabContents* contents, tab->set_mini(model_->IsMiniTab(to_index)); tab->SetBlocked(model_->IsTabBlocked(to_index)); tab_data_.insert(tab_data_.begin() + to_index, data); - if (tab->phantom() != model_->IsPhantomTab(to_index)) - tab->set_phantom(!tab->phantom()); GenerateIdealBounds(); StartMoveTabAnimation(from_index, to_index); } @@ -1041,7 +1038,6 @@ void TabStripGtk::TabChangedAt(TabContents* contents, int index, return; } tab->UpdateData(contents, - model_->IsPhantomTab(index), model_->IsAppTab(index), change_type == LOADING_ONLY); tab->UpdateFromModel(); |