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

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: remove unnecessary include Created 7 years, 4 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..2e0aa5642f0423c859e14be87ef328971999d4c2 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,14 @@ 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(GetURL());
Mark P 2013/08/06 19:38:36 optional nit: consider web_contents->GetURL() (oth
Peter Kasting 2013/08/06 21:32:19 I'd probably resolve this by just inlining the fir
rpetterson 2013/08/06 23:04:17 I was trying to make it more readable. I've cleane
}
bool OmniboxCurrentPageDelegateImpl::IsLoading() const {

Powered by Google App Engine
This is Rietveld 408576698