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

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

Issue 7647001: ntp4: attribution tweak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 else 378 else
379 localized_strings.SetString("syncispresent", "false"); 379 localized_strings.SetString("syncispresent", "false");
380 380
381 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings); 381 ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
382 382
383 // Control fade and resize animations. 383 // Control fade and resize animations.
384 std::string anim = 384 std::string anim =
385 ui::Animation::ShouldRenderRichAnimation() ? "true" : "false"; 385 ui::Animation::ShouldRenderRichAnimation() ? "true" : "false";
386 localized_strings.SetString("anim", anim); 386 localized_strings.SetString("anim", anim);
387 387
388 int alignment;
389 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
390 tp->GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT, &alignment);
391 if (alignment & ThemeService::ALIGN_RIGHT)
392 localized_strings.SetString("themegravity", "right");
393
388 // Pass the shown_sections pref early so that we can prevent flicker. 394 // Pass the shown_sections pref early so that we can prevent flicker.
389 const int shown_sections = ShownSectionsHandler::GetShownSections( 395 const int shown_sections = ShownSectionsHandler::GetShownSections(
390 profile_->GetPrefs()); 396 profile_->GetPrefs());
391 localized_strings.SetInteger("shown_sections", shown_sections); 397 localized_strings.SetInteger("shown_sections", shown_sections);
392 398
393 // If the user has preferences for a start and end time for a custom logo, 399 // If the user has preferences for a start and end time for a custom logo,
394 // and the time now is between these two times, show the custom logo. 400 // and the time now is between these two times, show the custom logo.
395 if (profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoStart) && 401 if (profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoStart) &&
396 profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoEnd)) { 402 profile_->GetPrefs()->FindPreference(prefs::kNTPCustomLogoEnd)) {
397 localized_strings.SetString("customlogo", 403 localized_strings.SetString("customlogo",
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 IDR_NEW_TAB_4_THEME_CSS : IDR_NEW_TAB_THEME_CSS; 581 IDR_NEW_TAB_4_THEME_CSS : IDR_NEW_TAB_THEME_CSS;
576 static const base::StringPiece new_tab_theme_css( 582 static const base::StringPiece new_tab_theme_css(
577 ResourceBundle::GetSharedInstance().GetRawDataResource( 583 ResourceBundle::GetSharedInstance().GetRawDataResource(
578 ntp_css_resource_id)); 584 ntp_css_resource_id));
579 585
580 // Create the string from our template and the replacements. 586 // Create the string from our template and the replacements.
581 std::string css_string; 587 std::string css_string;
582 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 588 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
583 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 589 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
584 } 590 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698