From 1cf38fa7f9493a4e84a42e05abfc812e19220fea Mon Sep 17 00:00:00 2001 From: "arv@google.com" Date: Sat, 25 Jul 2009 06:54:43 +0000 Subject: Disable the tips service by default. Update the UI to not say tips or recommendations. BUG=None TEST=Starting chrome should not show any tips byt default Review URL: http://codereview.chromium.org/160138 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21615 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/generated_resources.grd | 16 ++++++++++++++++ chrome/browser/browser_main.cc | 2 +- chrome/browser/dom_ui/new_tab_ui.cc | 16 ++++++++-------- chrome/browser/dom_ui/new_tab_ui.h | 2 +- chrome/browser/resources/new_new_tab.html | 5 +++-- chrome/common/chrome_switches.cc | 4 ++-- chrome/common/chrome_switches.h | 2 +- chrome/test/in_process_browser_test.cc | 5 ++++- chrome/test/ui/ui_test.cc | 3 ++- 9 files changed, 38 insertions(+), 17 deletions(-) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 9813ca4..5509ac8 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3550,6 +3550,22 @@ each locale. --> desc="Default content of tip box when no tips are available. This is a short advertisement and explanation for the tips and suggestions to come."> Watch this space for tips and suggestions for better browsing! + + Even more + + + This space intentionally left blank + + + Show even more + + + Hide even more + Downloads diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 4b938c6..0ffe724 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -745,7 +745,7 @@ int BrowserMain(const MainFunctionParams& parameters) { profile->InitExtensions(); // Start up the web resource service. This starts loading data after a // short delay so as not to interfere with startup time. - if (!parsed_command_line.HasSwitch(switches::kDisableWebResources)) + if (parsed_command_line.HasSwitch(switches::kEnableWebResources)) profile->InitWebResources(); int result_code = ResultCodes::NORMAL_EXIT; diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 50f5ec0..deb9683 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -312,9 +312,9 @@ void NewTabHTMLSource::StartDataRequest(const std::string& path, localized_strings.SetString(L"recentactivities", l10n_util::GetString(IDS_NEW_TAB_RECENT_ACTIVITIES)); localized_strings.SetString(L"tipsandsuggestions", - l10n_util::GetString(IDS_NEW_TAB_TIPS)); + l10n_util::GetString(IDS_NEW_TAB_EVEN_MORE_TITLE)); localized_strings.SetString(L"defaulttipstitle", - l10n_util::GetString(IDS_NEW_TAB_DEFAULT_TIPS_TITLE)); + l10n_util::GetString(IDS_NEW_TAB_EVEN_MORE_CONTENT)); localized_strings.SetString(L"downloads", l10n_util::GetString(IDS_NEW_TAB_DOWNLOADS)); localized_strings.SetString(L"viewfullhistory", @@ -334,9 +334,9 @@ void NewTabHTMLSource::StartDataRequest(const std::string& path, localized_strings.SetString(L"hiderecent", l10n_util::GetString(IDS_NEW_TAB_HIDE_RECENT)); localized_strings.SetString(L"showtips", - l10n_util::GetString(IDS_NEW_TAB_SHOW_TIPS)); + l10n_util::GetString(IDS_NEW_TAB_SHOW_EVEN_MORE)); localized_strings.SetString(L"hidetips", - l10n_util::GetString(IDS_NEW_TAB_HIDE_TIPS)); + l10n_util::GetString(IDS_NEW_TAB_HIDE_EVEN_MORE)); localized_strings.SetString(L"thumbnailremovednotification", l10n_util::GetString(IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION)); localized_strings.SetString(L"undothumbnailremove", @@ -1526,7 +1526,7 @@ NewTabUI::NewTabUI(TabContents* contents) AddMessageHandler((new MostVisitedHandler())->Attach(this)); AddMessageHandler((new RecentlyClosedTabsHandler())->Attach(this)); AddMessageHandler((new MetricsHandler())->Attach(this)); - if (!WebResourcesDisabled()) + if (WebResourcesEnabled()) AddMessageHandler((new TipsHandler())->Attach(this)); if (UseOldNewTabPage()) { @@ -1584,7 +1584,7 @@ void NewTabUI::Observe(NotificationType type, void NewTabUI::RegisterUserPrefs(PrefService* prefs) { MostVisitedHandler::RegisterUserPrefs(prefs); ShownSectionsHandler::RegisterUserPrefs(prefs); - if (!NewTabUI::WebResourcesDisabled()) + if (NewTabUI::WebResourcesEnabled()) TipsHandler::RegisterUserPrefs(prefs); } @@ -1595,7 +1595,7 @@ bool NewTabUI::UseOldNewTabPage() { } // static -bool NewTabUI::WebResourcesDisabled() { +bool NewTabUI::WebResourcesEnabled() { const CommandLine* command_line = CommandLine::ForCurrentProcess(); - return command_line->HasSwitch(switches::kDisableWebResources); + return command_line->HasSwitch(switches::kEnableWebResources); } diff --git a/chrome/browser/dom_ui/new_tab_ui.h b/chrome/browser/dom_ui/new_tab_ui.h index 4149a46..fde0fe2 100644 --- a/chrome/browser/dom_ui/new_tab_ui.h +++ b/chrome/browser/dom_ui/new_tab_ui.h @@ -29,7 +29,7 @@ class NewTabUI : public DOMUI, static bool UseOldNewTabPage(); // Whether we should disable the web resources backend service - static bool WebResourcesDisabled(); + static bool WebResourcesEnabled(); private: void Observe(NotificationType type, diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index cb984ec..239d257 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -258,9 +258,10 @@ logEvent('log start');