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

Unified Diff: chrome/browser/autocomplete_history_manager.cc

Issue 4591001: Display a warning when autofill is disabled for a website. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile on ChromeOS... Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/autocomplete_history_manager.h ('k') | chrome/browser/autofill/autofill_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete_history_manager.cc
diff --git a/chrome/browser/autocomplete_history_manager.cc b/chrome/browser/autocomplete_history_manager.cc
index 2243bcbcc3fc1f4fade463a34cffd023cee439dc..763445b26b01597ea85028ad9de6e13797419ebe 100644
--- a/chrome/browser/autocomplete_history_manager.cc
+++ b/chrome/browser/autocomplete_history_manager.cc
@@ -73,8 +73,7 @@ bool IsSSN(const string16& text) {
AutocompleteHistoryManager::AutocompleteHistoryManager(
TabContents* tab_contents) : tab_contents_(tab_contents),
- pending_query_handle_(0),
- query_id_(0) {
+ pending_query_handle_(0) {
DCHECK(tab_contents);
profile_ = tab_contents_->profile();
@@ -94,17 +93,17 @@ void AutocompleteHistoryManager::FormSubmitted(const FormData& form) {
StoreFormEntriesInWebDatabase(form);
}
-bool AutocompleteHistoryManager::GetAutocompleteSuggestions(
- int query_id, const string16& name, const string16& prefix) {
- if (!*autofill_enabled_)
- return false;
+void AutocompleteHistoryManager::GetAutocompleteSuggestions(
+ const string16& name, const string16& prefix) {
+ if (!*autofill_enabled_) {
+ SendSuggestions(NULL);
+ return;
+ }
CancelPendingQuery();
- query_id_ = query_id;
pending_query_handle_ = web_data_service_->GetFormValuesForElementName(
name, prefix, kMaxAutocompleteMenuItems, this);
- return true;
}
void AutocompleteHistoryManager::RemoveAutocompleteEntry(
@@ -130,8 +129,7 @@ AutocompleteHistoryManager::AutocompleteHistoryManager(
Profile* profile, WebDataService* wds) : tab_contents_(NULL),
profile_(profile),
web_data_service_(wds),
- pending_query_handle_(0),
- query_id_(0) {
+ pending_query_handle_(0) {
autofill_enabled_.Init(
prefs::kAutoFillEnabled, profile_->GetPrefs(), NULL);
}
@@ -187,10 +185,8 @@ void AutocompleteHistoryManager::SendSuggestions(const WDTypedResult* result) {
DCHECK(result->GetType() == AUTOFILL_VALUE_RESULT);
const WDResult<std::vector<string16> >* autofill_result =
static_cast<const WDResult<std::vector<string16> >*>(result);
- host->AutocompleteSuggestionsReturned(
- query_id_, autofill_result->GetValue());
+ host->AutocompleteSuggestionsReturned(autofill_result->GetValue());
} else {
- host->AutocompleteSuggestionsReturned(
- query_id_, std::vector<string16>());
+ host->AutocompleteSuggestionsReturned(std::vector<string16>());
}
}
« no previous file with comments | « chrome/browser/autocomplete_history_manager.h ('k') | chrome/browser/autofill/autofill_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698