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

Unified Diff: chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc

Issue 2232863002: Remove search::GetSearchTerms since it always returns empty string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_query_extract
Patch Set: Android Created 4 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/toolbar/chrome_toolbar_model_delegate.cc
diff --git a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
index 391fab43ff4d94c4b4a282fecf15296e96631348..dc2889dcea1bd15cd3ecfe3d8f76171085331487 100644
--- a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
+++ b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
@@ -80,41 +80,6 @@ ChromeToolbarModelDelegate::GetSecurityLevel() const {
return client->GetSecurityInfo().security_level;
}
-base::string16 ChromeToolbarModelDelegate::GetSearchTerms(
- security_state::SecurityStateModel::SecurityLevel security_level) const {
- content::WebContents* web_contents = GetActiveWebContents();
- base::string16 search_terms(search::GetSearchTerms(web_contents));
- if (search_terms.empty()) {
- // We mainly do this to enforce the subsequent DCHECK.
- return base::string16();
- }
-
- // If the page is still loading and the security style is unknown, consider
- // the page secure. Without this, after the user hit enter on some search
- // terms, the omnibox would change to displaying the loading URL before
- // changing back to the search terms once they could be extracted, thus
- // causing annoying flicker.
- DCHECK(web_contents);
- content::NavigationController& nav_controller = web_contents->GetController();
- content::NavigationEntry* entry = nav_controller.GetVisibleEntry();
- if ((entry != nav_controller.GetLastCommittedEntry()) &&
- (entry->GetSSL().security_style == content::SECURITY_STYLE_UNKNOWN))
- return search_terms;
-
- // If the URL is using a Google base URL specified via the command line, we
- // bypass the security check below.
- if (entry &&
- google_util::StartsWithCommandLineGoogleBaseURL(entry->GetVirtualURL()))
- return search_terms;
-
- // Otherwise, extract search terms for HTTPS pages that do not have a security
- // error.
- bool extract_search_terms =
- (security_level != security_state::SecurityStateModel::NONE) &&
- (security_level != security_state::SecurityStateModel::SECURITY_ERROR);
- return extract_search_terms ? search_terms : base::string16();
-}
-
scoped_refptr<net::X509Certificate> ChromeToolbarModelDelegate::GetCertificate()
const {
scoped_refptr<net::X509Certificate> cert;
« no previous file with comments | « chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.h ('k') | chrome/browser/ui/toolbar/toolbar_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698