summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 02:00:12 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 02:00:12 +0000
commitdad7d806d4eaded841d17ef50050b06c91a8d545 (patch)
tree283d5ddf0e5503b63eb08962081824e505e9c14a /chrome/browser
parentb5248e5fddcef1b6bbc175b8c9c13e6023bc96b0 (diff)
downloadchromium_src-dad7d806d4eaded841d17ef50050b06c91a8d545.zip
chromium_src-dad7d806d4eaded841d17ef50050b06c91a8d545.tar.gz
chromium_src-dad7d806d4eaded841d17ef50050b06c91a8d545.tar.bz2
Implement App Tabs for GTK
BUG=45540 TEST=none Review URL: http://codereview.chromium.org/2824044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_gtk.cc5
-rw-r--r--chrome/browser/gtk/tabs/tab_gtk.cc3
-rw-r--r--chrome/browser/gtk/tabs/tab_gtk.h1
-rw-r--r--chrome/browser/gtk/tabs/tab_renderer_gtk.cc135
-rw-r--r--chrome/browser/gtk/tabs/tab_renderer_gtk.h13
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc8
-rw-r--r--chrome/browser/tab_contents/tab_contents.h4
-rw-r--r--chrome/browser/views/tabs/tab_strip.cc31
-rw-r--r--chrome/browser/views/tabs/tab_strip.h12
9 files changed, 132 insertions, 80 deletions
diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc
index 52cb110..9b54934 100644
--- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc
+++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc
@@ -54,7 +54,10 @@ DraggedTabGtk::DraggedTabGtk(TabContents* datasource,
attached_tab_size_(TabRendererGtk::GetMinimumSelectedSize()),
contents_size_(contents_size),
close_animation_(this) {
- renderer_->UpdateData(datasource, false, false);
+ renderer_->UpdateData(datasource,
+ false, // phantom
+ datasource->is_app(),
+ false); // loading_only
renderer_->set_mini(mini);
container_ = gtk_window_new(GTK_WINDOW_POPUP);
diff --git a/chrome/browser/gtk/tabs/tab_gtk.cc b/chrome/browser/gtk/tabs/tab_gtk.cc
index b2f8c39..7383a5e 100644
--- a/chrome/browser/gtk/tabs/tab_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_gtk.cc
@@ -320,8 +320,9 @@ void TabGtk::CloseButtonClicked() {
void TabGtk::UpdateData(TabContents* contents,
bool phantom,
+ bool app,
bool loading_only) {
- TabRendererGtk::UpdateData(contents, phantom, loading_only);
+ TabRendererGtk::UpdateData(contents, phantom, 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 8bd5f5a..6630780 100644
--- a/chrome/browser/gtk/tabs/tab_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_gtk.h
@@ -101,6 +101,7 @@ class TabGtk : public TabRendererGtk,
virtual void CloseButtonClicked();
virtual void UpdateData(TabContents* contents,
bool phantom,
+ bool app,
bool loading_only);
virtual void SetBounds(const gfx::Rect& bounds);
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
index 83f92e1..cc6ea8f 100644
--- a/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.cc
@@ -128,8 +128,11 @@ TabRendererGtk::LoadingAnimation::Data::Data(
bool TabRendererGtk::initialized_ = false;
TabRendererGtk::TabImage TabRendererGtk::tab_active_ = {0};
+TabRendererGtk::TabImage TabRendererGtk::tab_active_nano_ = {0};
TabRendererGtk::TabImage TabRendererGtk::tab_inactive_ = {0};
+TabRendererGtk::TabImage TabRendererGtk::tab_inactive_nano_ = {0};
TabRendererGtk::TabImage TabRendererGtk::tab_alpha_ = {0};
+TabRendererGtk::TabImage TabRendererGtk::tab_alpha_nano_ = {0};
gfx::Font* TabRendererGtk::title_font_ = NULL;
int TabRendererGtk::title_font_height_ = 0;
int TabRendererGtk::close_button_width_ = 0;
@@ -275,17 +278,24 @@ TabRendererGtk::~TabRendererGtk() {
void TabRendererGtk::UpdateData(TabContents* contents,
bool phantom,
+ bool app,
bool loading_only) {
DCHECK(contents);
-
theme_provider_ = GtkThemeProvider::GetFrom(contents->profile());
if (!loading_only) {
data_.title = contents->GetTitle();
data_.off_the_record = contents->profile()->IsOffTheRecord();
data_.crashed = contents->is_crashed();
- data_.favicon = contents->GetFavIcon();
+
+ SkBitmap* app_icon = contents->GetExtensionAppIcon();
+ if (app_icon)
+ data_.favicon = *app_icon;
+ 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
// be a good bit of work and would sully code for other platforms which
@@ -381,11 +391,18 @@ void TabRendererGtk::PaintFavIconArea(GdkEventExpose* event) {
if (!theme_provider_->HasCustomImage(theme_id))
offset_y = background_offset_y_;
}
+
+ // If the tab is a nanotab, we must take care to only draw the background
+ // within the height of the nanotab.
+ int nanoTabOffset = data_.app ? 9 : 0;
SkBitmap* tab_bg = theme_provider_->GetBitmapNamed(theme_id);
canvas.TileImageInt(*tab_bg,
- x() + favicon_bounds_.x(), offset_y + favicon_bounds_.y(),
- favicon_bounds_.x(), favicon_bounds_.y(),
- favicon_bounds_.width(), favicon_bounds_.height());
+ x() + favicon_bounds_.x(),
+ offset_y + favicon_bounds_.y() + nanoTabOffset,
+ favicon_bounds_.x(),
+ favicon_bounds_.y() + nanoTabOffset,
+ favicon_bounds_.width(),
+ favicon_bounds_.height() - nanoTabOffset);
if (!IsSelected()) {
double throb_value = GetThrobValue();
@@ -455,18 +472,37 @@ void TabRendererGtk::LoadTabImages() {
tab_alpha_.image_l = rb.GetBitmapNamed(IDR_TAB_ALPHA_LEFT);
tab_alpha_.image_r = rb.GetBitmapNamed(IDR_TAB_ALPHA_RIGHT);
+ tab_alpha_nano_.image_l = rb.GetBitmapNamed(IDR_TAB_ALPHA_NANO_LEFT);
+ tab_alpha_nano_.image_r = rb.GetBitmapNamed(IDR_TAB_ALPHA_NANO_RIGHT);
+
tab_active_.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_LEFT);
tab_active_.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_CENTER);
tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT);
tab_active_.l_width = tab_active_.image_l->width();
tab_active_.r_width = tab_active_.image_r->width();
+ const int kNanoTabDiffHeight = 13;
+
+ tab_active_nano_.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_LEFT);
+ tab_active_nano_.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_CENTER);
+ tab_active_nano_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_NANO_RIGHT);
+ tab_active_nano_.l_width = tab_active_nano_.image_l->width();
+ tab_active_nano_.r_width = tab_active_nano_.image_r->width();
+ tab_active_nano_.y_offset = kNanoTabDiffHeight;
+
tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT);
tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER);
tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT);
tab_inactive_.l_width = tab_inactive_.image_l->width();
tab_inactive_.r_width = tab_inactive_.image_r->width();
+ tab_inactive_nano_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_NANO_LEFT);
+ tab_inactive_nano_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_NANO_CENTER);
+ tab_inactive_nano_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_NANO_RIGHT);
+ tab_inactive_nano_.l_width = tab_inactive_.image_l->width();
+ tab_inactive_nano_.r_width = tab_inactive_.image_r->width();
+ tab_inactive_nano_.y_offset = kNanoTabDiffHeight;
+
close_button_width_ = rb.GetBitmapNamed(IDR_TAB_CLOSE)->width();
close_button_height_ = rb.GetBitmapNamed(IDR_TAB_CLOSE)->height();
}
@@ -822,14 +858,25 @@ void TabRendererGtk::PaintIcon(gfx::Canvas* canvas) {
favicon, favicon_bounds_.x(),
favicon_bounds_.y() + fav_icon_hiding_offset_);
} else {
+ // If the favicon is an app icon, it is allowed to be drawn slightly
+ // larger than the standard favicon.
+ int favIconHeightOffset = data_.app ? -2 : 0;
+ int favIconWidthDelta = data_.app ?
+ data_.favicon.width() - kFavIconSize : 0;
+ int favIconHeightDelta = data_.app ?
+ data_.favicon.height() - kFavIconSize : 0;
+
// TODO(pkasting): Use code in tab_icon_view.cc:PaintIcon() (or switch
// to using that class to render the favicon).
canvas->DrawBitmapInt(data_.favicon, 0, 0,
data_.favicon.width(),
data_.favicon.height(),
- favicon_bounds_.x(),
- favicon_bounds_.y() + fav_icon_hiding_offset_,
- kFavIconSize, kFavIconSize,
+ favicon_bounds_.x() - favIconWidthDelta/2,
+ favicon_bounds_.y() + favIconHeightOffset
+ - favIconHeightDelta/2
+ + fav_icon_hiding_offset_,
+ kFavIconSize + favIconWidthDelta,
+ kFavIconSize + favIconHeightDelta,
true);
}
}
@@ -868,6 +915,12 @@ void TabRendererGtk::PaintInactiveTabBackground(gfx::Canvas* canvas) {
SkBitmap* tab_bg = theme_provider_->GetBitmapNamed(tab_id);
+ // App tabs are drawn slightly differently (as nano tabs).
+ TabImage* tab_image = data_.app ? &tab_active_nano_ : &tab_active_;
+ TabImage* tab_inactive_image = data_.app ? &tab_inactive_nano_ :
+ &tab_inactive_;
+ TabImage* alpha = data_.app ? &tab_alpha_nano_ : &tab_alpha_;
+
// If the theme is providing a custom background image, then its top edge
// should be at the top of the tab. Otherwise, we assume that the background
// image is a composited foreground + frame image.
@@ -875,27 +928,35 @@ void TabRendererGtk::PaintInactiveTabBackground(gfx::Canvas* canvas) {
0 : background_offset_y_;
// Draw left edge.
- SkBitmap* theme_l = GetMaskedBitmap(tab_alpha_.image_l, tab_bg, offset_x,
+ SkBitmap* theme_l = GetMaskedBitmap(alpha->image_l, tab_bg, offset_x,
offset_y);
canvas->DrawBitmapInt(*theme_l, 0, 0);
// Draw right edge.
- SkBitmap* theme_r = GetMaskedBitmap(tab_alpha_.image_r, tab_bg,
- offset_x + width() - tab_active_.r_width, offset_y);
+ SkBitmap* theme_r = GetMaskedBitmap(alpha->image_r, tab_bg,
+ offset_x + width() - tab_image->r_width, offset_y);
canvas->DrawBitmapInt(*theme_r, width() - theme_r->width(), 0);
// Draw center.
- canvas->TileImageInt(*tab_bg,
- offset_x + tab_active_.l_width, kDropShadowOffset + offset_y,
- tab_active_.l_width, 2,
- width() - tab_active_.l_width - tab_active_.r_width, height() - 2);
-
- canvas->DrawBitmapInt(*tab_inactive_.image_l, 0, 0);
- canvas->TileImageInt(*tab_inactive_.image_c, tab_inactive_.l_width, 0,
- width() - tab_inactive_.l_width - tab_inactive_.r_width, height());
- canvas->DrawBitmapInt(*tab_inactive_.image_r,
- width() - tab_inactive_.r_width, 0);
+ canvas->TileImageInt(
+ *tab_bg,
+ offset_x + tab_image->l_width,
+ kDropShadowOffset + offset_y + tab_image->y_offset,
+ tab_image->l_width,
+ kDropShadowHeight + tab_image->y_offset,
+ width() - tab_image->l_width - tab_image->r_width,
+ height() - kDropShadowHeight - tab_image->y_offset);
+
+ canvas->DrawBitmapInt(*tab_inactive_image->image_l, 0, 0);
+ canvas->TileImageInt(
+ *tab_inactive_image->image_c,
+ tab_inactive_image->l_width,
+ 0,
+ width() - tab_inactive_image->l_width - tab_inactive_image->r_width,
+ height());
+ canvas->DrawBitmapInt(*tab_inactive_image->image_r,
+ width() - tab_inactive_image->r_width, 0);
}
void TabRendererGtk::PaintActiveTabBackground(gfx::Canvas* canvas) {
@@ -903,26 +964,32 @@ void TabRendererGtk::PaintActiveTabBackground(gfx::Canvas* canvas) {
SkBitmap* tab_bg = theme_provider_->GetBitmapNamed(IDR_THEME_TOOLBAR);
+ // App tabs are drawn slightly differently (as nano tabs).
+ TabImage* tab_image = data_.app ? &tab_active_nano_ : &tab_active_;
+ TabImage* alpha = data_.app ? &tab_alpha_nano_ : &tab_alpha_;
+
// Draw left edge.
- SkBitmap* theme_l = GetMaskedBitmap(tab_alpha_.image_l, tab_bg, offset_x, 0);
+ SkBitmap* theme_l = GetMaskedBitmap(alpha->image_l, tab_bg, offset_x, 0);
canvas->DrawBitmapInt(*theme_l, 0, 0);
// Draw right edge.
- SkBitmap* theme_r = GetMaskedBitmap(tab_alpha_.image_r, tab_bg,
- offset_x + width() - tab_active_.r_width, 0);
- canvas->DrawBitmapInt(*theme_r, width() - tab_active_.r_width, 0);
+ SkBitmap* theme_r = GetMaskedBitmap(alpha->image_r, tab_bg,
+ offset_x + width() - tab_image->r_width, 0);
+ canvas->DrawBitmapInt(*theme_r, width() - tab_image->r_width, 0);
// Draw center.
canvas->TileImageInt(*tab_bg,
- offset_x + tab_active_.l_width, kDropShadowHeight,
- tab_active_.l_width, kDropShadowHeight,
- width() - tab_active_.l_width - tab_active_.r_width,
- height() - kDropShadowHeight);
-
- canvas->DrawBitmapInt(*tab_active_.image_l, 0, 0);
- canvas->TileImageInt(*tab_active_.image_c, tab_active_.l_width, 0,
- width() - tab_active_.l_width - tab_active_.r_width, height());
- canvas->DrawBitmapInt(*tab_active_.image_r, width() - tab_active_.r_width, 0);
+ offset_x + tab_image->l_width,
+ kDropShadowHeight + tab_image->y_offset,
+ tab_image->l_width,
+ kDropShadowHeight + tab_image->y_offset,
+ width() - tab_image->l_width - tab_image->r_width,
+ height() - kDropShadowHeight - tab_image->y_offset);
+
+ canvas->DrawBitmapInt(*tab_image->image_l, 0, 0);
+ canvas->TileImageInt(*tab_image->image_c, tab_image->l_width, 0,
+ width() - tab_image->l_width - tab_image->r_width, height());
+ canvas->DrawBitmapInt(*tab_image->image_r, width() - tab_image->r_width, 0);
}
void TabRendererGtk::PaintLoadingAnimation(gfx::Canvas* canvas) {
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.h b/chrome/browser/gtk/tabs/tab_renderer_gtk.h
index e666506..4c168a7 100644
--- a/chrome/browser/gtk/tabs/tab_renderer_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.h
@@ -105,6 +105,7 @@ class TabRendererGtk : public AnimationDelegate,
// update everything.
virtual void UpdateData(TabContents* contents,
bool phantom,
+ bool app,
bool loading_only);
// Sets the blocked state of the tab.
@@ -119,6 +120,10 @@ class TabRendererGtk : public AnimationDelegate,
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; }
+
// Are we in the process of animating a mini tab state change on this tab?
void set_animating_mini_change(bool value) {
data_.animating_mini_change = value;
@@ -257,7 +262,8 @@ class TabRendererGtk : public AnimationDelegate,
mini(false),
blocked(false),
animating_mini_change(false),
- phantom(false) {
+ phantom(false),
+ app(false) {
}
SkBitmap favicon;
@@ -271,6 +277,7 @@ class TabRendererGtk : public AnimationDelegate,
bool blocked;
bool animating_mini_change;
bool phantom;
+ bool app;
};
// TODO(jhawkins): Move into TabResources class.
@@ -280,6 +287,7 @@ class TabRendererGtk : public AnimationDelegate,
SkBitmap* image_r;
int l_width;
int r_width;
+ int y_offset;
};
// Overridden from AnimationDelegate:
@@ -376,8 +384,11 @@ class TabRendererGtk : public AnimationDelegate,
TabData data_;
static TabImage tab_active_;
+ static TabImage tab_active_nano_;
static TabImage tab_inactive_;
+ static TabImage tab_inactive_nano_;
static TabImage tab_alpha_;
+ static TabImage tab_alpha_nano_;
static gfx::Font* title_font_;
static int title_font_height_;
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index 0a86cb8..82b2bd8 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -960,9 +960,11 @@ 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), false);
+ tab->UpdateData(contents, model_->IsPhantomTab(index),
+ model_->IsAppTab(index), false);
}
tab->set_mini(model_->IsMiniTab(index));
+ tab->set_app(model_->IsAppTab(index));
tab->SetBlocked(model_->IsTabBlocked(index));
if (gtk_widget_get_parent(tab->widget()) != tabstrip_.get())
@@ -1037,7 +1039,9 @@ void TabStripGtk::TabChangedAt(TabContents* contents, int index,
// We'll receive another notification of the change asynchronously.
return;
}
- tab->UpdateData(contents, model_->IsPhantomTab(index),
+ tab->UpdateData(contents,
+ model_->IsPhantomTab(index),
+ model_->IsAppTab(index),
change_type == LOADING_ONLY);
tab->UpdateFromModel();
}
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 54a8f39..ac114bc 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -210,9 +210,7 @@ class TabContents : public PageNavigator,
bool is_app() const { return extension_app_ != NULL; }
// If an app extension has been explicitly set for this TabContents its icon
- // is returned. If an app extension has not been set but there is an
- // extension whose extent contains the url of the current page it's icon
- // is returned. Otherwise an empty icon is returned.
+ // is returned.
//
// NOTE: the returned icon is larger than 16x16 (it's size is
// Extension::EXTENSION_ICON_SMALLISH).
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index 4b61bb5..3054e0a 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -121,9 +121,6 @@ class NewTabButton : public views::ImageButton {
// static
const int TabStrip::mini_to_non_mini_gap_ = 3;
-// static
-const int TabStrip::extra_gap_for_nano_ = 10;
-
TabStrip::TabStrip(TabStripController* controller)
: BaseTabStrip(controller, BaseTabStrip::HORIZONTAL_TAB_STRIP),
resize_layout_factory_(this),
@@ -657,11 +654,9 @@ void TabStrip::GetCurrentTabWidths(double* unselected_width,
void TabStrip::GetDesiredTabWidths(int tab_count,
int mini_tab_count,
- int nano_tab_count,
double* unselected_width,
double* selected_width) const {
DCHECK(tab_count >= 0 && mini_tab_count >= 0 && mini_tab_count <= tab_count);
- DCHECK(nano_tab_count >= 0 && nano_tab_count <= tab_count);
const double min_unselected_width = Tab::GetMinimumUnselectedSize().width();
const double min_selected_width = Tab::GetMinimumSelectedSize().width();
@@ -700,9 +695,6 @@ void TabStrip::GetDesiredTabWidths(int tab_count,
}
// Account for gap between the last mini-tab and first non-mini-tab.
available_width -= mini_to_non_mini_gap_;
- // And add some extra space if you have nano tabs in the mix.
- if (nano_tab_count > 0)
- available_width -= extra_gap_for_nano_;
}
// Calculate the desired tab widths by dividing the available space into equal
@@ -763,8 +755,7 @@ void TabStrip::ResizeLayoutTabs() {
}
Tab* first_tab = GetTabAtTabDataIndex(mini_tab_count);
double unselected, selected;
- GetDesiredTabWidths(tab_count(), mini_tab_count, GetNanoTabCount(),
- &unselected, &selected);
+ GetDesiredTabWidths(tab_count(), mini_tab_count, &unselected, &selected);
int w = Round(first_tab->IsSelected() ? selected : selected);
// We only want to run the animation if we're not already at the desired
@@ -969,21 +960,18 @@ TabStrip::DropInfo::~DropInfo() {
void TabStrip::GenerateIdealBounds() {
int non_closing_tab_count = 0;
int mini_tab_count = 0;
- int nano_tab_count = 0;
for (int i = 0; i < tab_count(); ++i) {
BaseTab* tab = base_tab_at_tab_index(i);
if (!tab->closing()) {
++non_closing_tab_count;
if (tab->data().mini)
mini_tab_count++;
- if (tab->data().app)
- nano_tab_count++;
}
}
double unselected, selected;
- GetDesiredTabWidths(non_closing_tab_count, mini_tab_count, nano_tab_count,
- &unselected, &selected);
+ GetDesiredTabWidths(non_closing_tab_count, mini_tab_count, &unselected,
+ &selected);
current_unselected_width_ = unselected;
current_selected_width_ = selected;
@@ -1003,8 +991,6 @@ void TabStrip::GenerateIdealBounds() {
if (last_was_mini) {
// Give a bigger gap between mini and non-mini tabs.
tab_x += mini_to_non_mini_gap_;
- if (nano_tab_count > 0)
- tab_x += extra_gap_for_nano_;
}
if (tab->IsSelected())
tab_width = selected;
@@ -1118,17 +1104,6 @@ int TabStrip::GetMiniTabCount() const {
return mini_count;
}
-int TabStrip::GetNanoTabCount() const {
- int nano_count = 0;
- for (int i = 0; i < tab_count(); ++i) {
- if (base_tab_at_tab_index(i)->data().app)
- nano_count++;
- else
- return nano_count;
- }
- return nano_count;
-}
-
int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const {
return last_tab->x() + last_tab->width();
}
diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h
index a88a247..92ba7f9 100644
--- a/chrome/browser/views/tabs/tab_strip.h
+++ b/chrome/browser/views/tabs/tab_strip.h
@@ -122,10 +122,6 @@ class TabStrip : public BaseTabStrip,
// Horizontal gap between mini and non-mini-tabs.
static const int mini_to_non_mini_gap_;
- // Extra horizontal gap (on top of mini_to_non_mini_gap_) when one of the
- // mini tabs is a nano tab.
- static const int extra_gap_for_nano_;
-
private:
friend class DraggedTabController;
@@ -181,9 +177,6 @@ class TabStrip : public BaseTabStrip,
// Returns the number of mini-tabs.
int GetMiniTabCount() const;
- // Returns the number of nano-tabs.
- int GetNanoTabCount() const;
-
// -- Tab Resize Layout -----------------------------------------------------
// Returns the exact (unrounded) current width of each tab.
@@ -194,11 +187,10 @@ class TabStrip : public BaseTabStrip,
// desired strip width and number of tabs. If
// |width_of_tabs_for_mouse_close_| is nonnegative we use that value in
// calculating the desired strip width; otherwise we use the current width.
- // |mini_tab_count| gives the number of mini-tabs, |nano_tab_count| the
- // number of mini-tabs and |tab_count| the number of mini and non-mini-tabs.
+ // |mini_tab_count| gives the number of mini-tabs and |tab_count| the number
+ // of mini and non-mini-tabs.
void GetDesiredTabWidths(int tab_count,
int mini_tab_count,
- int nano_tab_count,
double* unselected_width,
double* selected_width) const;