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

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

Issue 19775014: [Passwords, Mac] Don't always prompt to access passwords saved by other browsers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
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/password_manager/password_form_manager.h" 5 #include "chrome/browser/password_manager/password_form_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void PasswordFormManager::Save() { 236 void PasswordFormManager::Save() {
237 DCHECK_EQ(state_, POST_MATCHING_PHASE); 237 DCHECK_EQ(state_, POST_MATCHING_PHASE);
238 DCHECK(!profile_->IsOffTheRecord()); 238 DCHECK(!profile_->IsOffTheRecord());
239 239
240 if (IsNewLogin()) 240 if (IsNewLogin())
241 SaveAsNewLogin(true); 241 SaveAsNewLogin(true);
242 else 242 else
243 UpdateLogin(); 243 UpdateLogin();
244 } 244 }
245 245
246 void PasswordFormManager::FetchMatchingLoginsFromPasswordStore() { 246 void PasswordFormManager::FetchMatchingLoginsFromPasswordStore(
247 PasswordStore::AuthorizationPromptPermission permission_to_prompt) {
247 DCHECK_EQ(state_, PRE_MATCHING_PHASE); 248 DCHECK_EQ(state_, PRE_MATCHING_PHASE);
248 state_ = MATCHING_PHASE; 249 state_ = MATCHING_PHASE;
249 PasswordStore* password_store = PasswordStoreFactory::GetForProfile( 250 PasswordStore* password_store = PasswordStoreFactory::GetForProfile(
250 profile_, Profile::EXPLICIT_ACCESS).get(); 251 profile_, Profile::EXPLICIT_ACCESS).get();
251 if (!password_store) { 252 password_store->GetLogins(observed_form_, this, permission_to_prompt);
252 NOTREACHED();
253 return;
254 }
stuartmorgan 2013/08/29 20:39:54 Why change this?
255 password_store->GetLogins(observed_form_, this);
256 } 253 }
257 254
258 bool PasswordFormManager::HasCompletedMatching() { 255 bool PasswordFormManager::HasCompletedMatching() {
259 return state_ == POST_MATCHING_PHASE; 256 return state_ == POST_MATCHING_PHASE;
260 } 257 }
261 258
262 void PasswordFormManager::OnRequestDone( 259 void PasswordFormManager::OnRequestDone(
263 const std::vector<PasswordForm*>& logins_result) { 260 const std::vector<PasswordForm*>& logins_result) {
264 // Note that the result gets deleted after this call completes, but we own 261 // Note that the result gets deleted after this call completes, but we own
265 // the PasswordForm objects pointed to by the result vector, thus we keep 262 // the PasswordForm objects pointed to by the result vector, thus we keep
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 587
591 void PasswordFormManager::SubmitFailed() { 588 void PasswordFormManager::SubmitFailed() {
592 submit_result_ = kSubmitResultFailed; 589 submit_result_ = kSubmitResultFailed;
593 } 590 }
594 591
595 void PasswordFormManager::SendNotBlacklistedToRenderer() { 592 void PasswordFormManager::SendNotBlacklistedToRenderer() {
596 content::RenderViewHost* host = web_contents_->GetRenderViewHost(); 593 content::RenderViewHost* host = web_contents_->GetRenderViewHost();
597 host->Send(new AutofillMsg_FormNotBlacklisted(host->GetRoutingID(), 594 host->Send(new AutofillMsg_FormNotBlacklisted(host->GetRoutingID(),
598 observed_form_)); 595 observed_form_));
599 } 596 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698