summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 00:19:18 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 00:19:18 +0000
commit66ee443252fd759c5e20cb93be1e90a732da0ebe (patch)
tree5ee39c6ee0c62c8feba5103836a36d28203b7b54 /chrome/browser/profile.cc
parentcbadedd7a2cdc20a745ff8b51922b2533169f7b0 (diff)
downloadchromium_src-66ee443252fd759c5e20cb93be1e90a732da0ebe.zip
chromium_src-66ee443252fd759c5e20cb93be1e90a732da0ebe.tar.gz
chromium_src-66ee443252fd759c5e20cb93be1e90a732da0ebe.tar.bz2
Show the location bar icon (almost) all the time, and have its contents match what the user is doing.
There are a couple major moving parts here: * Change AutocompletePopupModel::URLsForCurrentText() to InfoForCurrentText() and have it return an AutocompleteMatch, which callers can use to parse out whatever they want. I needed to get at the match type for the current text and found the proliferation of arguments here ridiculous. This had major ripple effects throughout the codebase, including changing the name and location of SearchVersusNavigateClassifier as it no longer had an "is_search" parameter directly, so the name became misleading and too narrow. I also ended up adding a null constructor for AutocompleteMatch because it was too cumbersome otherwise. * Change the name of the "SecurityImageView" (or similar) to reflect its broader purpose, and plumb it to the edit to get an icon instead of to the toolbar model. * Add an AutocompleteMatch::Type to icon mapping function, and use it not only in the new code but also to simplify showing the popup contents. BUG=27570,39725 TEST=An icon should appear next to the address at all times. It should be a globe on non-secure pages, a magnifying glass on the NTP, and a match for whatever the user is typing as he types. Review URL: http://codereview.chromium.org/1457002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index b6a8716..7287f26 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -13,6 +13,7 @@
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "chrome/browser/appcache/chrome_appcache_service.h"
+#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autofill/personal_data_manager.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_list.h"
@@ -42,7 +43,6 @@
#include "chrome/browser/privacy_blacklist/blacklist.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/render_process_host.h"
-#include "chrome/browser/search_versus_navigate_classifier.h"
#include "chrome/browser/search_engines/template_url_fetcher.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/sessions/session_service.h"
@@ -308,8 +308,8 @@ class OffTheRecordProfileImpl : public Profile,
return NULL;
}
- virtual SearchVersusNavigateClassifier* GetSearchVersusNavigateClassifier() {
- return profile_->GetSearchVersusNavigateClassifier();
+ virtual AutocompleteClassifier* GetAutocompleteClassifier() {
+ return profile_->GetAutocompleteClassifier();
}
virtual WebDataService* GetWebDataService(ServiceAccessType sat) {
@@ -1048,13 +1048,10 @@ TemplateURLFetcher* ProfileImpl::GetTemplateURLFetcher() {
return template_url_fetcher_.get();
}
-SearchVersusNavigateClassifier*
-ProfileImpl::GetSearchVersusNavigateClassifier() {
- if (!search_versus_navigate_classifier_.get()) {
- search_versus_navigate_classifier_.reset(
- new SearchVersusNavigateClassifier(this));
- }
- return search_versus_navigate_classifier_.get();
+AutocompleteClassifier* ProfileImpl::GetAutocompleteClassifier() {
+ if (!autocomplete_classifier_.get())
+ autocomplete_classifier_.reset(new AutocompleteClassifier(this));
+ return autocomplete_classifier_.get();
}
WebDataService* ProfileImpl::GetWebDataService(ServiceAccessType sat) {