summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 22:44:51 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 22:44:51 +0000
commit32925764ac6fd4df5497a48f4cd6f97c0dc93e8e (patch)
treefd21fc7af2ec03f32df5700385faad82967ec162 /chrome/browser/dom_ui
parentf5ad47a18ebe1dfe2656588776557c3a702faf56 (diff)
downloadchromium_src-32925764ac6fd4df5497a48f4cd6f97c0dc93e8e.zip
chromium_src-32925764ac6fd4df5497a48f4cd6f97c0dc93e8e.tar.gz
chromium_src-32925764ac6fd4df5497a48f4cd6f97c0dc93e8e.tar.bz2
NTP: Remove bottom promos.
BUG=None TEST=Start chrome with a new blank profile. No bottom promos should show up. Review URL: http://codereview.chromium.org/2637004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc39
-rw-r--r--chrome/browser/dom_ui/ntp_resource_cache.cc32
2 files changed, 0 insertions, 71 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index b605522..097c8b7 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -113,37 +113,6 @@ class PaintTimer : public RenderWidgetHost::PaintObserver {
};
///////////////////////////////////////////////////////////////////////////////
-// PromotionalMessageHandler
-
-class PromotionalMessageHandler : public DOMMessageHandler {
- public:
- PromotionalMessageHandler() {}
- virtual ~PromotionalMessageHandler() {}
-
- // DOMMessageHandler implementation.
- virtual void RegisterMessages();
-
- // Zero promotional message counter.
- void HandleClosePromotionalMessage(const Value* content);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PromotionalMessageHandler);
-};
-
-void PromotionalMessageHandler::RegisterMessages() {
- dom_ui_->RegisterMessageCallback("stopPromoLineMessage",
- NewCallback(this,
- &PromotionalMessageHandler::HandleClosePromotionalMessage));
-}
-
-void PromotionalMessageHandler::HandleClosePromotionalMessage(
- const Value* content) {
- dom_ui_->GetProfile()->GetPrefs()->SetInteger(
- prefs::kNTPPromoLineRemaining, 0);
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
// RecentlyClosedTabsHandler
class RecentlyClosedTabsHandler : public DOMMessageHandler,
@@ -485,13 +454,6 @@ NewTabUI::NewTabUI(TabContents* contents)
static bool first_view = true;
if (first_view) {
- Profile* profile = GetProfile();
- // Decrement ntp promo counters; the default values are specified in
- // Browser::RegisterUserPrefs.
- profile->GetPrefs()->SetInteger(prefs::kNTPPromoLineRemaining,
- profile->GetPrefs()->GetInteger(prefs::kNTPPromoLineRemaining) - 1);
- profile->GetPrefs()->SetInteger(prefs::kNTPPromoImageRemaining,
- profile->GetPrefs()->GetInteger(prefs::kNTPPromoImageRemaining) - 1);
first_view = false;
}
@@ -514,7 +476,6 @@ NewTabUI::NewTabUI(TabContents* contents)
}
AddMessageHandler((new NewTabPageSetHomePageHandler())->Attach(this));
- AddMessageHandler((new PromotionalMessageHandler())->Attach(this));
}
// Initializing the CSS and HTML can require some CPU, so do it after
diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc
index 17d1ee4..3d4f98a 100644
--- a/chrome/browser/dom_ui/ntp_resource_cache.cc
+++ b/chrome/browser/dom_ui/ntp_resource_cache.cc
@@ -150,17 +150,12 @@ NTPResourceCache::NTPResourceCache(Profile* profile) : profile_(profile) {
PrefService* pref_service = profile_->GetPrefs();
pref_service->AddPrefObserver(prefs::kShowBookmarkBar, this);
pref_service->AddPrefObserver(prefs::kNTPShownSections, this);
-
- // Watch for pref changes that cause us to need to invalidate the CSS cache.
- pref_service->AddPrefObserver(prefs::kNTPPromoLineRemaining, this);
}
NTPResourceCache::~NTPResourceCache() {
PrefService* pref_service = profile_->GetPrefs();
pref_service->RemovePrefObserver(prefs::kShowBookmarkBar, this);
pref_service->RemovePrefObserver(prefs::kNTPShownSections, this);
-
- pref_service->RemovePrefObserver(prefs::kNTPPromoLineRemaining, this);
}
RefCountedBytes* NTPResourceCache::GetNewTabHTML(bool is_off_the_record) {
@@ -204,9 +199,6 @@ void NTPResourceCache::Observe(NotificationType type,
*pref_name == prefs::kNTPShownSections) {
new_tab_incognito_html_ = NULL;
new_tab_html_ = NULL;
- } else if (*pref_name == prefs::kNTPPromoLineRemaining) {
- new_tab_incognito_css_ = NULL;
- new_tab_css_ = NULL;
} else {
NOTREACHED();
}
@@ -271,10 +263,6 @@ void NTPResourceCache::CreateNewTabHTML() {
localized_strings.SetString(L"hasattribution",
profile_->GetThemeProvider()->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION) ?
"true" : "false");
- localized_strings.SetString(L"haspromo",
- profile_->GetPrefs()->GetInteger(prefs::kNTPPromoLineRemaining) > 0 ||
- profile_->GetPrefs()->GetInteger(prefs::kNTPPromoImageRemaining) > 0 ?
- "true" : "false");
localized_strings.SetString(L"title", title);
localized_strings.SetString(L"mostvisited", most_visited);
localized_strings.SetString(L"restorethumbnails",
@@ -311,15 +299,6 @@ void NTPResourceCache::CreateNewTabHTML() {
l10n_util::GetString(IDS_NEW_TAB_CLOSE_FIRST_RUN_NOTIFICATION));
localized_strings.SetString(L"tips",
l10n_util::GetString(IDS_NEW_TAB_TIPS));
- localized_strings.SetString(L"promonew",
- l10n_util::GetString(IDS_NTP_PROMOTION_NEW));
- std::wstring extensionLink = ASCIIToWide(
- google_util::AppendGoogleLocaleParam(
- GURL(extension_urls::kGalleryBrowsePrefix)).spec());
- localized_strings.SetString(L"promomessage",
- l10n_util::GetStringF(IDS_NTP_PROMO_MESSAGE,
- l10n_util::GetString(IDS_PRODUCT_NAME), extensionLink));
- localized_strings.SetString(L"extensionslink", extensionLink);
localized_strings.SetString(L"close", l10n_util::GetString(IDS_CLOSE));
// Don't initiate the sync related message passing with the page if the sync
@@ -488,17 +467,6 @@ void NTPResourceCache::CreateNewTabCSS() {
subst2.push_back(SkColorToRGBAString(color_link_underline)); // $$6
subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7
- if (profile_->GetPrefs()->GetInteger(prefs::kNTPPromoImageRemaining) > 0) {
- subst2.push_back("block"); // $$8
- } else {
- subst2.push_back("none"); // $$8
- }
- if (profile_->GetPrefs()->GetInteger(prefs::kNTPPromoLineRemaining) > 0) {
- subst2.push_back("inline-block"); // $$9
- } else {
- subst2.push_back("none"); // $$9
- }
-
// Get our template.
static const base::StringPiece new_tab_theme_css(
ResourceBundle::GetSharedInstance().GetRawDataResource(