Chromium Code Reviews| 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 { |