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

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

Issue 10836099: Support for promo_type. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review feedback Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 load_time_data.SetBoolean("anim", ui::Animation::ShouldRenderRichAnimation()); 403 load_time_data.SetBoolean("anim", ui::Animation::ShouldRenderRichAnimation());
404 404
405 int alignment; 405 int alignment;
406 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_); 406 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
407 tp->GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT, &alignment); 407 tp->GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT, &alignment);
408 load_time_data.SetString("themegravity", 408 load_time_data.SetString("themegravity",
409 (alignment & ThemeService::ALIGN_RIGHT) ? "right" : ""); 409 (alignment & ThemeService::ALIGN_RIGHT) ? "right" : "");
410 410
411 // Set the promo string for display if there is a valid outstanding promo. 411 // Set the promo string for display if there is a valid outstanding promo.
412 NotificationPromo notification_promo(profile_); 412 NotificationPromo notification_promo(profile_);
413 notification_promo.InitFromPrefs(); 413 notification_promo.InitFromPrefs(NotificationPromo::NTP_NOTIFICATION_PROMO);
414 if (notification_promo.CanShow()) 414 if (notification_promo.CanShow())
415 load_time_data.SetString("serverpromo", notification_promo.promo_text()); 415 load_time_data.SetString("serverpromo", notification_promo.promo_text());
416 416
417 // Determine whether to show the menu for accessing tabs on other devices. 417 // Determine whether to show the menu for accessing tabs on other devices.
418 bool show_other_sessions_menu = !CommandLine::ForCurrentProcess()->HasSwitch( 418 bool show_other_sessions_menu = !CommandLine::ForCurrentProcess()->HasSwitch(
419 switches::kDisableNTPOtherSessionsMenu); 419 switches::kDisableNTPOtherSessionsMenu);
420 load_time_data.SetBoolean("showOtherSessionsMenu", 420 load_time_data.SetBoolean("showOtherSessionsMenu",
421 show_other_sessions_menu); 421 show_other_sessions_menu);
422 load_time_data.SetBoolean("isUserSignedIn", 422 load_time_data.SetBoolean("isUserSignedIn",
423 !prefs->GetString(prefs::kGoogleServicesUsername).empty()); 423 !prefs->GetString(prefs::kGoogleServicesUsername).empty());
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 ResourceBundle::GetSharedInstance().GetRawDataResource( 554 ResourceBundle::GetSharedInstance().GetRawDataResource(
555 chrome::search::IsInstantExtendedAPIEnabled(profile_) ? 555 chrome::search::IsInstantExtendedAPIEnabled(profile_) ?
556 IDR_NEW_TAB_SEARCH_THEME_CSS : IDR_NEW_TAB_4_THEME_CSS, 556 IDR_NEW_TAB_SEARCH_THEME_CSS : IDR_NEW_TAB_4_THEME_CSS,
557 ui::SCALE_FACTOR_NONE)); 557 ui::SCALE_FACTOR_NONE));
558 558
559 // Create the string from our template and the replacements. 559 // Create the string from our template and the replacements.
560 std::string css_string; 560 std::string css_string;
561 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL); 561 css_string = ReplaceStringPlaceholders(new_tab_theme_css, subst, NULL);
562 new_tab_css_ = base::RefCountedString::TakeString(&css_string); 562 new_tab_css_ = base::RefCountedString::TakeString(&css_string);
563 } 563 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_page_handler.cc ('k') | chrome/browser/web_resource/notification_promo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698