diff options
author | pkasting <pkasting@chromium.org> | 2016-01-06 02:19:50 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-06 10:20:53 +0000 |
commit | 83dc1e9ac7419fc73e2dca2545d6f9cd9d8a420f (patch) | |
tree | 75cc49152ea3e99931213212db92973e1a846e41 | |
parent | 1409407a93075f8ef9e894455ca75059ee68f99b (diff) | |
download | chromium_src-83dc1e9ac7419fc73e2dca2545d6f9cd9d8a420f.zip chromium_src-83dc1e9ac7419fc73e2dca2545d6f9cd9d8a420f.tar.gz chromium_src-83dc1e9ac7419fc73e2dca2545d6f9cd9d8a420f.tar.bz2 |
Remove a variety of no-longer-used query params.
BUG=571674
TEST=none
TBR=palmer,sdefresne
Review URL: https://codereview.chromium.org/1543203002
Cr-Commit-Position: refs/heads/master@{#367809}
48 files changed, 13 insertions, 485 deletions
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc index 6c71857..156a3e5 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc @@ -24,7 +24,6 @@ #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" -#include "components/bookmarks/common/bookmark_pref_names.h" #include "components/browser_sync/browser/profile_sync_service.h" #include "components/history/core/browser/history_service.h" #include "components/omnibox/browser/autocomplete_classifier.h" @@ -204,10 +203,6 @@ bool ChromeAutocompleteProviderClient::SearchSuggestEnabled() const { return profile_->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled); } -bool ChromeAutocompleteProviderClient::BookmarkBarIsVisible() const { - return profile_->GetPrefs()->GetBoolean(bookmarks::prefs::kShowBookmarkBar); -} - bool ChromeAutocompleteProviderClient::TabSyncEnabledAndUnencrypted() const { return sync_driver::IsTabSyncEnabledAndUnencrypted( ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_), diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h index e7b85a4..1c97706 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.h @@ -40,7 +40,6 @@ class ChromeAutocompleteProviderClient : public AutocompleteProviderClient { std::vector<base::string16> GetBuiltinsToProvideAsUserTypes() override; bool IsOffTheRecord() const override; bool SearchSuggestEnabled() const override; - bool BookmarkBarIsVisible() const override; bool TabSyncEnabledAndUnencrypted() const override; void Classify( const base::string16& text, diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index ca5a6db..256c136 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -31,7 +31,6 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" -#include "components/bookmarks/common/bookmark_pref_names.h" #include "components/browser_sync/browser/profile_sync_service.h" #include "components/google/core/browser/google_switches.h" #include "components/history/core/browser/history_service.h" @@ -3229,26 +3228,6 @@ TEST_F(SearchProviderTest, ParseDeletionUrl) { } } -TEST_F(SearchProviderTest, ReflectsBookmarkBarState) { - profile_.GetPrefs()->SetBoolean(bookmarks::prefs::kShowBookmarkBar, false); - base::string16 term = term1_.substr(0, term1_.length() - 1); - QueryForInput(term, true, false); - ASSERT_FALSE(provider_->matches().empty()); - EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, - provider_->matches()[0].type); - ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL); - EXPECT_FALSE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned); - - profile_.GetPrefs()->SetBoolean(bookmarks::prefs::kShowBookmarkBar, true); - term = term1_.substr(0, term1_.length() - 1); - QueryForInput(term, true, false); - ASSERT_FALSE(provider_->matches().empty()); - EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, - provider_->matches()[0].type); - ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL); - EXPECT_TRUE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned); -} - TEST_F(SearchProviderTest, CanSendURL) { TemplateURLData template_url_data; template_url_data.SetShortName(ASCIIToUTF16("t")); diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc index 9a89038..a89f381 100644 --- a/chrome/browser/search/instant_service.cc +++ b/chrome/browser/search/instant_service.cc @@ -73,7 +73,6 @@ bool IsLocalNTPSuggestionServiceEnabled() { InstantService::InstantService(Profile* profile) : profile_(profile), template_url_service_(TemplateURLServiceFactory::GetForProfile(profile_)), - omnibox_start_margin_(search::kDisableStartMargin), suggestions_service_(NULL), weak_ptr_factory_(this) { // The initialization below depends on a typical set of browser threads. Skip @@ -297,12 +296,6 @@ void InstantService::SendSearchURLsToRenderer(content::RenderProcessHost* rph) { search::GetSearchURLs(profile_), search::GetNewTabPageURL(profile_))); } -void InstantService::OnOmniboxStartMarginChanged(int start_margin) { - omnibox_start_margin_ = start_margin; - FOR_EACH_OBSERVER(InstantServiceObserver, observers_, - OmniboxStartMarginChanged(omnibox_start_margin_)); -} - void InstantService::OnRendererProcessTerminated(int process_id) { process_ids_.erase(process_id); diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h index 96abba7..e711898 100644 --- a/chrome/browser/search/instant_service.h +++ b/chrome/browser/search/instant_service.h @@ -87,16 +87,10 @@ class InstantService : public KeyedService, // Sends the current set of search URLs to a renderer process. void SendSearchURLsToRenderer(content::RenderProcessHost* rph); - // Invoked to notify the Instant page that the omnibox start margin has - // changed. - void OnOmniboxStartMarginChanged(int start_margin); - InstantSearchPrerenderer* instant_search_prerenderer() { return instant_prerenderer_.get(); } - int omnibox_start_margin() const { return omnibox_start_margin_; } - private: friend class InstantExtendedTest; friend class InstantServiceTest; @@ -169,10 +163,6 @@ class InstantService : public KeyedService, // Theme-related data for NTP overlay to adopt themes. scoped_ptr<ThemeBackgroundInfo> theme_info_; - // The start-edge margin of the omnibox, used by the Instant page to align - // text or assets properly with the omnibox. - int omnibox_start_margin_; - base::ObserverList<InstantServiceObserver> observers_; content::NotificationRegistrar registrar_; diff --git a/chrome/browser/search/instant_service_observer.cc b/chrome/browser/search/instant_service_observer.cc index 2dd5a50..31fedf0 100644 --- a/chrome/browser/search/instant_service_observer.cc +++ b/chrome/browser/search/instant_service_observer.cc @@ -14,7 +14,3 @@ void InstantServiceObserver::MostVisitedItemsChanged( void InstantServiceObserver::DefaultSearchProviderChanged( bool google_base_url_domain_changed) { } - -void InstantServiceObserver::OmniboxStartMarginChanged( - int omnibox_start_margin) { -} diff --git a/chrome/browser/search/instant_service_observer.h b/chrome/browser/search/instant_service_observer.h index d38337d..0ed36b5 100644 --- a/chrome/browser/search/instant_service_observer.h +++ b/chrome/browser/search/instant_service_observer.h @@ -26,9 +26,6 @@ class InstantServiceObserver { virtual void DefaultSearchProviderChanged( bool google_base_url_domain_changed); - // Indicates that the omnibox start margin has changed. - virtual void OmniboxStartMarginChanged(int omnibox_start_margin); - protected: virtual ~InstantServiceObserver() {} }; diff --git a/chrome/browser/search/instant_service_unittest.cc b/chrome/browser/search/instant_service_unittest.cc index 4b5f0f7..dcfe926 100644 --- a/chrome/browser/search/instant_service_unittest.cc +++ b/chrome/browser/search/instant_service_unittest.cc @@ -30,7 +30,6 @@ class MockInstantServiceObserver : public InstantServiceObserver { public: MOCK_METHOD1(DefaultSearchProviderChanged, void(bool)); - MOCK_METHOD1(OmniboxStartMarginChanged, void(int)); }; class InstantServiceTest : public InstantUnitTestBase { @@ -51,10 +50,6 @@ class InstantServiceTest : public InstantUnitTestBase { return instant_service_->instant_search_prerenderer(); } - void UpdateOmniboxStartMargin(int start_margin) { - instant_service_->OnOmniboxStartMarginChanged(start_margin); - } - scoped_ptr<MockInstantServiceObserver> instant_service_observer_; }; @@ -159,13 +154,6 @@ TEST_F(InstantServiceEnabledTest, EXPECT_NE(old_prerenderer, GetInstantSearchPrerenderer()); } -TEST_F(InstantServiceTest, OmniboxStartMarginChanged) { - int new_start_margin = 92; - EXPECT_CALL(*instant_service_observer_.get(), - OmniboxStartMarginChanged(new_start_margin)).Times(1); - UpdateOmniboxStartMargin(new_start_margin); -} - TEST_F(InstantServiceTest, GetSuggestionFromServiceSide) { auto profile = suggestions::SuggestionsProfile(); profile.add_suggestions(); diff --git a/chrome/browser/search/instant_unittest_base.cc b/chrome/browser/search/instant_unittest_base.cc index fc9dfb6..b6d87b8 100644 --- a/chrome/browser/search/instant_unittest_base.cc +++ b/chrome/browser/search/instant_unittest_base.cc @@ -54,9 +54,8 @@ void InstantUnitTestBase::SetUserSelectedDefaultSearchProvider( data.SetShortName(base::UTF8ToUTF16(base_url)); data.SetKeyword(base::UTF8ToUTF16(base_url)); data.SetURL(base_url + "url?bar={searchTerms}"); - data.instant_url = base_url + - "instant?{google:omniboxStartMarginParameter}{google:forceInstantResults}" - "foo=foo#foo=foo&strk"; + data.instant_url = + base_url + "instant?{google:forceInstantResults}foo=foo#foo=foo&strk"; data.new_tab_url = base_url + "newtab"; data.alternate_urls.push_back(base_url + "alt#quux={searchTerms}"); data.search_terms_replacement_key = "strk"; diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/chrome/browser/search_engines/ui_thread_search_terms_data.cc index c9e66be..7c3366f 100644 --- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc +++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc @@ -16,8 +16,6 @@ #include "chrome/browser/search/instant_service.h" #include "chrome/browser/search/instant_service_factory.h" #include "chrome/browser/search/search.h" -#include "chrome/browser/themes/theme_service.h" -#include "chrome/browser/themes/theme_service_factory.h" #include "chrome/common/channel_info.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" @@ -127,11 +125,6 @@ std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { return "chrome-ext-ansg"; } -bool UIThreadSearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { - return search::IsInstantExtendedAPIEnabled() && - search::IsQueryExtractionEnabled(); -} - std::string UIThreadSearchTermsData::InstantExtendedEnabledParam( bool for_search) const { return search::InstantExtendedEnabledParam(for_search); @@ -142,33 +135,6 @@ std::string UIThreadSearchTermsData::ForceInstantResultsParam( return search::ForceInstantResultsParam(for_prerender); } -int UIThreadSearchTermsData::OmniboxStartMargin() const { - InstantService* instant_service = - InstantServiceFactory::GetForProfile(profile_); - // Android and iOS have no InstantService. - return instant_service ? instant_service->omnibox_start_margin() - : search::kDisableStartMargin; -} - -std::string UIThreadSearchTermsData::NTPIsThemedParam() const { - DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || - BrowserThread::CurrentlyOn(BrowserThread::UI)); -#if defined(ENABLE_THEMES) - if (!search::IsInstantExtendedAPIEnabled()) - return std::string(); - - // TODO(dhollowa): Determine fraction of custom themes that don't affect the - // NTP background and/or color. - ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); - // NTP is considered themed if the theme is not default and not native (GTK+). - if (theme_service && !theme_service->UsingDefaultTheme() && - !theme_service->UsingSystemTheme()) - return "es_th=1&"; -#endif // defined(ENABLE_THEMES) - - return std::string(); -} - // It's acutally OK to call this method on any thread, but it's currently placed // in UIThreadSearchTermsData since SearchTermsData cannot depend on src/chrome // as it is shared with iOS. diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.h b/chrome/browser/search_engines/ui_thread_search_terms_data.h index 0b85ffd..1f61378 100644 --- a/chrome/browser/search_engines/ui_thread_search_terms_data.h +++ b/chrome/browser/search_engines/ui_thread_search_terms_data.h @@ -27,11 +27,8 @@ class UIThreadSearchTermsData : public SearchTermsData { std::string GetSearchClient() const override; std::string GetSuggestClient() const override; std::string GetSuggestRequestIdentifier() const override; - bool IsShowingSearchTermsOnSearchResultsPages() const override; std::string InstantExtendedEnabledParam(bool for_search) const override; std::string ForceInstantResultsParam(bool for_prerender) const override; - int OmniboxStartMargin() const override; - std::string NTPIsThemedParam() const override; std::string GoogleImageSearchSource() const override; std::string GetAcceptLanguages() const override; diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm index de44911..d4a10a9 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm @@ -22,9 +22,6 @@ #include "chrome/browser/extensions/location_bar_controller.h" #include "chrome/browser/extensions/tab_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/search/instant_service.h" -#include "chrome/browser/search/instant_service_factory.h" -#include "chrome/browser/search/search.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/translate/chrome_translate_client.h" #include "chrome/browser/translate/translate_service.h" @@ -558,13 +555,6 @@ void LocationBarViewMac::OnChanged() { location_icon_decoration_->SetImage(image); ev_bubble_decoration_->SetImage(image); Layout(); - - InstantService* instant_service = - InstantServiceFactory::GetForProfile(profile()); - if (instant_service) { - gfx::Rect bounds(NSRectToCGRect([field_ frame])); - instant_service->OnOmniboxStartMarginChanged(bounds.x()); - } } void LocationBarViewMac::OnSetFocus() { diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc index 6d44c18..94ed97a 100644 --- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc +++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc @@ -434,34 +434,6 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedTest, ASSERT_THAT(active_tab->GetURL().spec(), HasSubstr("q=puppies")); } -#if defined(OS_LINUX) && defined(ADDRESS_SANITIZER) -// Flaky crashes at shutdown on Linux Asan; http://crbug.com/517886. -#define MAYBE_OmniboxMarginSetForSearchURLs \ - DISABLED_OmniboxMarginSetForSearchURLs -#else -#define MAYBE_OmniboxMarginSetForSearchURLs OmniboxMarginSetForSearchURLs -#endif -IN_PROC_BROWSER_TEST_F(InstantExtendedTest, - MAYBE_OmniboxMarginSetForSearchURLs) { - ASSERT_NO_FATAL_FAILURE(SetupInstant(browser())); - FocusOmnibox(); - - // Create an observer to wait for the instant tab to support Instant. - content::WindowedNotificationObserver observer( - chrome::NOTIFICATION_INSTANT_TAB_SUPPORT_DETERMINED, - content::NotificationService::AllSources()); - - SetOmniboxText("flowers"); - browser()->window()->GetLocationBar()->AcceptInput(); - observer.Wait(); - - const std::string& url = - browser()->tab_strip_model()->GetActiveWebContents()->GetURL().spec(); - // Make sure we actually used search_url, not instant_url. - ASSERT_THAT(url, HasSubstr("&is_search")); - EXPECT_THAT(url, HasSubstr("&es_sm=")); -} - // Test to verify that switching tabs should not dispatch onmostvisitedchanged // events. IN_PROC_BROWSER_TEST_F(InstantExtendedTest, NoMostVisitedChangedOnTabSwitch) { diff --git a/chrome/browser/ui/search/instant_test_utils.cc b/chrome/browser/ui/search/instant_test_utils.cc index d0f652c..e8cf797 100644 --- a/chrome/browser/ui/search/instant_test_utils.cc +++ b/chrome/browser/ui/search/instant_test_utils.cc @@ -55,8 +55,7 @@ void InstantTestBase::SetupInstant(Browser* browser) { // Necessary to use exact URL for both the main URL and the alternate URL for // search term extraction to work in InstantExtended. data.SetShortName(base::ASCIIToUTF16("name")); - data.SetURL(instant_url_.spec() + - "q={searchTerms}&is_search&{google:omniboxStartMarginParameter}"); + data.SetURL(instant_url_.spec() + "q={searchTerms}&is_search"); data.instant_url = instant_url_.spec(); data.new_tab_url = ntp_url_.spec(); if (init_suggestions_url_) diff --git a/chrome/browser/ui/search/search_ipc_router.cc b/chrome/browser/ui/search/search_ipc_router.cc index fce368fb..ebbdeff 100644 --- a/chrome/browser/ui/search/search_ipc_router.cc +++ b/chrome/browser/ui/search/search_ipc_router.cc @@ -101,13 +101,6 @@ void SearchIPCRouter::SetSuggestionToPrefetch( suggestion)); } -void SearchIPCRouter::SetOmniboxStartMargin(int start_margin) { - if (!policy_->ShouldSendSetOmniboxStartMargin()) - return; - - Send(new ChromeViewMsg_SearchBoxMarginChange(routing_id(), start_margin)); -} - void SearchIPCRouter::SetInputInProgress(bool input_in_progress) { if (!policy_->ShouldSendSetInputInProgress(is_active_tab_)) return; diff --git a/chrome/browser/ui/search/search_ipc_router.h b/chrome/browser/ui/search/search_ipc_router.h index bc7636a..9564050 100644 --- a/chrome/browser/ui/search/search_ipc_router.h +++ b/chrome/browser/ui/search/search_ipc_router.h @@ -110,7 +110,6 @@ class SearchIPCRouter : public content::WebContentsObserver { virtual bool ShouldSendSetPromoInformation() = 0; virtual bool ShouldSendSetDisplayInstantResults() = 0; virtual bool ShouldSendSetSuggestionToPrefetch() = 0; - virtual bool ShouldSendSetOmniboxStartMargin() = 0; virtual bool ShouldSendSetInputInProgress(bool is_active_tab) = 0; virtual bool ShouldSendOmniboxFocusChanged() = 0; virtual bool ShouldSendMostVisitedItems() = 0; @@ -146,10 +145,6 @@ class SearchIPCRouter : public content::WebContentsObserver { // Tells the page the suggestion to be prefetched if any. void SetSuggestionToPrefetch(const InstantSuggestion& suggestion); - // Tells the page the left margin of the omnibox. This is used by the page to - // align text or assets properly with the omnibox. - void SetOmniboxStartMargin(int start_margin); - // Tells the page that user input started or stopped. void SetInputInProgress(bool input_in_progress); diff --git a/chrome/browser/ui/search/search_ipc_router_policy_impl.cc b/chrome/browser/ui/search/search_ipc_router_policy_impl.cc index 382038a..8af1228 100644 --- a/chrome/browser/ui/search/search_ipc_router_policy_impl.cc +++ b/chrome/browser/ui/search/search_ipc_router_policy_impl.cc @@ -71,10 +71,6 @@ bool SearchIPCRouterPolicyImpl::ShouldSendSetSuggestionToPrefetch() { return !is_incognito_; } -bool SearchIPCRouterPolicyImpl::ShouldSendSetOmniboxStartMargin() { - return true; -} - bool SearchIPCRouterPolicyImpl::ShouldSendSetInputInProgress( bool is_active_tab) { return is_active_tab && !is_incognito_; diff --git a/chrome/browser/ui/search/search_ipc_router_policy_impl.h b/chrome/browser/ui/search/search_ipc_router_policy_impl.h index 4c26059..2322186 100644 --- a/chrome/browser/ui/search/search_ipc_router_policy_impl.h +++ b/chrome/browser/ui/search/search_ipc_router_policy_impl.h @@ -34,7 +34,6 @@ class SearchIPCRouterPolicyImpl : public SearchIPCRouter::Policy { bool ShouldSendSetPromoInformation() override; bool ShouldSendSetDisplayInstantResults() override; bool ShouldSendSetSuggestionToPrefetch() override; - bool ShouldSendSetOmniboxStartMargin() override; bool ShouldSendSetInputInProgress(bool is_active_tab) override; bool ShouldSendOmniboxFocusChanged() override; bool ShouldSendMostVisitedItems() override; diff --git a/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc b/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc index ad221b5..f3e15bc 100644 --- a/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc +++ b/chrome/browser/ui/search/search_ipc_router_policy_unittest.cc @@ -172,11 +172,6 @@ TEST_F(SearchIPCRouterPolicyTest, SendSetSuggestionToPrefetch) { EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendSetSuggestionToPrefetch()); } -TEST_F(SearchIPCRouterPolicyTest, SendSetOmniboxStartMargin) { - NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); - EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSendSetOmniboxStartMargin()); -} - TEST_F(SearchIPCRouterPolicyTest, DoNotSendSetMessagesForIncognitoPage) { NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); @@ -197,9 +192,7 @@ TEST_F(SearchIPCRouterPolicyTest, NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); SetIncognitoProfile(); - SearchIPCRouter::Policy* router_policy = GetSearchIPCRouterPolicy(); - EXPECT_TRUE(router_policy->ShouldSubmitQuery()); - EXPECT_TRUE(router_policy->ShouldSendSetOmniboxStartMargin()); + EXPECT_TRUE(GetSearchIPCRouterPolicy()->ShouldSubmitQuery()); } TEST_F(SearchIPCRouterPolicyTest, SendMostVisitedItems) { diff --git a/chrome/browser/ui/search/search_ipc_router_unittest.cc b/chrome/browser/ui/search/search_ipc_router_unittest.cc index 05f7ffd..70d6a83 100644 --- a/chrome/browser/ui/search/search_ipc_router_unittest.cc +++ b/chrome/browser/ui/search/search_ipc_router_unittest.cc @@ -80,7 +80,6 @@ class MockSearchIPCRouterPolicy : public SearchIPCRouter::Policy { MOCK_METHOD0(ShouldSendSetPromoInformation, bool()); MOCK_METHOD0(ShouldSendSetDisplayInstantResults, bool()); MOCK_METHOD0(ShouldSendSetSuggestionToPrefetch, bool()); - MOCK_METHOD0(ShouldSendSetOmniboxStartMargin, bool()); MOCK_METHOD1(ShouldSendSetInputInProgress, bool(bool)); MOCK_METHOD0(ShouldSendOmniboxFocusChanged, bool()); MOCK_METHOD0(ShouldSendMostVisitedItems, bool()); @@ -109,8 +108,7 @@ class SearchIPCRouterTest : public BrowserWithTestWindowTest { TemplateURLData data; data.SetShortName(base::ASCIIToUTF16("foo.com")); data.SetURL("http://foo.com/url?bar={searchTerms}"); - data.instant_url = "http://foo.com/instant?" - "{google:omniboxStartMarginParameter}foo=foo#foo=foo&espv"; + data.instant_url = "http://foo.com/instant?foo=foo#foo=foo&espv"; data.new_tab_url = "https://foo.com/newtab?espv"; data.alternate_urls.push_back("http://foo.com/alt#quux={searchTerms}"); data.search_terms_replacement_key = "espv"; @@ -700,30 +698,6 @@ TEST_F(SearchIPCRouterTest, DoNotSendSetSuggestionToPrefetch) { ChromeViewMsg_SearchBoxSetSuggestionToPrefetch::ID)); } -TEST_F(SearchIPCRouterTest, SendSetOmniboxStartMargin) { - NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); - SetupMockDelegateAndPolicy(); - MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); - EXPECT_CALL(*policy, ShouldSendSetOmniboxStartMargin()).Times(1) - .WillOnce(testing::Return(true)); - - process()->sink().ClearMessages(); - GetSearchIPCRouter().SetOmniboxStartMargin(92); - EXPECT_TRUE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID)); -} - -TEST_F(SearchIPCRouterTest, DoNotSendSetOmniboxStartMargin) { - NavigateAndCommitActiveTab(GURL("chrome-search://foo/bar")); - SetupMockDelegateAndPolicy(); - MockSearchIPCRouterPolicy* policy = GetSearchIPCRouterPolicy(); - EXPECT_CALL(*policy, ShouldSendSetOmniboxStartMargin()).Times(1) - .WillOnce(testing::Return(false)); - - process()->sink().ClearMessages(); - GetSearchIPCRouter().SetOmniboxStartMargin(92); - EXPECT_FALSE(MessageWasSent(ChromeViewMsg_SearchBoxMarginChange::ID)); -} - TEST_F(SearchIPCRouterTest, SendOmniboxFocusChange) { NavigateAndCommitActiveTab(GURL(chrome::kChromeSearchLocalNtpUrl)); SetupMockDelegateAndPolicy(); diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc index 1226775..65a7f91 100644 --- a/chrome/browser/ui/search/search_tab_helper.cc +++ b/chrome/browser/ui/search/search_tab_helper.cc @@ -340,12 +340,8 @@ void SearchTabHelper::NavigationEntryCommitted( return; if (search::ShouldAssignURLToInstantRenderer(web_contents_->GetURL(), - profile())) { - InstantService* instant_service = - InstantServiceFactory::GetForProfile(profile()); - ipc_router_.SetOmniboxStartMargin(instant_service->omnibox_start_margin()); + profile())) ipc_router_.SetDisplayInstantResults(); - } UpdateMode(true, false); @@ -410,10 +406,6 @@ void SearchTabHelper::LogMostVisitedItemsSource( } } -void SearchTabHelper::OmniboxStartMarginChanged(int omnibox_start_margin) { - ipc_router_.SetOmniboxStartMargin(omnibox_start_margin); -} - void SearchTabHelper::FocusOmnibox(OmniboxFocusState state) { // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. #if !defined(OS_ANDROID) diff --git a/chrome/browser/ui/search/search_tab_helper.h b/chrome/browser/ui/search/search_tab_helper.h index a58b2c6..b265d7a 100644 --- a/chrome/browser/ui/search/search_tab_helper.h +++ b/chrome/browser/ui/search/search_tab_helper.h @@ -179,7 +179,6 @@ class SearchTabHelper : public content::WebContentsObserver, void ThemeInfoChanged(const ThemeBackgroundInfo& theme_info) override; void MostVisitedItemsChanged( const std::vector<InstantMostVisitedItem>& items) override; - void OmniboxStartMarginChanged(int omnibox_start_margin) override; // Sets the mode of the model based on the current URL of web_contents(). // Only updates the origin part of the mode if |update_origin| is true, diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index 0e78556..a5195bd 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -22,16 +22,12 @@ #include "chrome/browser/extensions/location_bar_controller.h" #include "chrome/browser/extensions/tab_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/search/instant_service.h" -#include "chrome/browser/search/instant_service_factory.h" -#include "chrome/browser/search/search.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/translate/chrome_translate_client.h" #include "chrome/browser/translate/translate_service.h" #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" -#include "chrome/browser/ui/browser_instant_controller.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" #include "chrome/browser/ui/layout_constants.h" @@ -1247,11 +1243,6 @@ const char* LocationBarView::GetClassName() const { } void LocationBarView::OnBoundsChanged(const gfx::Rect& previous_bounds) { - InstantService* instant_service = - InstantServiceFactory::GetForProfile(profile()); - if (instant_service) - instant_service->OnOmniboxStartMarginChanged(bounds().x()); - OmniboxPopupView* popup = omnibox_view_->model()->popup_model()->view(); if (popup->IsOpen()) popup->UpdatePopupAppearance(); diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 0e32f14..ddc7796 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -226,8 +226,6 @@ IPC_MESSAGE_ROUTED2(ChromeViewMsg_SearchBoxFocusChanged, OmniboxFocusState /* new_focus_state */, OmniboxFocusChangeReason /* reason */) -IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxMarginChange, int /* start */) - IPC_MESSAGE_ROUTED1(ChromeViewMsg_SearchBoxMostVisitedItemsChanged, std::vector<InstantMostVisitedItem> /* items */) diff --git a/chrome/renderer/resources/extensions/searchbox_api.js b/chrome/renderer/resources/extensions/searchbox_api.js index d99fa26..5120ff6 100644 --- a/chrome/renderer/resources/extensions/searchbox_api.js +++ b/chrome/renderer/resources/extensions/searchbox_api.js @@ -19,7 +19,6 @@ if (!chrome.embeddedSearch) { native function GetQuery(); native function GetSearchRequestParams(); native function GetRightToLeft(); - native function GetStartMargin(); native function GetSuggestionToPrefetch(); native function IsFocused(); native function IsKeyCaptureEnabled(); @@ -34,7 +33,6 @@ if (!chrome.embeddedSearch) { this.__defineGetter__('isFocused', IsFocused); this.__defineGetter__('isKeyCaptureEnabled', IsKeyCaptureEnabled); this.__defineGetter__('rtl', GetRightToLeft); - this.__defineGetter__('startMargin', GetStartMargin); this.__defineGetter__('suggestion', GetSuggestionToPrefetch); this.__defineGetter__('value', GetQuery); Object.defineProperty(this, 'requestParams', @@ -78,7 +76,6 @@ if (!chrome.embeddedSearch) { this.onfocuschange = null; this.onkeycapturechange = null; - this.onmarginchange = null; this.onsubmit = null; this.onsuggestionchange = null; diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc index ed0e62a..b629e63 100644 --- a/chrome/renderer/searchbox/searchbox.cc +++ b/chrome/renderer/searchbox/searchbox.cc @@ -241,8 +241,7 @@ SearchBox::SearchBox(content::RenderView* render_view) is_key_capture_enabled_(false), display_instant_results_(false), most_visited_items_cache_(kMaxInstantMostVisitedItemCacheSize), - query_(), - start_margin_(0) { + query_() { } SearchBox::~SearchBox() { @@ -379,7 +378,6 @@ bool SearchBox::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(ChromeViewMsg_HistorySyncCheckResult, OnHistorySyncCheckResult) IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxFocusChanged, OnFocusChanged) - IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxMarginChange, OnMarginChange) IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxMostVisitedItemsChanged, OnMostVisitedChanged) IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxPromoInformation, @@ -460,14 +458,6 @@ void SearchBox::OnHistorySyncCheckResult(bool sync_history) { } } -void SearchBox::OnMarginChange(int margin) { - start_margin_ = margin; - if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { - extensions_v8::SearchBoxExtension::DispatchMarginChange( - render_view()->GetWebView()->mainFrame()); - } -} - void SearchBox::OnMostVisitedChanged( const std::vector<InstantMostVisitedItem>& items) { std::vector<InstantMostVisitedItemIDPair> last_known_items; @@ -551,7 +541,6 @@ void SearchBox::Reset() { query_.clear(); embedded_search_request_params_ = EmbeddedSearchRequestParams(); suggestion_ = InstantSuggestion(); - start_margin_ = 0; is_focused_ = false; is_key_capture_enabled_ = false; theme_info_ = ThemeBackgroundInfo(); diff --git a/chrome/renderer/searchbox/searchbox.h b/chrome/renderer/searchbox/searchbox.h index 562c3e4..fa41434 100644 --- a/chrome/renderer/searchbox/searchbox.h +++ b/chrome/renderer/searchbox/searchbox.h @@ -140,7 +140,6 @@ class SearchBox : public content::RenderViewObserver, bool is_key_capture_enabled() const { return is_key_capture_enabled_; } bool display_instant_results() const { return display_instant_results_; } const base::string16& query() const { return query_; } - int start_margin() const { return start_margin_; } const InstantSuggestion& suggestion() const { return suggestion_; } private: @@ -154,7 +153,6 @@ class SearchBox : public content::RenderViewObserver, void OnFocusChanged(OmniboxFocusState new_focus_state, OmniboxFocusChangeReason reason); void OnHistorySyncCheckResult(bool sync_history); - void OnMarginChange(int margin); void OnMostVisitedChanged( const std::vector<InstantMostVisitedItem>& items); void OnPromoInformationReceived(bool is_app_launcher_enabled); @@ -184,7 +182,6 @@ class SearchBox : public content::RenderViewObserver, ThemeBackgroundInfo theme_info_; base::string16 query_; EmbeddedSearchRequestParams embedded_search_request_params_; - int start_margin_; InstantSuggestion suggestion_; DISALLOW_COPY_AND_ASSIGN(SearchBox); diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc index 2b20a41..5dc7ae5 100644 --- a/chrome/renderer/searchbox/searchbox_extension.cc +++ b/chrome/renderer/searchbox/searchbox_extension.cc @@ -353,17 +353,6 @@ static const char kDispatchKeyCaptureChangeScript[] = " true;" "}"; -static const char kDispatchMarginChangeEventScript[] = - "if (window.chrome &&" - " window.chrome.embeddedSearch &&" - " window.chrome.embeddedSearch.searchBox &&" - " window.chrome.embeddedSearch.searchBox.onmarginchange &&" - " typeof window.chrome.embeddedSearch.searchBox.onmarginchange ==" - " 'function') {" - " window.chrome.embeddedSearch.searchBox.onmarginchange();" - " true;" - "}"; - static const char kDispatchMostVisitedChangedScript[] = "if (window.chrome &&" " window.chrome.embeddedSearch &&" @@ -466,9 +455,6 @@ class SearchBoxExtensionWrapper : public v8::Extension { static void GetSearchRequestParams( const v8::FunctionCallbackInfo<v8::Value>& args); - // Gets the start-edge margin to use with extended Instant. - static void GetStartMargin(const v8::FunctionCallbackInfo<v8::Value>& args); - // Gets the current top suggestion to prefetch search results. static void GetSuggestionToPrefetch( const v8::FunctionCallbackInfo<v8::Value>& args); @@ -591,11 +577,6 @@ void SearchBoxExtension::DispatchKeyCaptureChange(blink::WebFrame* frame) { } // static -void SearchBoxExtension::DispatchMarginChange(blink::WebFrame* frame) { - Dispatch(frame, kDispatchMarginChangeEventScript); -} - -// static void SearchBoxExtension::DispatchMostVisitedChanged( blink::WebFrame* frame) { Dispatch(frame, kDispatchMostVisitedChangedScript); @@ -649,8 +630,6 @@ SearchBoxExtensionWrapper::GetNativeFunctionTemplate( return v8::FunctionTemplate::New(isolate, GetRightToLeft); if (name->Equals(v8::String::NewFromUtf8(isolate, "GetSearchRequestParams"))) return v8::FunctionTemplate::New(isolate, GetSearchRequestParams); - if (name->Equals(v8::String::NewFromUtf8(isolate, "GetStartMargin"))) - return v8::FunctionTemplate::New(isolate, GetStartMargin); if (name->Equals(v8::String::NewFromUtf8(isolate, "GetSuggestionToPrefetch"))) return v8::FunctionTemplate::New(isolate, GetSuggestionToPrefetch); if (name->Equals(v8::String::NewFromUtf8(isolate, "GetThemeBackgroundInfo"))) @@ -894,15 +873,6 @@ void SearchBoxExtensionWrapper::GetSearchRequestParams( } // static -void SearchBoxExtensionWrapper::GetStartMargin( - const v8::FunctionCallbackInfo<v8::Value>& args) { - content::RenderView* render_view = GetRenderView(); - if (!render_view) return; - args.GetReturnValue().Set(static_cast<int32_t>( - SearchBox::Get(render_view)->start_margin())); -} - -// static void SearchBoxExtensionWrapper::GetSuggestionToPrefetch( const v8::FunctionCallbackInfo<v8::Value>& args) { content::RenderView* render_view = GetRenderView(); diff --git a/chrome/renderer/searchbox/searchbox_extension.h b/chrome/renderer/searchbox/searchbox_extension.h index c63e1d7..1ce9a95 100644 --- a/chrome/renderer/searchbox/searchbox_extension.h +++ b/chrome/renderer/searchbox/searchbox_extension.h @@ -40,7 +40,6 @@ class SearchBoxExtension { static void DispatchInputCancel(blink::WebFrame* frame); static void DispatchInputStart(blink::WebFrame* frame); static void DispatchKeyCaptureChange(blink::WebFrame* frame); - static void DispatchMarginChange(blink::WebFrame* frame); static void DispatchMostVisitedChanged(blink::WebFrame* frame); static void DispatchSubmit(blink::WebFrame* frame); static void DispatchSuggestionChange(blink::WebFrame* frame); diff --git a/chrome/test/data/diagnostics/user/Default/Preferences b/chrome/test/data/diagnostics/user/Default/Preferences index 0718051..a941f16 100644 --- a/chrome/test/data/diagnostics/user/Default/Preferences +++ b/chrome/test/data/diagnostics/user/Default/Preferences @@ -22,7 +22,7 @@ "encodings": "UTF-8", "icon_url": "http://www.google.com/favicon.ico", "id": "2", - "instant_url": "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}{google:forceInstantResults}{google:instantExtendedEnabledParameter}{google:ntpIsThemedParameter}{google:omniboxStartMarginParameter}ie={inputEncoding}", + "instant_url": "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}{google:forceInstantResults}{google:instantExtendedEnabledParameter}ie={inputEncoding}", "keyword": "google.com", "name": "Google", "prepopulate_id": "1", diff --git a/components/omnibox/browser/autocomplete_provider_client.h b/components/omnibox/browser/autocomplete_provider_client.h index acaa7ac..301d60b 100644 --- a/components/omnibox/browser/autocomplete_provider_client.h +++ b/components/omnibox/browser/autocomplete_provider_client.h @@ -85,9 +85,6 @@ class AutocompleteProviderClient { virtual bool IsOffTheRecord() const = 0; virtual bool SearchSuggestEnabled() const = 0; - // Returns whether the bookmark bar is visible on all tabs. - virtual bool BookmarkBarIsVisible() const = 0; - virtual bool TabSyncEnabledAndUnencrypted() const = 0; // Given some string |text| that the user wants to use for navigation, diff --git a/components/omnibox/browser/base_search_provider.cc b/components/omnibox/browser/base_search_provider.cc index c6833f6..0c1feb15a 100644 --- a/components/omnibox/browser/base_search_provider.cc +++ b/components/omnibox/browser/base_search_provider.cc @@ -265,7 +265,6 @@ AutocompleteMatch BaseSearchProvider::CreateSearchSuggestion( new TemplateURLRef::SearchTermsArgs(suggestion.suggestion())); match.search_terms_args->original_query = input.text(); match.search_terms_args->accepted_suggestion = accepted_suggestion; - match.search_terms_args->enable_omnibox_start_margin = true; match.search_terms_args->suggest_query_params = suggestion.suggest_query_params(); match.search_terms_args->append_extra_query_params = @@ -372,8 +371,6 @@ void BaseSearchProvider::AddMatchToMap( accepted_suggestion, ShouldAppendExtraParams(result)); if (!match.destination_url.is_valid()) return; - match.search_terms_args->bookmark_bar_pinned = - client_->BookmarkBarIsVisible(); match.RecordAdditionalInfo(kRelevanceFromServerKey, result.relevance_from_server() ? kTrue : kFalse); match.RecordAdditionalInfo(kShouldPrefetchKey, diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc index 978cb86..a7a4b01 100644 --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc @@ -277,10 +277,8 @@ class SearchTermsDataSnapshot : public SearchTermsData { std::string GetApplicationLocale() const override; base::string16 GetRlzParameterValue(bool from_app_list) const override; std::string GetSearchClient() const override; - bool IsShowingSearchTermsOnSearchResultsPages() const override; std::string InstantExtendedEnabledParam(bool for_search) const override; std::string ForceInstantResultsParam(bool for_prerender) const override; - std::string NTPIsThemedParam() const override; std::string GoogleImageSearchSource() const override; private: @@ -288,12 +286,10 @@ class SearchTermsDataSnapshot : public SearchTermsData { std::string application_locale_; base::string16 rlz_parameter_value_; std::string search_client_; - bool is_showing_search_terms_on_search_results_pages_; std::string instant_extended_enabled_param_; std::string instant_extended_enabled_param_for_search_; std::string force_instant_results_param_; std::string force_instant_results_param_for_prerender_; - std::string ntp_is_themed_param_; std::string google_image_search_source_; DISALLOW_COPY_AND_ASSIGN(SearchTermsDataSnapshot); @@ -305,8 +301,6 @@ SearchTermsDataSnapshot::SearchTermsDataSnapshot( application_locale_(search_terms_data.GetApplicationLocale()), rlz_parameter_value_(search_terms_data.GetRlzParameterValue(false)), search_client_(search_terms_data.GetSearchClient()), - is_showing_search_terms_on_search_results_pages_( - search_terms_data.IsShowingSearchTermsOnSearchResultsPages()), instant_extended_enabled_param_( search_terms_data.InstantExtendedEnabledParam(false)), instant_extended_enabled_param_for_search_( @@ -315,7 +309,6 @@ SearchTermsDataSnapshot::SearchTermsDataSnapshot( search_terms_data.ForceInstantResultsParam(false)), force_instant_results_param_for_prerender_( search_terms_data.ForceInstantResultsParam(true)), - ntp_is_themed_param_(search_terms_data.NTPIsThemedParam()), google_image_search_source_(search_terms_data.GoogleImageSearchSource()) { } @@ -339,10 +332,6 @@ std::string SearchTermsDataSnapshot::GetSearchClient() const { return search_client_; } -bool SearchTermsDataSnapshot::IsShowingSearchTermsOnSearchResultsPages() const { - return is_showing_search_terms_on_search_results_pages_; -} - std::string SearchTermsDataSnapshot::InstantExtendedEnabledParam( bool for_search) const { return for_search ? instant_extended_enabled_param_ : @@ -355,10 +344,6 @@ std::string SearchTermsDataSnapshot::ForceInstantResultsParam( force_instant_results_param_for_prerender_; } -std::string SearchTermsDataSnapshot::NTPIsThemedParam() const { - return ntp_is_themed_param_; -} - std::string SearchTermsDataSnapshot::GoogleImageSearchSource() const { return google_image_search_source_; } diff --git a/components/omnibox/browser/mock_autocomplete_provider_client.h b/components/omnibox/browser/mock_autocomplete_provider_client.h index af390d3..1810dd1 100644 --- a/components/omnibox/browser/mock_autocomplete_provider_client.h +++ b/components/omnibox/browser/mock_autocomplete_provider_client.h @@ -64,7 +64,6 @@ class MockAutocompleteProviderClient : public AutocompleteProviderClient { MOCK_METHOD0(GetBuiltinsToProvideAsUserTypes, std::vector<base::string16>()); MOCK_CONST_METHOD0(IsOffTheRecord, bool()); MOCK_CONST_METHOD0(SearchSuggestEnabled, bool()); - MOCK_CONST_METHOD0(BookmarkBarIsVisible, bool()); MOCK_CONST_METHOD0(TabSyncEnabledAndUnencrypted, bool()); MOCK_METHOD6( Classify, diff --git a/components/search/search.cc b/components/search/search.cc index 807e476..cbc9552 100644 --- a/components/search/search.cc +++ b/components/search/search.cc @@ -71,9 +71,6 @@ const char kReuseInstantSearchBasePage[] = "reuse_instant_search_base_page"; } // namespace -// Negative start-margin values prevent the "es_sm" parameter from being used. -const int kDisableStartMargin = -1; - bool IsInstantExtendedAPIEnabled() { #if defined(OS_IOS) return false; diff --git a/components/search/search.h b/components/search/search.h index 3907f85..d97b240 100644 --- a/components/search/search.h +++ b/components/search/search.h @@ -19,10 +19,6 @@ class TemplateURL; namespace search { -// Use this value for "start margin" to prevent the "es_sm" parameter from -// being used. -extern const int kDisableStartMargin; - // Returns whether the Instant Extended API is enabled. bool IsInstantExtendedAPIEnabled(); diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json index 8c4717d..f18125e 100644 --- a/components/search_engines/prepopulated_engines.json +++ b/components/search_engines/prepopulated_engines.json @@ -30,7 +30,7 @@ // Increment this if you change the data in ways that mean users with // existing data should get a new version. - "kCurrentDataVersion": 87 + "kCurrentDataVersion": 88 }, // The following engines are included in country lists and are added to the @@ -110,11 +110,11 @@ "name": "Google", "keyword": "google.com", "favicon_url": "http://www.google.com/favicon.ico", - "search_url": "{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:bookmarkBarPinned}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:omniboxStartMarginParameter}{google:contextualSearchVersion}ie={inputEncoding}", + "search_url": "{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:contextualSearchVersion}ie={inputEncoding}", "suggest_url": "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:inputType}{google:cursorPosition}{google:currentPageUrl}{google:pageClassification}{google:searchVersion}{google:sessionToken}{google:prefetchQuery}sugkey={google:suggestAPIKeyParameter}", - "instant_url": "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}{google:forceInstantResults}{google:instantExtendedEnabledParameter}{google:ntpIsThemedParameter}{google:omniboxStartMarginParameter}ie={inputEncoding}", + "instant_url": "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}{google:forceInstantResults}{google:instantExtendedEnabledParameter}ie={inputEncoding}", "image_url": "{google:baseURL}searchbyimage/upload", - "new_tab_url": "{google:baseURL}_/chrome/newtab?{google:RLZ}{google:instantExtendedEnabledParameter}{google:ntpIsThemedParameter}ie={inputEncoding}", + "new_tab_url": "{google:baseURL}_/chrome/newtab?{google:RLZ}{google:instantExtendedEnabledParameter}ie={inputEncoding}", "contextual_search_url": "{google:baseURL}_/contextualsearch?{google:contextualSearchVersion}{google:contextualSearchContextData}", "image_url_post_params": "encoded_image={google:imageThumbnail},image_url={google:imageURL},sbisrc={google:imageSearchSource},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight}", "alternate_urls": [ diff --git a/components/search_engines/search_terms_data.cc b/components/search_engines/search_terms_data.cc index be897db..f7300e4 100644 --- a/components/search_engines/search_terms_data.cc +++ b/components/search_engines/search_terms_data.cc @@ -54,10 +54,6 @@ std::string SearchTermsData::GetSuggestRequestIdentifier() const { return std::string(); } -bool SearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { - return false; -} - std::string SearchTermsData::InstantExtendedEnabledParam( bool for_search) const { return std::string(); @@ -68,14 +64,6 @@ std::string SearchTermsData::ForceInstantResultsParam( return std::string(); } -int SearchTermsData::OmniboxStartMargin() const { - return 0; -} - -std::string SearchTermsData::NTPIsThemedParam() const { - return std::string(); -} - std::string SearchTermsData::IOSWebViewTypeParam() const { return std::string(); } diff --git a/components/search_engines/search_terms_data.h b/components/search_engines/search_terms_data.h index 2cd5951..0ac6159 100644 --- a/components/search_engines/search_terms_data.h +++ b/components/search_engines/search_terms_data.h @@ -49,10 +49,6 @@ class SearchTermsData { // This implementation returns the empty string. virtual std::string GetSuggestRequestIdentifier() const; - // Returns true if search terms are shown in the omnibox on search results - // pages. - virtual bool IsShowingSearchTermsOnSearchResultsPages() const; - // Returns a string indicating whether InstantExtended is enabled. virtual std::string InstantExtendedEnabledParam(bool for_search) const; @@ -60,16 +56,6 @@ class SearchTermsData { // incrementally. virtual std::string ForceInstantResultsParam(bool for_prerender) const; - // Returns the start-edge margin of the omnibox in pixels. - virtual int OmniboxStartMargin() const; - - // Returns a string indicating whether a non-default theme is active, - // suitable for adding as a query string param to the homepage. This only - // applies if Instant Extended is enabled. Returns an empty string otherwise. - // Determining this requires accessing the Profile, so this can only ever be - // non-empty for UIThreadSearchTermsData. - virtual std::string NTPIsThemedParam() const; - // Returns a string indicating which webview is currently in use on iOS, // suitable for adding as a query string param to search requests. Returns an // empty string if no parameter should be passed along with search requests. diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc index b5baebe..a75779b 100644 --- a/components/search_engines/template_url.cc +++ b/components/search_engines/template_url.cc @@ -148,9 +148,7 @@ TemplateURLRef::SearchTermsArgs::SearchTermsArgs( input_type(metrics::OmniboxInputType::INVALID), accepted_suggestion(NO_SUGGESTIONS_AVAILABLE), cursor_position(base::string16::npos), - enable_omnibox_start_margin(false), page_classification(metrics::OmniboxEventProto::INVALID_SPEC), - bookmark_bar_pinned(false), append_extra_query_params(false), force_instant_results(false), from_app_list(false), @@ -571,8 +569,6 @@ bool TemplateURLRef::ParseParameter(size_t start, replacements->push_back(Replacement(GOOGLE_BASE_URL, start)); } else if (parameter == "google:baseSuggestURL") { replacements->push_back(Replacement(GOOGLE_BASE_SUGGEST_URL, start)); - } else if (parameter == "google:bookmarkBarPinned") { - replacements->push_back(Replacement(GOOGLE_BOOKMARK_BAR_PINNED, start)); } else if (parameter == "google:currentPageUrl") { replacements->push_back(Replacement(GOOGLE_CURRENT_PAGE_URL, start)); } else if (parameter == "google:cursorPosition") { @@ -602,10 +598,6 @@ bool TemplateURLRef::ParseParameter(size_t start, start)); } else if (parameter == "google:instantExtendedEnabledKey") { url->insert(start, google_util::kInstantExtendedAPIParam); - } else if (parameter == "google:ntpIsThemedParameter") { - replacements->push_back(Replacement(GOOGLE_NTP_IS_THEMED, start)); - } else if (parameter == "google:omniboxStartMarginParameter") { - replacements->push_back(Replacement(GOOGLE_OMNIBOX_START_MARGIN, start)); } else if (parameter == "google:contextualSearchVersion") { replacements->push_back( Replacement(GOOGLE_CONTEXTUAL_SEARCH_VERSION, start)); @@ -904,17 +896,6 @@ std::string TemplateURLRef::HandleReplacements( &url); break; - case GOOGLE_BOOKMARK_BAR_PINNED: - if (search_terms_data.IsShowingSearchTermsOnSearchResultsPages()) { - // Log whether the bookmark bar is pinned when the user is seeing - // InstantExtended on the SRP. - DCHECK(!i->is_post_param); - HandleReplacement( - "bmbp", search_terms_args.bookmark_bar_pinned ? "1" : "0", *i, - &url); - } - break; - case GOOGLE_CURRENT_PAGE_URL: DCHECK(!i->is_post_param); if (!search_terms_args.current_page_url.empty()) { @@ -959,23 +940,6 @@ std::string TemplateURLRef::HandleReplacements( &url); break; - case GOOGLE_NTP_IS_THEMED: - DCHECK(!i->is_post_param); - HandleReplacement( - std::string(), search_terms_data.NTPIsThemedParam(), *i, &url); - break; - - case GOOGLE_OMNIBOX_START_MARGIN: - DCHECK(!i->is_post_param); - if (search_terms_args.enable_omnibox_start_margin) { - int omnibox_start_margin = search_terms_data.OmniboxStartMargin(); - if (omnibox_start_margin >= 0) { - HandleReplacement("es_sm", base::IntToString(omnibox_start_margin), - *i, &url); - } - } - break; - case GOOGLE_CONTEXTUAL_SEARCH_VERSION: if (search_terms_args.contextual_search_params.version >= 0) { HandleReplacement( diff --git a/components/search_engines/template_url.h b/components/search_engines/template_url.h index c07f428..dd11b39 100644 --- a/components/search_engines/template_url.h +++ b/components/search_engines/template_url.h @@ -147,10 +147,6 @@ class TemplateURLRef { // the request was issued. Set to base::string16::npos if not used. size_t cursor_position; - // True to enable the start-edge margin of the omnibox, used in extended - // Instant to align the preview contents with the omnibox. - bool enable_omnibox_start_margin; - // The URL of the current webpage to be used for experimental zero-prefix // suggestions. std::string current_page_url; @@ -158,9 +154,6 @@ class TemplateURLRef { // Which omnibox the user used to type the prefix. metrics::OmniboxEventProto::PageClassification page_classification; - // True for searches issued with the bookmark bar pref set to shown. - bool bookmark_bar_pinned; - // Optional session token. std::string session_token; @@ -311,7 +304,6 @@ class TemplateURLRef { FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLTwoParameters); FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ParseURLNestedParameter); FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, URLRefTestImageURLWithPOST); - FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ReflectsBookmarkBarPinned); // Enumeration of the known types. enum ReplacementType { @@ -319,7 +311,6 @@ class TemplateURLRef { GOOGLE_ASSISTED_QUERY_STATS, GOOGLE_BASE_URL, GOOGLE_BASE_SUGGEST_URL, - GOOGLE_BOOKMARK_BAR_PINNED, GOOGLE_CURRENT_PAGE_URL, GOOGLE_CURSOR_POSITION, GOOGLE_FORCE_INSTANT_RESULTS, @@ -331,7 +322,6 @@ class TemplateURLRef { GOOGLE_INPUT_TYPE, GOOGLE_INSTANT_EXTENDED_ENABLED, GOOGLE_NTP_IS_THEMED, - GOOGLE_OMNIBOX_START_MARGIN, GOOGLE_CONTEXTUAL_SEARCH_VERSION, GOOGLE_CONTEXTUAL_SEARCH_CONTEXT_DATA, GOOGLE_ORIGINAL_QUERY_FOR_SUGGESTION, @@ -714,7 +704,6 @@ class TemplateURL { private: friend class TemplateURLService; - FRIEND_TEST_ALL_PREFIXES(TemplateURLTest, ReflectsBookmarkBarPinned); void CopyFrom(const TemplateURL& other); diff --git a/components/search_engines/template_url_unittest.cc b/components/search_engines/template_url_unittest.cc index 8a0227b..a5f3399 100644 --- a/components/search_engines/template_url_unittest.cc +++ b/components/search_engines/template_url_unittest.cc @@ -645,42 +645,6 @@ TEST_F(TemplateURLTest, ReplaceCurrentPageUrl) { } } -TEST_F(TemplateURLTest, OmniboxStartmargin) { - struct TestData { - const bool enable_omnibox_start_margin; - const int omnibox_start_margin; - const std::string expected_result; - } test_data[] = { - { false, - 0, - "http://bar/foo?q=foobar" }, - { true, - 0, - "http://bar/foo?es_sm=0&q=foobar" }, - { true, - 42, - "http://bar/foo?es_sm=42&q=foobar" }, - }; - TemplateURLData data; - data.SetURL("http://bar/foo?{google:omniboxStartMarginParameter}" - "q={searchTerms}"); - data.input_encodings.push_back("UTF-8"); - TemplateURL url(data); - EXPECT_TRUE(url.url_ref().IsValid(search_terms_data_)); - ASSERT_TRUE(url.url_ref().SupportsReplacement(search_terms_data_)); - for (size_t i = 0; i < arraysize(test_data); ++i) { - TemplateURLRef::SearchTermsArgs search_terms_args(ASCIIToUTF16("foobar")); - search_terms_args.enable_omnibox_start_margin = - test_data[i].enable_omnibox_start_margin; - search_terms_data_.set_omnibox_start_margin( - test_data[i].omnibox_start_margin); - GURL result(url.url_ref().ReplaceSearchTerms(search_terms_args, - search_terms_data_)); - ASSERT_TRUE(result.is_valid()); - EXPECT_EQ(test_data[i].expected_result, result.spec()); - } -} - TEST_F(TemplateURLTest, Suggestions) { struct TestData { const int accepted_suggestion; @@ -1605,35 +1569,6 @@ TEST_F(TemplateURLTest, IsSearchResults) { } } -TEST_F(TemplateURLTest, ReflectsBookmarkBarPinned) { - TemplateURLData data; - data.input_encodings.push_back("UTF-8"); - data.SetURL("{google:baseURL}?{google:bookmarkBarPinned}q={searchTerms}"); - TemplateURL url(data); - EXPECT_TRUE(url.url_ref().IsValid(search_terms_data_)); - ASSERT_TRUE(url.url_ref().SupportsReplacement(search_terms_data_)); - TemplateURLRef::SearchTermsArgs search_terms_args(ASCIIToUTF16("foo")); - - // Do not add the param when InstantExtended is suppressed on SRPs. - search_terms_data_.set_is_showing_search_terms_on_search_results_pages(false); - std::string result = url.url_ref().ReplaceSearchTerms(search_terms_args, - search_terms_data_); - EXPECT_EQ("http://www.google.com/?q=foo", result); - - // Add the param when InstantExtended is not suppressed on SRPs. - search_terms_data_.set_is_showing_search_terms_on_search_results_pages(true); - search_terms_args.bookmark_bar_pinned = false; - result = url.url_ref().ReplaceSearchTerms(search_terms_args, - search_terms_data_); - EXPECT_EQ("http://www.google.com/?bmbp=0&q=foo", result); - - search_terms_data_.set_is_showing_search_terms_on_search_results_pages(true); - search_terms_args.bookmark_bar_pinned = true; - result = url.url_ref().ReplaceSearchTerms(search_terms_args, - search_terms_data_); - EXPECT_EQ("http://www.google.com/?bmbp=1&q=foo", result); -} - TEST_F(TemplateURLTest, SearchboxVersionIncludedForAnswers) { TemplateURLData data; search_terms_data_.set_google_base_url("http://bar/"); diff --git a/components/search_engines/testing_search_terms_data.cc b/components/search_engines/testing_search_terms_data.cc index b4e9824..9fed5cf 100644 --- a/components/search_engines/testing_search_terms_data.cc +++ b/components/search_engines/testing_search_terms_data.cc @@ -8,8 +8,7 @@ TestingSearchTermsData::TestingSearchTermsData( const std::string& google_base_url) - : google_base_url_(google_base_url), - is_showing_search_terms_on_search_results_pages_(false) { + : google_base_url_(google_base_url) { } TestingSearchTermsData::~TestingSearchTermsData() {} @@ -31,11 +30,3 @@ std::string TestingSearchTermsData::GetSearchClient() const { std::string TestingSearchTermsData::GoogleImageSearchSource() const { return "google_image_search_source"; } - -bool TestingSearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { - return is_showing_search_terms_on_search_results_pages_; -} - -int TestingSearchTermsData::OmniboxStartMargin() const { - return omnibox_start_margin_; -} diff --git a/components/search_engines/testing_search_terms_data.h b/components/search_engines/testing_search_terms_data.h index b03c71b..083d025 100644 --- a/components/search_engines/testing_search_terms_data.h +++ b/components/search_engines/testing_search_terms_data.h @@ -17,8 +17,6 @@ class TestingSearchTermsData : public SearchTermsData { base::string16 GetRlzParameterValue(bool from_app_list) const override; std::string GetSearchClient() const override; std::string GoogleImageSearchSource() const override; - bool IsShowingSearchTermsOnSearchResultsPages() const override; - int OmniboxStartMargin() const override; void set_google_base_url(const std::string& google_base_url) { google_base_url_ = google_base_url; @@ -26,18 +24,10 @@ class TestingSearchTermsData : public SearchTermsData { void set_search_client(const std::string& search_client) { search_client_ = search_client; } - void set_is_showing_search_terms_on_search_results_pages(bool value) { - is_showing_search_terms_on_search_results_pages_ = value; - } - void set_omnibox_start_margin(int omnibox_start_margin) { - omnibox_start_margin_ = omnibox_start_margin; - } private: std::string google_base_url_; std::string search_client_; - bool is_showing_search_terms_on_search_results_pages_; - int omnibox_start_margin_; DISALLOW_COPY_AND_ASSIGN(TestingSearchTermsData); }; diff --git a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc index dd70a62..b3f933e 100644 --- a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc +++ b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.cc @@ -6,7 +6,6 @@ #include "base/prefs/pref_service.h" #include "base/strings/utf_string_conversions.h" -#include "components/bookmarks/common/bookmark_pref_names.h" #include "components/browser_sync/browser/profile_sync_service.h" #include "components/history/core/browser/history_service.h" #include "components/keyed_service/core/service_access_type.h" @@ -132,11 +131,6 @@ bool AutocompleteProviderClientImpl::SearchSuggestEnabled() const { return browser_state_->GetPrefs()->GetBoolean(prefs::kSearchSuggestEnabled); } -bool AutocompleteProviderClientImpl::BookmarkBarIsVisible() const { - return browser_state_->GetPrefs()->GetBoolean( - bookmarks::prefs::kShowBookmarkBar); -} - bool AutocompleteProviderClientImpl::TabSyncEnabledAndUnencrypted() const { return sync_driver::IsTabSyncEnabledAndUnencrypted( IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state_), diff --git a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.h b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.h index df8c60e..901494b 100644 --- a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.h +++ b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.h @@ -45,7 +45,6 @@ class AutocompleteProviderClientImpl : public AutocompleteProviderClient { std::vector<base::string16> GetBuiltinsToProvideAsUserTypes() override; bool IsOffTheRecord() const override; bool SearchSuggestEnabled() const override; - bool BookmarkBarIsVisible() const override; bool TabSyncEnabledAndUnencrypted() const override; void Classify( const base::string16& text, diff --git a/ios/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/ios/chrome/browser/search_engines/ui_thread_search_terms_data.cc index d6e92f6..ab06488 100644 --- a/ios/chrome/browser/search_engines/ui_thread_search_terms_data.cc +++ b/ios/chrome/browser/search_engines/ui_thread_search_terms_data.cc @@ -91,12 +91,6 @@ std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier() const { return "chrome-ext-ansg"; } -bool UIThreadSearchTermsData::IsShowingSearchTermsOnSearchResultsPages() const { - DCHECK(thread_checker_.CalledOnValidThread()); - return search::IsInstantExtendedAPIEnabled() && - search::IsQueryExtractionEnabled(); -} - std::string UIThreadSearchTermsData::InstantExtendedEnabledParam( bool for_search) const { DCHECK(thread_checker_.CalledOnValidThread()); @@ -109,18 +103,6 @@ std::string UIThreadSearchTermsData::ForceInstantResultsParam( return search::ForceInstantResultsParam(for_prerender); } -int UIThreadSearchTermsData::OmniboxStartMargin() const { - DCHECK(thread_checker_.CalledOnValidThread()); - // iOS has not InstantService. - return search::kDisableStartMargin; -} - -std::string UIThreadSearchTermsData::NTPIsThemedParam() const { - DCHECK(thread_checker_.CalledOnValidThread()); - // iOS does not supports themed NTP. - return std::string(); -} - std::string UIThreadSearchTermsData::IOSWebViewTypeParam() const { DCHECK(thread_checker_.CalledOnValidThread()); std::string param = experimental_flags::GetWKWebViewSearchParams(); diff --git a/ios/chrome/browser/search_engines/ui_thread_search_terms_data.h b/ios/chrome/browser/search_engines/ui_thread_search_terms_data.h index 0c8a2c2..b522a5e 100644 --- a/ios/chrome/browser/search_engines/ui_thread_search_terms_data.h +++ b/ios/chrome/browser/search_engines/ui_thread_search_terms_data.h @@ -26,11 +26,8 @@ class UIThreadSearchTermsData : public SearchTermsData { std::string GetSearchClient() const override; std::string GetSuggestClient() const override; std::string GetSuggestRequestIdentifier() const override; - bool IsShowingSearchTermsOnSearchResultsPages() const override; std::string InstantExtendedEnabledParam(bool for_search) const override; std::string ForceInstantResultsParam(bool for_prerender) const override; - int OmniboxStartMargin() const override; - std::string NTPIsThemedParam() const override; std::string IOSWebViewTypeParam() const override; std::string GoogleImageSearchSource() const override; |