Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3740)

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1906563002: [WIP] Fire a theme changed notification when device scan completes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Recalculate tab and new tab button sizes Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | ui/base/material_design/material_design_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 1303b262410f73ae1ef9986eb74151b4aec637f8..6620532bd0439b0bf8c661d31739683ee183aece 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -252,8 +252,9 @@ TabDragController::EventSource EventSourceFromEvent(
const TabSizeInfo& GetTabSizeInfo() {
static TabSizeInfo* tab_size_info = nullptr;
- if (tab_size_info)
- return *tab_size_info;
+
+// if (tab_size_info)
+// return *tab_size_info;
tdanderson 2016/05/02 18:55:44 Turns out the source of the incorrect drawing was
tab_size_info = new TabSizeInfo;
tab_size_info->pinned_tab_width = Tab::GetPinnedWidth();
@@ -1712,8 +1713,7 @@ void TabStrip::Init() {
// So we get enter/exit on children to switch stacked layout on and off.
set_notify_enter_exit_on_child(true);
- newtab_button_bounds_.set_size(GetLayoutSize(NEW_TAB_BUTTON));
- newtab_button_bounds_.Inset(0, 0, 0, -GetNewTabButtonTopOffset());
+ CalculateNewTabButtonSize();
newtab_button_ = new NewTabButton(this, this);
newtab_button_->SetTooltipText(
l10n_util::GetStringUTF16(IDS_TOOLTIP_NEW_TAB));
@@ -2508,6 +2508,7 @@ void TabStrip::GenerateIdealBounds() {
tabs_.set_ideal_bounds(i, tabs_bounds[i]);
}
+ CalculateNewTabButtonSize();
tdanderson 2016/05/02 18:55:44 Same problem: the new tab button dimensions are ca
const int max_new_tab_x = width() - newtab_button_bounds_.width();
// For non-stacked tabs the ideal bounds may go outside the bounds of the
// tabstrip. Constrain the x-coordinate of the new tab button so that it is
@@ -2521,6 +2522,11 @@ void TabStrip::GenerateIdealBounds() {
FOR_EACH_OBSERVER(TabStripObserver, observers_, TabStripMaxXChanged(this));
}
+void TabStrip::CalculateNewTabButtonSize() {
+ newtab_button_bounds_.set_size(GetLayoutSize(NEW_TAB_BUTTON));
+ newtab_button_bounds_.Inset(0, 0, 0, -GetNewTabButtonTopOffset());
+}
+
int TabStrip::GenerateIdealBoundsForPinnedTabs(int* first_non_pinned_index) {
const int num_pinned_tabs = GetPinnedTabCount();
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | ui/base/material_design/material_design_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698