| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/browser/search/search_util.h" | 5 #include "ios/chrome/browser/search/search_util.h" |
| 6 | 6 |
| 7 #include "components/search/search.h" | 7 #include "components/search/search.h" |
| 8 #include "components/search_engines/template_url_service.h" | 8 #include "components/search_engines/template_url_service.h" |
| 9 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 9 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" | 10 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" |
| 10 #include "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h" | 11 #include "ios/chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 11 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | |
| 12 #include "ios/web/public/navigation_item.h" | 12 #include "ios/web/public/navigation_item.h" |
| 13 #include "ios/web/public/navigation_manager.h" | 13 #include "ios/web/public/navigation_manager.h" |
| 14 #include "ios/web/public/web_state/web_state.h" | 14 #include "ios/web/public/web_state/web_state.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 TemplateURL* GetDefaultSearchProviderTemplateURL( | 19 TemplateURL* GetDefaultSearchProviderTemplateURL( |
| 20 ios::ChromeBrowserState* browser_state) { | 20 ios::ChromeBrowserState* browser_state) { |
| 21 if (!browser_state) | 21 if (!browser_state) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 if (!search::IsQueryExtractionEnabled()) | 60 if (!search::IsQueryExtractionEnabled()) |
| 61 return base::string16(); | 61 return base::string16(); |
| 62 | 62 |
| 63 ios::ChromeBrowserState* browser_state = | 63 ios::ChromeBrowserState* browser_state = |
| 64 ios::ChromeBrowserState::FromBrowserState(web_state->GetBrowserState()); | 64 ios::ChromeBrowserState::FromBrowserState(web_state->GetBrowserState()); |
| 65 if (!IsQueryExtractionAllowedForURL(browser_state, item->GetVirtualURL())) | 65 if (!IsQueryExtractionAllowedForURL(browser_state, item->GetVirtualURL())) |
| 66 return base::string16(); | 66 return base::string16(); |
| 67 | 67 |
| 68 return ExtractSearchTermsFromURL(browser_state, item->GetVirtualURL()); | 68 return ExtractSearchTermsFromURL(browser_state, item->GetVirtualURL()); |
| 69 } | 69 } |
| OLD | NEW |