Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4026)

Unified Diff: chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc

Issue 21395002: [InstantExtended] Fixing how PageLoadSRP is emitted. Previously it was emitted only for Instant sea… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last upload didn't seem to work Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc b/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc
index e26f8d5c08858f523c4fdc418ef98829eb9e39ed..7c3b74f24d9f4c84484c43dc36515ced7aa3dfd2 100644
--- a/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc
+++ b/chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.cc
@@ -11,6 +11,8 @@
#include "chrome/browser/predictors/autocomplete_action_predictor_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
+#include "chrome/browser/search_engines/template_url_service.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
#include "chrome/browser/ui/search/search_tab_helper.h"
@@ -38,6 +40,15 @@ const GURL& OmniboxCurrentPageDelegateImpl::GetURL() const {
bool OmniboxCurrentPageDelegateImpl::IsInstantNTP() const {
return chrome::IsInstantNTP(controller_->GetWebContents());
+}
+
+bool OmniboxCurrentPageDelegateImpl::IsSearchResultsPage() const {
+ content::WebContents* web_contents = controller_->GetWebContents();
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ return TemplateURLServiceFactory::GetForProfile(profile)->
+ IsSearchResultsPageFromDefaultSearchProvider(
+ web_contents->GetLastCommittedURL());
Peter Kasting 2013/07/31 23:56:51 It seems wrong that e.g. OmniboxCurrentPageDelegat
rpetterson 2013/08/05 19:46:12 Agreed. They should use the same URL. Done.
}
bool OmniboxCurrentPageDelegateImpl::IsLoading() const {

Powered by Google App Engine
This is Rietveld 408576698