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

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

Issue 8603015: Get rid of a bunch of view_messages.h includes from chrome by making the TabContentsObserver inte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux and try to fix mac again Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/password_manager/password_manager.h" 5 #include "chrome/browser/password_manager/password_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/password_manager/password_form_manager.h" 12 #include "chrome/browser/password_manager/password_form_manager.h"
13 #include "chrome/browser/password_manager/password_manager_delegate.h" 13 #include "chrome/browser/password_manager/password_manager_delegate.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/common/autofill_messages.h" 16 #include "chrome/common/autofill_messages.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "content/browser/user_metrics.h" 18 #include "content/browser/user_metrics.h"
19 #include "content/common/view_messages.h" 19 #include "content/public/common/frame_navigate_params.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 21
22 using webkit_glue::PasswordForm; 22 using webkit_glue::PasswordForm;
23 using webkit_glue::PasswordFormMap; 23 using webkit_glue::PasswordFormMap;
24 24
25 // static 25 // static
26 void PasswordManager::RegisterUserPrefs(PrefService* prefs) { 26 void PasswordManager::RegisterUserPrefs(PrefService* prefs) {
27 prefs->RegisterBooleanPref(prefs::kPasswordManagerEnabled, 27 prefs->RegisterBooleanPref(prefs::kPasswordManagerEnabled,
28 true, 28 true,
29 PrefService::SYNCABLE_PREF); 29 PrefService::SYNCABLE_PREF);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } else { 152 } else {
153 // If the save is not a new username entry, then we just want to save this 153 // If the save is not a new username entry, then we just want to save this
154 // data (since the user already has related data saved), so don't prompt. 154 // data (since the user already has related data saved), so don't prompt.
155 provisional_save_manager_->Save(); 155 provisional_save_manager_->Save();
156 provisional_save_manager_.reset(); 156 provisional_save_manager_.reset();
157 } 157 }
158 } 158 }
159 159
160 void PasswordManager::DidNavigateAnyFrame( 160 void PasswordManager::DidNavigateAnyFrame(
161 const content::LoadCommittedDetails& details, 161 const content::LoadCommittedDetails& details,
162 const ViewHostMsg_FrameNavigate_Params& params) { 162 const content::FrameNavigateParams& params) {
163 if (params.password_form.origin.is_valid()) 163 if (params.password_form.origin.is_valid())
164 ProvisionallySavePassword(params.password_form); 164 ProvisionallySavePassword(params.password_form);
165 } 165 }
166 166
167 bool PasswordManager::OnMessageReceived(const IPC::Message& message) { 167 bool PasswordManager::OnMessageReceived(const IPC::Message& message) {
168 bool handled = true; 168 bool handled = true;
169 IPC_BEGIN_MESSAGE_MAP(PasswordManager, message) 169 IPC_BEGIN_MESSAGE_MAP(PasswordManager, message)
170 IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordFormsFound, 170 IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordFormsFound,
171 OnPasswordFormsFound) 171 OnPasswordFormsFound)
172 IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordFormsVisible, 172 IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordFormsVisible,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 delegate_->FillPasswordForm(fill_data); 234 delegate_->FillPasswordForm(fill_data);
235 return; 235 return;
236 } 236 }
237 default: 237 default:
238 if (observer_) { 238 if (observer_) {
239 observer_->OnAutofillDataAvailable(preferred_match->username_value, 239 observer_->OnAutofillDataAvailable(preferred_match->username_value,
240 preferred_match->password_value); 240 preferred_match->password_value);
241 } 241 }
242 } 242 }
243 } 243 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_manager.h ('k') | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698