From 6677024d9674022969241eb0d8e7584871e13eae Mon Sep 17 00:00:00 2001 From: "mirandac@google.com" Date: Wed, 28 Jul 2010 22:37:42 +0000 Subject: Remove tips from NTP. BUG= 50072 TEST= no tips on NTP. Review URL: http://codereview.chromium.org/3033032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54045 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/dom_ui/new_tab_ui.cc | 5 --- chrome/browser/profile.cc | 12 ------ chrome/browser/profile.h | 4 -- chrome/browser/profile_manager.cc | 3 -- chrome/browser/resources/new_new_tab.css | 33 ++-------------- chrome/browser/resources/new_new_tab.html | 8 +--- chrome/browser/resources/new_new_tab.js | 64 ------------------------------- 7 files changed, 5 insertions(+), 124 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 4bb445d..c033974 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -23,7 +23,6 @@ #include "chrome/browser/dom_ui/new_tab_page_sync_handler.h" #include "chrome/browser/dom_ui/ntp_resource_cache.h" #include "chrome/browser/dom_ui/shown_sections_handler.h" -#include "chrome/browser/dom_ui/tips_handler.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" @@ -463,8 +462,6 @@ NewTabUI::NewTabUI(TabContents* contents) AddMessageHandler((new MostVisitedHandler())->Attach(this)); AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this)); AddMessageHandler((new MetricsHandler())->Attach(this)); - if (WebResourcesEnabled()) - AddMessageHandler((new TipsHandler())->Attach(this)); if (GetProfile()->IsSyncAccessible()) AddMessageHandler((new NewTabPageSyncHandler())->Attach(this)); if (Extension::AppsAreEnabled()) { @@ -540,8 +537,6 @@ void NewTabUI::RegisterUserPrefs(PrefService* prefs) { MostVisitedHandler::RegisterUserPrefs(prefs); ShownSectionsHandler::RegisterUserPrefs(prefs); - if (NewTabUI::WebResourcesEnabled()) - TipsHandler::RegisterUserPrefs(prefs); UpdateUserPrefsVersion(prefs); } diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index af54776..98ad2863 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -639,10 +639,6 @@ class OffTheRecordProfileImpl : public Profile, NOTREACHED(); } - virtual void InitWebResources() { - NOTREACHED(); - } - virtual NTPResourceCache* GetNTPResourceCache() { // Just return the real profile resource cache. return profile_->GetNTPResourceCache(); @@ -896,14 +892,6 @@ void ProfileImpl::InitExtensions() { } } -void ProfileImpl::InitWebResources() { - if (web_resource_service_) - return; // Already initialized. - - web_resource_service_ = new WebResourceService(this); - web_resource_service_->StartAfterDelay(); -} - NTPResourceCache* ProfileImpl::GetNTPResourceCache() { if (!ntp_resource_cache_.get()) ntp_resource_cache_.reset(new NTPResourceCache(this)); diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 9ad555b..9ed1c7a 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -412,9 +412,6 @@ class Profile { virtual void InitExtensions() = 0; - // Start up service that gathers data from web resource feeds. - virtual void InitWebResources() = 0; - // Returns the new tab page resource cache. virtual NTPResourceCache* GetNTPResourceCache() = 0; @@ -544,7 +541,6 @@ class ProfileImpl : public Profile, virtual BackgroundContentsService* GetBackgroundContentsService(); virtual void MarkAsCleanShutdown(); virtual void InitExtensions(); - virtual void InitWebResources(); virtual NTPResourceCache* GetNTPResourceCache(); virtual FilePath last_selected_directory(); virtual void set_last_selected_directory(const FilePath& path); diff --git a/chrome/browser/profile_manager.cc b/chrome/browser/profile_manager.cc index 8770b1d..383dd5e 100644 --- a/chrome/browser/profile_manager.cc +++ b/chrome/browser/profile_manager.cc @@ -191,9 +191,6 @@ bool ProfileManager::AddProfile(Profile* profile, bool init_extensions) { profiles_.insert(profiles_.end(), profile); if (init_extensions) profile->InitExtensions(); - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (!command_line.HasSwitch(switches::kDisableWebResources)) - profile->InitWebResources(); return true; } diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index a201da6..bc04233 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -245,50 +245,25 @@ html[dir=rtl] .item { margin: 0 10px; } -#set-as-home-page { - display: none; - margin: 10px 0; - text-align: center; -} - #top-bar { display: -webkit-box; -webkit-box-align: center; min-height: 56px; } -#tip-line { - -webkit-box-flex: 1; - -webkit-transition: opacity .15s; - -webkit-user-select: text; - border: 0; - cursor: text; - display: block; /* Since we are reusing the section display logic we need - to override the display for hidden tips. */ - margin: 10px; - -webkit-margin-start: 50%; - text-align: end; -} - -.notification.hidden, -#tip-line.hidden, -.notification-shown #tip-line { +.notification.hidden { opacity: 0; pointer-events: none; } -#tip-line a, -#tip-line button { - /* We do not want a trailing single word from a link on the last line */ - white-space: nowrap; -} - #option-button { -webkit-appearance: none; background-color: transparent; width: 19px; height: 17px; - margin: 0; + position: absolute; + right: 0; + top: 20px; border: 0; padding: 0; vertical-align: top; diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index c3d7ef4..3064678 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -44,14 +44,11 @@ function registerCallback(name) { chrome.send('getMostVisited'); chrome.send('getRecentlyClosedTabs'); -chrome.send('getTips'); chrome.send('getApps'); registerCallback('mostVisitedPages'); registerCallback('recentlyClosedTabs'); registerCallback('syncMessageChanged'); -registerCallback('tips'); -registerCallback('onHomePageSet'); registerCallback('getAppsCallback'); registerCallback('setShownSections'); @@ -72,7 +69,7 @@ var Section = { THUMB: 1, // LIST is no longer used RECENT: 4, - TIPS: 8, + // TIPS is no longer used SYNC: 16, DEBUG: 32 }; @@ -129,13 +126,11 @@ if ('mode' in hashParams) {
-
-

@@ -178,7 +173,6 @@ if ('mode' in hashParams) {