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

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

Issue 355143006: [Password Manager] Add UMA stats to track interaction with synced accounts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 6 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_store_mac.h" 5 #include "chrome/browser/password_manager/password_store_mac.h"
6 #include "chrome/browser/password_manager/password_store_mac_internal.h" 6 #include "chrome/browser/password_manager/password_store_mac_internal.h"
7 7
8 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 861
862 // Mac stores passwords in the system keychain, which can block for an 862 // Mac stores passwords in the system keychain, which can block for an
863 // arbitrarily long time (most notably, it can block on user confirmation 863 // arbitrarily long time (most notably, it can block on user confirmation
864 // from a dialog). Run tasks on a dedicated thread to avoid blocking the DB 864 // from a dialog). Run tasks on a dedicated thread to avoid blocking the DB
865 // thread. 865 // thread.
866 scoped_refptr<base::SingleThreadTaskRunner> 866 scoped_refptr<base::SingleThreadTaskRunner>
867 PasswordStoreMac::GetBackgroundTaskRunner() { 867 PasswordStoreMac::GetBackgroundTaskRunner() {
868 return (thread_.get()) ? thread_->message_loop_proxy() : NULL; 868 return (thread_.get()) ? thread_->message_loop_proxy() : NULL;
869 } 869 }
870 870
871 void PasswordStoreMac::ReportMetricsImpl() { 871 void PasswordStoreMac::ReportMetricsImpl(const std::string& sync_username) {
872 login_metadata_db_->ReportMetrics(); 872 login_metadata_db_->ReportMetrics(sync_username);
873 } 873 }
874 874
875 PasswordStoreChangeList PasswordStoreMac::AddLoginImpl( 875 PasswordStoreChangeList PasswordStoreMac::AddLoginImpl(
876 const PasswordForm& form) { 876 const PasswordForm& form) {
877 DCHECK(thread_->message_loop() == base::MessageLoop::current()); 877 DCHECK(thread_->message_loop() == base::MessageLoop::current());
878 PasswordStoreChangeList changes; 878 PasswordStoreChangeList changes;
879 if (AddToKeychainIfNecessary(form)) { 879 if (AddToKeychainIfNecessary(form)) {
880 changes = login_metadata_db_->AddLogin(form); 880 changes = login_metadata_db_->AddLogin(form);
881 } 881 }
882 return changes; 882 return changes;
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 1154
1155 void PasswordStoreMac::RemoveKeychainForms( 1155 void PasswordStoreMac::RemoveKeychainForms(
1156 const std::vector<PasswordForm*>& forms) { 1156 const std::vector<PasswordForm*>& forms) {
1157 MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get()); 1157 MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get());
1158 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); 1158 owned_keychain_adapter.SetFindsOnlyOwnedItems(true);
1159 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); 1159 for (std::vector<PasswordForm*>::const_iterator i = forms.begin();
1160 i != forms.end(); ++i) { 1160 i != forms.end(); ++i) {
1161 owned_keychain_adapter.RemovePassword(**i); 1161 owned_keychain_adapter.RemovePassword(**i);
1162 } 1162 }
1163 } 1163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698