summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 00:02:00 +0000
committermirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 00:02:00 +0000
commit7d8dc6258b7c9dd771eaf509f5403b602a838388 (patch)
treedbfabd99f897af4e90a83516b04f7eb2d0151b3d /chrome/browser
parent753008ab2457c5fc815933ca9eb04bd9fd2582da (diff)
downloadchromium_src-7d8dc6258b7c9dd771eaf509f5403b602a838388.zip
chromium_src-7d8dc6258b7c9dd771eaf509f5403b602a838388.tar.gz
chromium_src-7d8dc6258b7c9dd771eaf509f5403b602a838388.tar.bz2
Revert 32176 - Tweaks and fixes for NTP extension promo.
Don't show promo for extensions on Mac, as they're not available yet. Decrement promo counter even when NTP is not home page, and do not remove puzzle piece when promo line is closed. When message bar is closed, make it zip off bottom of screen instead of just disappearing. BUG= 27814, 25258, 27815 TEST= see various bugs. Review URL: http://codereview.chromium.org/385135 TBR=mirandac@chromium.org Review URL: http://codereview.chromium.org/399051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser.cc3
-rw-r--r--chrome/browser/dom_ui/dom_ui_theme_source.cc13
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc19
-rw-r--r--chrome/browser/resources/new_new_tab.css10
-rw-r--r--chrome/browser/resources/new_new_tab.js7
5 files changed, 21 insertions, 31 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 4506423..4cee735 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1356,8 +1356,7 @@ void Browser::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterIntegerPref(prefs::kDeleteTimePeriod, 0);
prefs->RegisterBooleanPref(prefs::kCheckDefaultBrowser, true);
prefs->RegisterBooleanPref(prefs::kShowOmniboxSearchHint, true);
- prefs->RegisterIntegerPref(prefs::kNTPPromoLineRemaining, 5);
- prefs->RegisterIntegerPref(prefs::kNTPPromoImageRemaining, 5);
+ prefs->RegisterIntegerPref(prefs::kNTPPromoRemaining, 5);
prefs->RegisterBooleanPref(prefs::kShowExtensionShelf, true);
prefs->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
prefs->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.cc b/chrome/browser/dom_ui/dom_ui_theme_source.cc
index 759033b..e5e473f 100644
--- a/chrome/browser/dom_ui/dom_ui_theme_source.cc
+++ b/chrome/browser/dom_ui/dom_ui_theme_source.cc
@@ -184,22 +184,13 @@ void DOMUIThemeSource::InitNewTabCSS(Profile* profile) {
subst2.push_back(SkColorToRGBAString(color_link_underline)); // $$6
subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7
-#if defined(OS_MACOSX)
- // No extensions available on Mac yet.
- subst2.push_back("none"); // $$8: display of lower right promo image
- subst2.push_back("none"); // $$9: display of butterbar footer promo line
-#else
- if (profile->GetPrefs()->GetInteger(prefs::kNTPPromoImageRemaining) > 0) {
+ if (profile->GetPrefs()->GetInteger(prefs::kNTPPromoRemaining) > 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"); // $$8
subst2.push_back("none"); // $$9
}
-#endif
// Get our template.
static const base::StringPiece new_tab_theme_css(
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 9369b00..02dc255a 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -219,15 +219,14 @@ class PromotionalMessageHandler : public DOMMessageHandler {
};
void PromotionalMessageHandler::RegisterMessages() {
- dom_ui_->RegisterMessageCallback("stopPromoLineMessage",
+ dom_ui_->RegisterMessageCallback("stopPromoMessages",
NewCallback(this,
&PromotionalMessageHandler::HandleClosePromotionalMessage));
}
void PromotionalMessageHandler::HandleClosePromotionalMessage(
const Value* content) {
- dom_ui_->GetProfile()->GetPrefs()->SetInteger(
- prefs::kNTPPromoLineRemaining, 0);
+ dom_ui_->GetProfile()->GetPrefs()->SetInteger(prefs::kNTPPromoRemaining, 0);
}
@@ -570,6 +569,12 @@ NewTabUI::NewTabUI(TabContents* contents)
// thumbnails, but also clicks on recently bookmarked.
link_transition_type_ = PageTransition::AUTO_BOOKMARK;
+ if (NewTabHTMLSource::first_view() &&
+ (GetProfile()->GetPrefs()->GetInteger(prefs::kRestoreOnStartup) != 0 ||
+ !GetProfile()->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage))) {
+ NewTabHTMLSource::set_first_view(false);
+ }
+
if (NewTabUI::FirstRunDisabled())
NewTabHTMLSource::set_first_run(false);
@@ -938,12 +943,10 @@ void NewTabUI::NewTabHTMLSource::InitFullHTML(Profile* profile) {
if (first_view_) {
localized_strings.SetString(L"firstview", L"true");
- // Decrement ntp promo counters; the default values are specified in
+ // Decrement ntp promo counter; the default value is 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);
+ profile->GetPrefs()->SetInteger(prefs::kNTPPromoRemaining,
+ profile->GetPrefs()->GetInteger(prefs::kNTPPromoRemaining) - 1);
first_view_ = false;
}
diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css
index ddf6ca2..79b135d 100644
--- a/chrome/browser/resources/new_new_tab.css
+++ b/chrome/browser/resources/new_new_tab.css
@@ -690,25 +690,21 @@ html[dir='rtl'] #option-menu > [command='hide']:before {
/* promotions line */
#bottom-right-promo {
position: absolute;
+ display: block;
width: 180px;
height: 131px;
border: 0;
bottom: 0px;
right: 0px;
- z-index: -1;
}
#footer {
position: fixed;
- bottom: 0;
+ bottom: 0px;
left: 0px;
text-align: center;
width: 100%;
- -webkit-transition: bottom .15s;
-}
-
-#footer.hide-footer {
- bottom: -40px;
+ display: block;
}
#promo-line {
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 2e539e3..a27bf06 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -1593,9 +1593,10 @@ function fixLinkUnderline(el) {
updateAttribution();
-// Closes the promo line when close button is clicked.
+/* Close the promo notices when close button on the promo-line is clicked. */
$('promo-close').onclick = function (e) {
- $('footer').className = 'hide-footer';
- chrome.send('stopPromoLineMessage');
+ $('promo-line').style.display = 'none';
+ $('bottom-right-promo').style.display = 'none';
+ chrome.send('stopPromoMessages');
e.preventDefault();
};