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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 12013004: alternate ntp: unpinned bookmark bar in ntp (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
Index: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index a724305e4f9224c7407f3232b613ab6d560472f4..04f9c5ecedcf47214b3781f880685ed531fa50c6 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -120,8 +120,7 @@ SkColor GetThemeColor(ui::ThemeProvider* tp, int id) {
// Get the CSS string for the background position on the new tab page for the
// states when the bar is attached or detached.
std::string GetNewTabBackgroundCSS(const ui::ThemeProvider* theme_provider,
- bool bar_attached,
- bool is_ntp_search) {
+ bool bar_attached) {
int alignment;
theme_provider->GetDisplayProperty(
ThemeService::NTP_BACKGROUND_ALIGNMENT, &alignment);
@@ -134,12 +133,7 @@ std::string GetNewTabBackgroundCSS(const ui::ThemeProvider* theme_provider,
return "-64px";
}
- // For instant extended API i.e. |is_ntp_search| is true, bookmark bar is
- // always detached at bottom of content view in the y-direction, floating on
- // top of it in the z-order, and not showing any part of the theme background
- // image, so the content view should show the entire theme background image as
- // is, with no vertical offset.
- if (bar_attached || is_ntp_search)
+ if (bar_attached)
return ThemeService::AlignmentToString(alignment);
if (alignment & ThemeService::ALIGN_TOP) {
@@ -481,12 +475,10 @@ void NTPResourceCache::CreateNewTabIncognitoCSS() {
subst.push_back(
profile_->GetPrefs()->GetString(prefs::kCurrentThemeID)); // $1
- bool is_ntp_search = chrome::search::IsInstantExtendedAPIEnabled(profile_);
-
// Colors.
subst.push_back(SkColorToRGBAString(color_background)); // $2
- subst.push_back(GetNewTabBackgroundCSS(tp, false, is_ntp_search)); // $3
- subst.push_back(GetNewTabBackgroundCSS(tp, true, is_ntp_search)); // $4
+ subst.push_back(GetNewTabBackgroundCSS(tp, false)); // $3
+ subst.push_back(GetNewTabBackgroundCSS(tp, true)); // $4
subst.push_back(GetNewTabBackgroundTilingCSS(tp)); // $5
// Get our template.
@@ -557,12 +549,10 @@ void NTPResourceCache::CreateNewTabCSS() {
subst.push_back(
profile_->GetPrefs()->GetString(prefs::kCurrentThemeID)); // $1
- bool is_ntp_search = chrome::search::IsInstantExtendedAPIEnabled(profile_);
-
// Colors.
subst.push_back(SkColorToRGBAString(color_background)); // $2
- subst.push_back(GetNewTabBackgroundCSS(tp, false, is_ntp_search)); // $3
- subst.push_back(GetNewTabBackgroundCSS(tp, true, is_ntp_search)); // $4
+ subst.push_back(GetNewTabBackgroundCSS(tp, false)); // $3
+ subst.push_back(GetNewTabBackgroundCSS(tp, true)); // $4
subst.push_back(GetNewTabBackgroundTilingCSS(tp)); // $5
subst.push_back(SkColorToRGBAString(color_header)); // $6
subst.push_back(SkColorToRGBAString(color_header_gradient_light)); // $7
@@ -588,7 +578,8 @@ void NTPResourceCache::CreateNewTabCSS() {
// Get our template.
static const base::StringPiece new_tab_theme_css(
- ResourceBundle::GetSharedInstance().GetRawDataResource(is_ntp_search ?
+ ResourceBundle::GetSharedInstance().GetRawDataResource(
+ chrome::search::IsInstantExtendedAPIEnabled(profile_) ?
IDR_NEW_TAB_SEARCH_THEME_CSS : IDR_NEW_TAB_4_THEME_CSS));
// Create the string from our template and the replacements.
« no previous file with comments | « chrome/browser/ui/views/frame/instant_preview_controller_views.cc ('k') | ui/views/controls/button/text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698