diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser.cc | 2 | ||||
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 39 | ||||
-rw-r--r-- | chrome/browser/dom_ui/ntp_resource_cache.cc | 32 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.css | 85 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.html | 16 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 19 | ||||
-rw-r--r-- | chrome/browser/resources/new_tab_theme.css | 8 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 7 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 2 |
9 files changed, 1 insertions, 209 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index b3ad0d3..0dc47d2 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -1866,8 +1866,6 @@ 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->RegisterBooleanPref(prefs::kShowExtensionShelf, true); prefs->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true); prefs->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true); 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( diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index 87b18f3..a38fe18 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -20,10 +20,6 @@ html[mode=app-launcher] { height: auto; } -#promo-spacer { - height: 50px; -} - #main { background: url(chrome://theme/product_logo) no-repeat 0 6px; position: relative; @@ -33,10 +29,6 @@ html[mode=app-launcher] { -webkit-transition: width .15s; } -html[haspromo=true] #main { - padding-bottom: 110px; -} - html[dir=rtl] #main { background-position-x: 100%; } @@ -358,20 +350,6 @@ html[dir=rtl] #option-menu > [command=hide]:before { margin: 10px 0; } -/* promotions line and image */ -#bottom-right-promo { - position: absolute; - bottom: 0; - right: 0; - display: block; - height: 131px; - border: 0; -} - -#promo-image { - display: block; -} - .sync-button { font-size: inherit; padding: 0; @@ -384,69 +362,6 @@ html[dir=rtl] #option-menu > [command=hide]:before { font-family: inherit; } -#footer { - position: absolute; - bottom: 0; - width: 100%; - text-align: center; - min-width: 692px; -} - -#promo-line { - display: inline-block; - margin-bottom: 20px; - background-color: hsl(52, 100%, 80%); - border: 1px solid rgb(211, 211, 211); - border-radius: 6px; - padding: 7px 10px; - white-space: nowrap; - text-align: center; - vertical-align: middle; - color: black; - -webkit-transition: opacity .15s; -} - -#promo-line * { - font-weight: bold; - text-overflow: ellipsis; -} - -#promo-message a, -#promo-message button { - color: rgba(0, 102, 204, 0.3); - text-decoration: underline; -} - -#promo-message a > .link-color, -#promo-message button > .link-color { - color: rgb(0, 102, 204); -} - -#promo-new { - color: red; -} - -#promo-close { - display: inline-block; - border: 0px; - margin-left: 10px; - margin-right: auto; - vertical-align: middle; - width: 16px; - height: 16px; - background: no-repeat; - background-image: url(chrome://theme/close_bar); -} - -#promo-close:hover, -#promo-close:focus { - background-image: url(chrome://theme/close_bar_h); -} - -#promo-close:active { - background-image: url(chrome://theme/close_bar_p); -} - #apps-section { padding: 10px 0px; border-top: 0; diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index 43b8b70..3be5df2 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -4,8 +4,7 @@ bookmarkbarattached:bookmarkbarattached; hasattribution:hasattribution; anim:anim; - syncispresent:syncispresent; - haspromo:haspromo"> + syncispresent:syncispresent"> <meta charset="utf-8"> <title i18n-content="title"></title> @@ -198,19 +197,6 @@ if ('mode' in hashParams) { </div> <!-- main --> -<div id="footer"> - <div id="promo-line"> - <span id="promo-new" i18n-content="promonew"></span> - <span id="promo-message" i18n-values=".innerHTML:promomessage"></span> - <button class="link" id="promo-close"></button> - </div> - <div id="bottom-right-promo"> - <a i18n-values="href:extensionslink"> - <img id="promo-image" src="chrome://theme/newtab_extensions_promo"> - </a> - </div> -</div> - </div> <!-- container --> <div class="window-menu" id="window-tooltip"></div> diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 5ca1bd0..16d47b7 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -919,9 +919,6 @@ document.addEventListener('DOMContentLoaded', document.addEventListener('DOMContentLoaded', callGetSyncMessageIfSyncIsPresent); -// Set up links and text-decoration for promotional message. -document.addEventListener('DOMContentLoaded', setUpPromoMessage); - /** * The sync code is not yet built by default on all platforms so we have to * make sure we don't send the initial sync message to the backend unless the @@ -999,22 +996,6 @@ function fixLinkUnderline(el) { updateAttribution(); -// Closes the promo line when close button is clicked. -$('promo-close').onclick = function (e) { - $('promo-line').classList.add('hidden'); - chrome.send('stopPromoLineMessage'); - e.preventDefault(); -}; - -// Set bookmark sync button to start bookmark sync process on click; also set -// link underline colors correctly. -function setUpPromoMessage() { - var syncButton = document.querySelector('#promo-message button'); - syncButton.className = 'sync-button link'; - syncButton.onclick = syncSectionLinkClicked; - fixLinkUnderlines($('promo-message')); -} - var mostVisited = new MostVisited($('most-visited'), useSmallGrid(), shownSections & Section.THUMB); diff --git a/chrome/browser/resources/new_tab_theme.css b/chrome/browser/resources/new_tab_theme.css index 1242936..baa328e 100644 --- a/chrome/browser/resources/new_tab_theme.css +++ b/chrome/browser/resources/new_tab_theme.css @@ -107,14 +107,6 @@ body { color: $$6; /* COLOR_NTP_LINK_UNDERLINE */ } -#promo-line { - display: $$9; -} - -#bottom-right-promo { - display: $$8; -} - #top-bar { border-bottom: 1px solid $$2; /* COLOR_NTP_SECTION_BORDER */ } diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index d50815b..99998fb8 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -394,13 +394,6 @@ const wchar_t kUseCustomChromeFrame[] = L"browser.custom_chrome_frame"; // done directly from the omnibox should be shown. const wchar_t kShowOmniboxSearchHint[] = L"browser.show_omnibox_search_hint"; -// Integer that counts the number of times the promo on the NTP has left to be -// shown; this decrements each time the NTP is shown for the first time -// in a session. The message line can be closed separately from the promo -// image, so we store two separate values for number of remaining views. -const wchar_t kNTPPromoLineRemaining[] = L"browser.ntp.promo_line_remaining"; -const wchar_t kNTPPromoImageRemaining[] = L"browser.ntp.promo_image_remaining"; - // The list of origins which are allowed|denied to show desktop notifications. const wchar_t kDesktopNotificationAllowedOrigins[] = L"profile.notification_allowed_sites"; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index a72711e91..cbd9f18 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -154,8 +154,6 @@ extern const wchar_t kShowUpdatePromotionInfoBar[]; #endif extern const wchar_t kUseCustomChromeFrame[]; extern const wchar_t kShowOmniboxSearchHint[]; -extern const wchar_t kNTPPromoLineRemaining[]; -extern const wchar_t kNTPPromoImageRemaining[]; extern const wchar_t kDesktopNotificationAllowedOrigins[]; extern const wchar_t kDesktopNotificationDeniedOrigins[]; extern const wchar_t kDefaultContentSettings[]; |