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..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 { |