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

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 2208973003: Add some extra height to bookmark bar if the font wants to be larger (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call GetPreferredHeight() only once in GetPreferredSize() Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 int alignment = theme_provider.GetDisplayProperty( 134 int alignment = theme_provider.GetDisplayProperty(
135 ThemeProperties::NTP_BACKGROUND_ALIGNMENT); 135 ThemeProperties::NTP_BACKGROUND_ALIGNMENT);
136 136
137 if (bar_attached) 137 if (bar_attached)
138 return ThemeProperties::AlignmentToString(alignment); 138 return ThemeProperties::AlignmentToString(alignment);
139 139
140 if (alignment & ThemeProperties::ALIGN_TOP) { 140 if (alignment & ThemeProperties::ALIGN_TOP) {
141 // The bar is detached, so we must offset the background by the bar size 141 // The bar is detached, so we must offset the background by the bar size
142 // if it's a top-aligned bar. 142 // if it's a top-aligned bar.
Evan Stade 2016/08/17 06:36:35 ruh roh. This is now broken since we aren't hard-c
kylix_rd 2016/08/17 15:39:02 It is only broken if kNTPMinimumBookmarkBarHeight
Evan Stade 2016/08/17 15:47:29 oh wait, that's right, the ntp version is taller a
kylix_rd 2016/08/17 16:13:51 Consistency? A little overzealous? Good question.
143 int offset = chrome::kNTPBookmarkBarHeight; 143 int offset = chrome::kNTPMinimumBookmarkBarHeight;
144 144
145 if (alignment & ThemeProperties::ALIGN_LEFT) 145 if (alignment & ThemeProperties::ALIGN_LEFT)
146 return "left " + base::IntToString(-offset) + "px"; 146 return "left " + base::IntToString(-offset) + "px";
147 else if (alignment & ThemeProperties::ALIGN_RIGHT) 147 else if (alignment & ThemeProperties::ALIGN_RIGHT)
148 return "right " + base::IntToString(-offset) + "px"; 148 return "right " + base::IntToString(-offset) + "px";
149 return "center " + base::IntToString(-offset) + "px"; 149 return "center " + base::IntToString(-offset) + "px";
150 } 150 }
151 151
152 return ThemeProperties::AlignmentToString(alignment); 152 return ThemeProperties::AlignmentToString(alignment);
153 } 153 }
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 // Get our template. 603 // Get our template.
604 static const base::StringPiece new_tab_theme_css( 604 static const base::StringPiece new_tab_theme_css(
605 ResourceBundle::GetSharedInstance().GetRawDataResource( 605 ResourceBundle::GetSharedInstance().GetRawDataResource(
606 IDR_NEW_TAB_4_THEME_CSS)); 606 IDR_NEW_TAB_4_THEME_CSS));
607 607
608 // Create the string from our template and the replacements. 608 // Create the string from our template and the replacements.
609 std::string css_string = 609 std::string css_string =
610 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions); 610 ui::ReplaceTemplateExpressions(new_tab_theme_css, substitutions);
611 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 611 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
612 } 612 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698