summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 23:12:36 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-08 23:12:36 +0000
commite1fbf5bb7ff932edf51c328aaf9c3c8a8a2b7eb7 (patch)
tree7853a5989372ae9acc42b3b6453886acbf28d9a5 /chrome/browser/views/frame
parent57c959f989ccc8f6a9e47190294ee2b9e22c2fb2 (diff)
downloadchromium_src-e1fbf5bb7ff932edf51c328aaf9c3c8a8a2b7eb7.zip
chromium_src-e1fbf5bb7ff932edf51c328aaf9c3c8a8a2b7eb7.tar.gz
chromium_src-e1fbf5bb7ff932edf51c328aaf9c3c8a8a2b7eb7.tar.bz2
Add temporary TabStripWrapper interface that is implemented by both TabStrip and BrowserTabStrip... this makes dealing with the multiple implementations more manageable in shared code like BrowserView, etc. This interface will die once the new work is completed and a conversion is finished. The interface contains all the methods that BrowserView expect to find on TabStrip.
BUG=none TEST=none Review URL: http://codereview.chromium.org/155242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r--chrome/browser/views/frame/browser_frame.h6
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.cc4
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.h4
-rw-r--r--chrome/browser/views/frame/browser_frame_win.cc13
-rw-r--r--chrome/browser/views/frame/browser_frame_win.h5
-rw-r--r--chrome/browser/views/frame/browser_non_client_frame_view.h4
-rw-r--r--chrome/browser/views/frame/browser_root_view.cc24
-rw-r--r--chrome/browser/views/frame/browser_root_view.h6
-rw-r--r--chrome/browser/views/frame/browser_view.cc83
-rw-r--r--chrome/browser/views/frame/browser_view.h11
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.cc7
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.h2
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.cc11
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.h2
14 files changed, 76 insertions, 106 deletions
diff --git a/chrome/browser/views/frame/browser_frame.h b/chrome/browser/views/frame/browser_frame.h
index 4e09619..ca8ae7c 100644
--- a/chrome/browser/views/frame/browser_frame.h
+++ b/chrome/browser/views/frame/browser_frame.h
@@ -10,7 +10,7 @@
class BrowserView;
class Profile;
-class TabStrip;
+class TabStripWrapper;
class ThemeProvider;
namespace gfx {
@@ -40,7 +40,7 @@ class BrowserFrame {
// Notification that the tab strip has been created. This should let the
// BrowserRootView know about it so it can enable drag and drop.
- virtual void TabStripCreated(TabStrip* tabstrip) = 0;
+ virtual void TabStripCreated(TabStripWrapper* tabstrip) = 0;
// Determine the distance of the left edge of the minimize button from the
// left edge of the window. Used in our Non-Client View's Layout.
@@ -48,7 +48,7 @@ class BrowserFrame {
// Retrieves the bounds, in non-client view coordinates for the specified
// TabStrip.
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const = 0;
+ virtual gfx::Rect GetBoundsForTabStrip(TabStripWrapper* tabstrip) const = 0;
// Tells the frame to update the throbber.
virtual void UpdateThrobber(bool running) = 0;
diff --git a/chrome/browser/views/frame/browser_frame_gtk.cc b/chrome/browser/views/frame/browser_frame_gtk.cc
index c3686b2..00486d7 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.cc
+++ b/chrome/browser/views/frame/browser_frame_gtk.cc
@@ -42,7 +42,7 @@ views::Window* BrowserFrameGtk::GetWindow() {
return this;
}
-void BrowserFrameGtk::TabStripCreated(TabStrip* tabstrip) {
+void BrowserFrameGtk::TabStripCreated(TabStripWrapper* tabstrip) {
root_view_->set_tabstrip(tabstrip);
}
@@ -51,7 +51,7 @@ int BrowserFrameGtk::GetMinimizeButtonOffset() const {
return 0;
}
-gfx::Rect BrowserFrameGtk::GetBoundsForTabStrip(TabStrip* tabstrip) const {
+gfx::Rect BrowserFrameGtk::GetBoundsForTabStrip(TabStripWrapper* tabstrip) const {
return browser_frame_view_->GetBoundsForTabStrip(tabstrip);
}
diff --git a/chrome/browser/views/frame/browser_frame_gtk.h b/chrome/browser/views/frame/browser_frame_gtk.h
index 4d0f068..78e9d53 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.h
+++ b/chrome/browser/views/frame/browser_frame_gtk.h
@@ -26,9 +26,9 @@ class BrowserFrameGtk : public BrowserFrame,
// BrowserFrame implementation.
virtual views::Window* GetWindow();
- virtual void TabStripCreated(TabStrip* tabstrip);
+ virtual void TabStripCreated(TabStripWrapper* tabstrip);
virtual int GetMinimizeButtonOffset() const;
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const;
+ virtual gfx::Rect GetBoundsForTabStrip(TabStripWrapper* tabstrip) const;
virtual void UpdateThrobber(bool running);
virtual void ContinueDraggingDetachedTab();
virtual ThemeProvider* GetThemeProviderForFrame() const;
diff --git a/chrome/browser/views/frame/browser_frame_win.cc b/chrome/browser/views/frame/browser_frame_win.cc
index 2f00e20..7543f87 100644
--- a/chrome/browser/views/frame/browser_frame_win.cc
+++ b/chrome/browser/views/frame/browser_frame_win.cc
@@ -64,7 +64,7 @@ views::Window* BrowserFrameWin::GetWindow() {
return this;
}
-void BrowserFrameWin::TabStripCreated(TabStrip* tabstrip) {
+void BrowserFrameWin::TabStripCreated(TabStripWrapper* tabstrip) {
root_view_->set_tabstrip(tabstrip);
}
@@ -80,7 +80,7 @@ int BrowserFrameWin::GetMinimizeButtonOffset() const {
return minimize_button_corner.x;
}
-gfx::Rect BrowserFrameWin::GetBoundsForTabStrip(TabStrip* tabstrip) const {
+gfx::Rect BrowserFrameWin::GetBoundsForTabStrip(TabStripWrapper* tabstrip) const {
return browser_frame_view_->GetBoundsForTabStrip(tabstrip);
}
@@ -139,12 +139,12 @@ void BrowserFrameWin::OnExitSizeMove() {
detached_drag_mode_ = false;
if (drop_tabstrip_) {
gfx::Point screen_point = views::Screen::GetCursorScreenPoint();
- BrowserTabStrip* tabstrip = browser_view_->bts();
+ BrowserTabStrip* tabstrip = browser_view_->tabstrip()->AsBrowserTabStrip();
gfx::Rect tsb = tabstrip->GetDraggedTabScreenBounds(screen_point);
drop_tabstrip_->AttachTab(tabstrip->DetachTab(0), screen_point, tsb);
} else {
UpdateWindowAlphaForTabDragging(detached_drag_mode_);
- browser_view_->bts()->SendDraggedTabHome();
+ browser_view_->tabstrip()->AsBrowserTabStrip()->SendDraggedTabHome();
}
}
}
@@ -278,8 +278,9 @@ void BrowserFrameWin::OnWindowPosChanged(WINDOWPOS* window_pos) {
HWND local_window =
DockInfo::GetLocalProcessWindowAtPoint(screen_point, ignore_windows);
if (local_window) {
- drop_tabstrip_ =
- BrowserView::GetBrowserViewForNativeWindow(local_window)->bts();
+ BrowserView* browser_view =
+ BrowserView::GetBrowserViewForNativeWindow(local_window);
+ drop_tabstrip_ = browser_view->tabstrip()->AsBrowserTabStrip();
if (TabStrip2::IsDragRearrange(drop_tabstrip_, screen_point)) {
ReleaseCapture();
return;
diff --git a/chrome/browser/views/frame/browser_frame_win.h b/chrome/browser/views/frame/browser_frame_win.h
index a355019..5ad12a4 100644
--- a/chrome/browser/views/frame/browser_frame_win.h
+++ b/chrome/browser/views/frame/browser_frame_win.h
@@ -16,7 +16,6 @@ class BrowserTabStrip;
class BrowserView;
class NonClientFrameView;
class Profile;
-class TabStrip;
///////////////////////////////////////////////////////////////////////////////
// BrowserFrameWin
@@ -37,9 +36,9 @@ class BrowserFrameWin : public BrowserFrame, public views::WindowWin {
// BrowserFrame implementation.
virtual views::Window* GetWindow();
- virtual void TabStripCreated(TabStrip* tabstrip);
+ virtual void TabStripCreated(TabStripWrapper* tabstrip);
virtual int GetMinimizeButtonOffset() const;
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const;
+ virtual gfx::Rect GetBoundsForTabStrip(TabStripWrapper* tabstrip) const;
virtual void UpdateThrobber(bool running);
virtual void ContinueDraggingDetachedTab();
virtual ThemeProvider* GetThemeProviderForFrame() const;
diff --git a/chrome/browser/views/frame/browser_non_client_frame_view.h b/chrome/browser/views/frame/browser_non_client_frame_view.h
index 5b87d9e..04a9bf4 100644
--- a/chrome/browser/views/frame/browser_non_client_frame_view.h
+++ b/chrome/browser/views/frame/browser_non_client_frame_view.h
@@ -7,7 +7,7 @@
#include "views/window/non_client_view.h"
-class TabStrip;
+class TabStripWrapper;
// A specialization of the NonClientFrameView object that provides additional
// Browser-specific methods.
@@ -17,7 +17,7 @@ class BrowserNonClientFrameView : public views::NonClientFrameView {
virtual ~BrowserNonClientFrameView() {}
// Returns the bounds within which the TabStrip should be laid out.
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const = 0;
+ virtual gfx::Rect GetBoundsForTabStrip(TabStripWrapper* tabstrip) const = 0;
// Updates the throbber.
virtual void UpdateThrobber(bool running) = 0;
diff --git a/chrome/browser/views/frame/browser_root_view.cc b/chrome/browser/views/frame/browser_root_view.cc
index 86c919c..5e471c6 100644
--- a/chrome/browser/views/frame/browser_root_view.cc
+++ b/chrome/browser/views/frame/browser_root_view.cc
@@ -8,7 +8,7 @@
#include "app/os_exchange_data.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/frame/browser_frame.h"
-#include "chrome/browser/views/tabs/tab_strip.h"
+#include "chrome/browser/views/tabs/tab_strip_wrapper.h"
BrowserRootView::BrowserRootView(views::Widget* widget)
: views::RootView(widget),
@@ -18,7 +18,7 @@ BrowserRootView::BrowserRootView(views::Widget* widget)
}
bool BrowserRootView::CanDrop(const OSExchangeData& data) {
- can_drop_ = (tabstrip_ && tabstrip_->IsVisible() &&
+ can_drop_ = (tabstrip_ && tabstrip_->GetView()->IsVisible() &&
!tabstrip_->IsAnimating() && data.HasURL());
return can_drop_;
}
@@ -27,7 +27,7 @@ void BrowserRootView::OnDragEntered(const views::DropTargetEvent& event) {
if (can_drop_ && ShouldForwardToTabStrip(event)) {
forwarding_to_tab_strip_ = true;
scoped_ptr<views::DropTargetEvent> mapped_event(MapEventToTabStrip(event));
- tabstrip_->OnDragEntered(*mapped_event.get());
+ tabstrip_->GetView()->OnDragEntered(*mapped_event.get());
}
}
@@ -37,13 +37,13 @@ int BrowserRootView::OnDragUpdated(const views::DropTargetEvent& event) {
scoped_ptr<views::DropTargetEvent> mapped_event(
MapEventToTabStrip(event));
if (!forwarding_to_tab_strip_) {
- tabstrip_->OnDragEntered(*mapped_event.get());
+ tabstrip_->GetView()->OnDragEntered(*mapped_event.get());
forwarding_to_tab_strip_ = true;
}
- return tabstrip_->OnDragUpdated(*mapped_event.get());
+ return tabstrip_->GetView()->OnDragUpdated(*mapped_event.get());
} else if (forwarding_to_tab_strip_) {
forwarding_to_tab_strip_ = false;
- tabstrip_->OnDragExited();
+ tabstrip_->GetView()->OnDragExited();
}
}
return DragDropTypes::DRAG_NONE;
@@ -52,7 +52,7 @@ int BrowserRootView::OnDragUpdated(const views::DropTargetEvent& event) {
void BrowserRootView::OnDragExited() {
if (forwarding_to_tab_strip_) {
forwarding_to_tab_strip_ = false;
- tabstrip_->OnDragExited();
+ tabstrip_->GetView()->OnDragExited();
}
}
@@ -61,27 +61,27 @@ int BrowserRootView::OnPerformDrop(const views::DropTargetEvent& event) {
forwarding_to_tab_strip_ = false;
scoped_ptr<views::DropTargetEvent> mapped_event(
MapEventToTabStrip(event));
- return tabstrip_->OnPerformDrop(*mapped_event.get());
+ return tabstrip_->GetView()->OnPerformDrop(*mapped_event.get());
}
return DragDropTypes::DRAG_NONE;
}
bool BrowserRootView::ShouldForwardToTabStrip(
const views::DropTargetEvent& event) {
- if (!tabstrip_->IsVisible())
+ if (!tabstrip_->GetView()->IsVisible())
return false;
// Allow the drop as long as the mouse is over the tabstrip or vertically
// before it.
gfx::Point tab_loc_in_host;
- ConvertPointToView(tabstrip_, this, &tab_loc_in_host);
- return event.y() < tab_loc_in_host.y() + tabstrip_->height();
+ ConvertPointToView(tabstrip_->GetView(), this, &tab_loc_in_host);
+ return event.y() < tab_loc_in_host.y() + tabstrip_->GetView()->height();
}
views::DropTargetEvent* BrowserRootView::MapEventToTabStrip(
const views::DropTargetEvent& event) {
gfx::Point tab_strip_loc(event.location());
- ConvertPointToView(this, tabstrip_, &tab_strip_loc);
+ ConvertPointToView(this, tabstrip_->GetView(), &tab_strip_loc);
return new views::DropTargetEvent(event.GetData(), tab_strip_loc.x(),
tab_strip_loc.y(),
event.GetSourceOperations());
diff --git a/chrome/browser/views/frame/browser_root_view.h b/chrome/browser/views/frame/browser_root_view.h
index a5a2e39f..370ef5f 100644
--- a/chrome/browser/views/frame/browser_root_view.h
+++ b/chrome/browser/views/frame/browser_root_view.h
@@ -8,7 +8,7 @@
#include "views/widget/root_view.h"
class OSExchangeData;
-class TabStrip;
+class TabStripWrapper;
// RootView implementation used by BrowserFrame. This forwards drop events to
// the TabStrip. Visually the tabstrip extends to the top of the frame, but in
@@ -23,7 +23,7 @@ class BrowserRootView : public views::RootView {
// Sets the tabstrip associated with this window. This is used to forward
// drag and drop operations to, so no drops will be accepted if there is no
// tabstrip set.
- void set_tabstrip(TabStrip* tabstrip) { tabstrip_ = tabstrip; }
+ void set_tabstrip(TabStripWrapper* tabstrip) { tabstrip_ = tabstrip; }
virtual bool CanDrop(const OSExchangeData& data);
virtual void OnDragEntered(const views::DropTargetEvent& event);
@@ -41,7 +41,7 @@ class BrowserRootView : public views::RootView {
const views::DropTargetEvent& event);
// The TabStrip.
- TabStrip* tabstrip_;
+ TabStripWrapper* tabstrip_;
// Is a drop allowed? This is set by CanDrop.
bool can_drop_;
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 90b4f23..becc26a 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -431,10 +431,8 @@ int BrowserView::GetTabStripHeight() const {
// We want to return tabstrip_->height(), but we might be called in the midst
// of layout, when that hasn't yet been updated to reflect the current state.
// So return what the tabstrip height _ought_ to be right now.
- views::View* tabstrip =
- TabStrip2::Enabled() ? static_cast<views::View*>(bts_)
- : static_cast<views::View*>(tabstrip_);
- return IsTabStripVisible() ? tabstrip->GetPreferredSize().height() : 0;
+ return IsTabStripVisible() ? tabstrip_->GetView()->GetPreferredSize().height()
+ : 0;
}
gfx::Rect BrowserView::GetTabStripBounds() const {
@@ -945,8 +943,7 @@ void BrowserView::ShowHTMLDialog(HtmlDialogUIDelegate* delegate,
}
void BrowserView::ContinueDraggingDetachedTab(const gfx::Rect& tab_bounds) {
- DCHECK(TabStrip2::Enabled());
- bts_->SetDraggedTabBounds(0, tab_bounds);
+ tabstrip_->SetDraggedTabBounds(0, tab_bounds);
frame_->ContinueDraggingDetachedTab();
}
@@ -1228,7 +1225,7 @@ views::ClientView* BrowserView::CreateClientView(views::Window* window) {
bool BrowserView::CanClose() const {
// You cannot close a frame for which there is an active originating drag
// session.
- if (!TabStrip2::Enabled() && tabstrip_->IsDragSessionActive())
+ if (tabstrip_->IsDragSessionActive())
return false;
// Give beforeunload handlers the chance to cancel the close before we hide
@@ -1286,21 +1283,21 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) {
View::ConvertPointToView(GetParent(), this, &point_in_view_coords);
// See if the mouse pointer is within the bounds of the TabStrip.
- if (!TabStrip2::Enabled()) {
- gfx::Point point_in_tabstrip_coords(point);
- View::ConvertPointToView(GetParent(), tabstrip_, &point_in_tabstrip_coords);
- if (tabstrip_->HitTest(point_in_tabstrip_coords)) {
- if (tabstrip_->PointIsWithinWindowCaption(point_in_tabstrip_coords))
- return HTCAPTION;
- return HTCLIENT;
- }
+ gfx::Point point_in_tabstrip_coords(point);
+ View::ConvertPointToView(GetParent(), tabstrip_->GetView(),
+ &point_in_tabstrip_coords);
+ if (tabstrip_->GetView()->HitTest(point_in_tabstrip_coords)) {
+ if (tabstrip_->PointIsWithinWindowCaption(point_in_tabstrip_coords))
+ return HTCAPTION;
+ return HTCLIENT;
}
// The top few pixels of the TabStrip are a drop-shadow - as we're pretty
// starved of dragable area, let's give it to window dragging (this also
// makes sense visually).
- if (!TabStrip2::Enabled() && !IsMaximized() &&
- (point_in_view_coords.y() < tabstrip_->y() + kTabShadowSize)) {
+ if (!IsMaximized() &&
+ (point_in_view_coords.y() <
+ (tabstrip_->GetView()->y() + kTabShadowSize))) {
// We return HTNOWHERE as this is a signal to our containing
// NonClientView that it should figure out what the correct hit-test
// code is given the mouse position...
@@ -1312,13 +1309,8 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) {
// within the bounds of this view, the point is considered to be within the
// client area.
gfx::Rect bv_bounds = bounds();
- if (TabStrip2::Enabled()) {
- bv_bounds.Offset(0, bts_->y());
- bv_bounds.set_height(bv_bounds.height() - bts_->y());
- } else {
- bv_bounds.Offset(0, toolbar_->y());
- bv_bounds.set_height(bv_bounds.height() - toolbar_->y());
- }
+ bv_bounds.Offset(0, toolbar_->y());
+ bv_bounds.set_height(bv_bounds.height() - toolbar_->y());
if (bv_bounds.Contains(point))
return HTCLIENT;
@@ -1342,14 +1334,11 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) {
}
gfx::Size BrowserView::GetMinimumSize() {
- views::View* tabstrip =
- TabStrip2::Enabled() ? static_cast<views::View*>(bts_)
- : static_cast<views::View*>(tabstrip_);
// TODO(noname): In theory the tabstrip width should probably be
// (OTR + tabstrip + caption buttons) width.
gfx::Size tabstrip_size(
browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP) ?
- tabstrip->GetMinimumSize() : gfx::Size());
+ tabstrip_->GetView()->GetMinimumSize() : gfx::Size());
gfx::Size toolbar_size(
(browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) ||
browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) ?
@@ -1438,16 +1427,10 @@ void BrowserView::Init() {
LoadAccelerators();
SetAccessibleName(l10n_util::GetString(IDS_PRODUCT_NAME));
- if (TabStrip2::Enabled()) {
- bts_ = new BrowserTabStrip(browser_->tabstrip_model());
- AddChildView(bts_);
- } else {
- tabstrip_ = new TabStrip(browser_->tabstrip_model());
- tabstrip_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_TABSTRIP));
- AddChildView(tabstrip_);
- tabstrip_->InitTabStripButtons();
- frame_->TabStripCreated(tabstrip_);
- }
+ tabstrip_ = TabStripWrapper::CreateTabStrip(browser_->tabstrip_model());
+ tabstrip_->GetView()->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_TABSTRIP));
+ AddChildView(tabstrip_->GetView());
+ frame_->TabStripCreated(tabstrip_);
toolbar_ = new ToolbarView(browser_.get());
AddChildView(toolbar_);
@@ -1496,14 +1479,9 @@ void BrowserView::InitSystemMenu() {
int BrowserView::LayoutTabStrip() {
gfx::Rect tabstrip_bounds;
- if (TabStrip2::Enabled()) {
- tabstrip_bounds = gfx::Rect(0, 0, width(),
- bts_->GetPreferredSize().height());
- } else {
- tabstrip_bounds = frame_->GetBoundsForTabStrip(tabstrip_);
- tabstrip_->SetBackgroundOffset(
- gfx::Point(tabstrip_bounds.x(), tabstrip_bounds.y()));
- }
+ tabstrip_bounds = frame_->GetBoundsForTabStrip(tabstrip_);
+ tabstrip_->SetBackgroundOffset(
+ gfx::Point(tabstrip_bounds.x(), tabstrip_bounds.y()));
gfx::Point tabstrip_origin = tabstrip_bounds.origin();
ConvertPointToView(GetParent(), this, &tabstrip_origin);
tabstrip_bounds.set_origin(tabstrip_origin);
@@ -1511,13 +1489,9 @@ int BrowserView::LayoutTabStrip() {
int y = visible ? tabstrip_bounds.y() : 0;
int height = visible ? tabstrip_bounds.height() : 0;
int bottom = y + height;
- if (TabStrip2::Enabled()) {
- gfx::Size btsps = bts_->GetPreferredSize();
- bts_->SetBounds(tabstrip_bounds.x(), y, width(), btsps.height());
- } else {
- tabstrip_->SetVisible(visible);
- tabstrip_->SetBounds(tabstrip_bounds.x(), y, tabstrip_bounds.width(), height);
- }
+ tabstrip_->GetView()->SetVisible(visible);
+ tabstrip_->GetView()->SetBounds(tabstrip_bounds.x(), y,
+ tabstrip_bounds.width(), height);
return bottom;
}
@@ -1834,8 +1808,7 @@ void BrowserView::LoadingAnimationCallback() {
// will return false for fullscreen windows, but we still need to update
// their animations (so that when they come out of fullscreen mode they'll
// be correct).
- if (!TabStrip2::Enabled())
- tabstrip_->UpdateLoadingAnimations();
+ tabstrip_->UpdateLoadingAnimations();
} else if (ShouldShowWindowIcon()) {
// ... or in the window icon area for popups and app windows.
TabContents* tab_contents = browser_->GetSelectedTabContents();
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index c3b48a9..3aaf547 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -31,7 +31,6 @@
class BookmarkBarView;
class Browser;
class BrowserBubble;
-class BrowserTabStrip;
class DownloadShelfView;
class EncodingMenuModel;
class ExtensionShelf;
@@ -41,7 +40,7 @@ class InfoBarContainer;
class LocationBarView;
class StatusBubbleViews;
class TabContentsContainer;
-class TabStrip;
+class TabStripWrapper;
class ToolbarView;
class ZoomMenuModel;
@@ -121,8 +120,7 @@ class BrowserView : public BrowserWindow,
gfx::Rect GetTabStripBounds() const;
// Accessor for the TabStrip.
- TabStrip* tabstrip() const { return tabstrip_; }
- BrowserTabStrip* bts() const { return bts_; }
+ TabStripWrapper* tabstrip() const { return tabstrip_; }
// Accessor for the ExtensionShelf.
ExtensionShelf* extension_shelf() const { return extension_shelf_; }
@@ -396,10 +394,7 @@ class BrowserView : public BrowserWindow,
views::View* active_bookmark_bar_;
// The TabStrip.
- TabStrip* tabstrip_;
-
- // The BrowserTabStrip.
- BrowserTabStrip* bts_;
+ TabStripWrapper* tabstrip_;
// The Toolbar containing the navigation buttons, menus and the address bar.
ToolbarView* toolbar_;
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc
index 48c1695..d7c8139 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/views/frame/glass_browser_frame_view.cc
@@ -9,7 +9,7 @@
#include "app/theme_provider.h"
#include "chrome/browser/browser_theme_provider.h"
#include "chrome/browser/views/frame/browser_view.h"
-#include "chrome/browser/views/tabs/tab_strip.h"
+#include "chrome/browser/views/tabs/tab_strip_wrapper.h"
#include "grit/app_resources.h"
#include "grit/theme_resources.h"
#include "views/window/client_view.h"
@@ -79,7 +79,7 @@ GlassBrowserFrameView::~GlassBrowserFrameView() {
// GlassBrowserFrameView, BrowserNonClientFrameView implementation:
gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip(
- TabStrip* tabstrip) const {
+ TabStripWrapper* tabstrip) const {
int minimize_button_offset = frame_->GetMinimizeButtonOffset();
int tabstrip_x = browser_view_->ShouldShowOffTheRecordAvatar() ?
(otr_avatar_bounds_.right() + kOTRSideSpacing) :
@@ -95,7 +95,8 @@ gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip(
if (UILayoutIsRightToLeft())
tabstrip_width += tabstrip_x;
return gfx::Rect(tabstrip_x, NonClientTopBorderHeight(),
- std::max(0, tabstrip_width), tabstrip->GetPreferredHeight());
+ std::max(0, tabstrip_width),
+ tabstrip->GetPreferredHeight());
}
void GlassBrowserFrameView::UpdateThrobber(bool running) {
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.h b/chrome/browser/views/frame/glass_browser_frame_view.h
index 3700ff1..81e5000 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.h
+++ b/chrome/browser/views/frame/glass_browser_frame_view.h
@@ -20,7 +20,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView {
virtual ~GlassBrowserFrameView();
// Overridden from BrowserNonClientFrameView:
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const;
+ virtual gfx::Rect GetBoundsForTabStrip(TabStripWrapper* tabstrip) const;
virtual void UpdateThrobber(bool running);
// Overridden from views::NonClientFrameView:
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc
index 5c941bd..2d74f05 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/views/frame/browser_frame.h"
#include "chrome/browser/views/frame/browser_view.h"
-#include "chrome/browser/views/tabs/tab_strip.h"
+#include "chrome/browser/views/tabs/tab_strip_wrapper.h"
#include "grit/app_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -200,7 +200,7 @@ OpaqueBrowserFrameView::~OpaqueBrowserFrameView() {
// OpaqueBrowserFrameView, BrowserNonClientFrameView implementation:
gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip(
- TabStrip* tabstrip) const {
+ TabStripWrapper* tabstrip) const {
int tabstrip_x = browser_view_->ShouldShowOffTheRecordAvatar() ?
(otr_avatar_bounds_.right() + kOTRSideSpacing) :
NonClientBorderThickness();
@@ -208,7 +208,8 @@ gfx::Rect OpaqueBrowserFrameView::GetBoundsForTabStrip(
(frame_->GetWindow()->IsMaximized() ?
kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing);
return gfx::Rect(tabstrip_x, NonClientTopBorderHeight(),
- std::max(0, tabstrip_width), tabstrip->GetPreferredHeight());
+ std::max(0, tabstrip_width),
+ tabstrip->GetPreferredHeight());
}
void OpaqueBrowserFrameView::UpdateThrobber(bool running) {
@@ -366,14 +367,14 @@ bool OpaqueBrowserFrameView::HitTest(const gfx::Point& l) const {
return in_nonclient;
// Otherwise claim it only if it's in a non-tab portion of the tabstrip.
- if (l.y() > browser_view_->tabstrip()->bounds().bottom())
+ if (l.y() > browser_view_->tabstrip()->GetView()->bounds().bottom())
return false;
// We convert from our parent's coordinates since we assume we fill its bounds
// completely. We need to do this since we're not a parent of the tabstrip,
// meaning ConvertPointToView would otherwise return something bogus.
gfx::Point tabstrip_point(l);
- View::ConvertPointToView(GetParent(), browser_view_->tabstrip(),
+ View::ConvertPointToView(GetParent(), browser_view_->tabstrip()->GetView(),
&tabstrip_point);
return browser_view_->tabstrip()->PointIsWithinWindowCaption(tabstrip_point);
}
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h
index 4345d8c..3f71560 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.h
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.h
@@ -32,7 +32,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
virtual ~OpaqueBrowserFrameView();
// Overridden from BrowserNonClientFrameView:
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const;
+ virtual gfx::Rect GetBoundsForTabStrip(TabStripWrapper* tabstrip) const;
virtual void UpdateThrobber(bool running);
virtual gfx::Size GetMinimumSize();