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

Side by Side Diff: chrome/browser/autocomplete_history_manager.cc

Issue 10185008: Taking over issue 10006037: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/autocomplete_history_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/autocomplete_history_manager.h" 5 #include "chrome/browser/autocomplete_history_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/autofill/autofill_external_delegate.h" 12 #include "chrome/browser/autofill/autofill_external_delegate.h"
13 #include "chrome/browser/autofill/credit_card.h" 13 #include "chrome/browser/autofill/credit_card.h"
14 #include "chrome/browser/prefs/pref_service.h" 14 #include "chrome/browser/prefs/pref_service.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/webdata/web_data_service_factory.h"
16 #include "chrome/common/autofill_messages.h" 17 #include "chrome/common/autofill_messages.h"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "content/public/browser/render_view_host.h" 19 #include "content/public/browser/render_view_host.h"
19 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
20 #include "webkit/forms/form_data.h" 21 #include "webkit/forms/form_data.h"
21 22
22 using base::StringPiece16; 23 using base::StringPiece16;
23 using content::WebContents; 24 using content::WebContents;
24 using webkit::forms::FormData; 25 using webkit::forms::FormData;
25 using webkit::forms::FormField; 26 using webkit::forms::FormField;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } // namespace 109 } // namespace
109 110
110 AutocompleteHistoryManager::AutocompleteHistoryManager( 111 AutocompleteHistoryManager::AutocompleteHistoryManager(
111 WebContents* web_contents) 112 WebContents* web_contents)
112 : content::WebContentsObserver(web_contents), 113 : content::WebContentsObserver(web_contents),
113 pending_query_handle_(0), 114 pending_query_handle_(0),
114 query_id_(0), 115 query_id_(0),
115 external_delegate_(NULL) { 116 external_delegate_(NULL) {
116 profile_ = Profile::FromBrowserContext(web_contents->GetBrowserContext()); 117 profile_ = Profile::FromBrowserContext(web_contents->GetBrowserContext());
117 // May be NULL in unit tests. 118 // May be NULL in unit tests.
118 web_data_service_ = profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); 119 web_data_service_ = WebDataServiceFactory::GetForProfile(
120 profile_, Profile::EXPLICIT_ACCESS);
119 autofill_enabled_.Init(prefs::kAutofillEnabled, profile_->GetPrefs(), NULL); 121 autofill_enabled_.Init(prefs::kAutofillEnabled, profile_->GetPrefs(), NULL);
120 } 122 }
121 123
122 AutocompleteHistoryManager::~AutocompleteHistoryManager() { 124 AutocompleteHistoryManager::~AutocompleteHistoryManager() {
123 CancelPendingQuery(); 125 CancelPendingQuery();
124 } 126 }
125 127
126 bool AutocompleteHistoryManager::OnMessageReceived( 128 bool AutocompleteHistoryManager::OnMessageReceived(
127 const IPC::Message& message) { 129 const IPC::Message& message) {
128 bool handled = true; 130 bool handled = true;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 autofill_icons_, 295 autofill_icons_,
294 autofill_unique_ids_)); 296 autofill_unique_ids_));
295 } 297 }
296 298
297 query_id_ = 0; 299 query_id_ = 0;
298 autofill_values_.clear(); 300 autofill_values_.clear();
299 autofill_labels_.clear(); 301 autofill_labels_.clear();
300 autofill_icons_.clear(); 302 autofill_icons_.clear();
301 autofill_unique_ids_.clear(); 303 autofill_unique_ids_.clear();
302 } 304 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete_history_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698