| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sync/glue/password_model_associator.h" | 5 #include "chrome/browser/sync/glue/password_model_associator.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/password_manager/password_store.h" | 11 #include "chrome/browser/password_manager/password_store.h" |
| 12 #include "chrome/browser/profile.h" | 12 #include "chrome/browser/profile.h" |
| 13 #include "chrome/browser/sync/engine/syncapi.h" | 13 #include "chrome/browser/sync/engine/syncapi.h" |
| 14 #include "chrome/browser/sync/profile_sync_service.h" | 14 #include "chrome/browser/sync/profile_sync_service.h" |
| 15 #include "chrome/browser/sync/protocol/password_specifics.pb.h" | 15 #include "chrome/browser/sync/protocol/password_specifics.pb.h" |
| 16 #include "net/base/escape.h" | 16 #include "net/base/escape.h" |
| 17 #include "webkit/glue/password_form.h" | 17 #include "webkit/glue/password_form.h" |
| 18 | 18 |
| 19 namespace browser_sync { | 19 namespace browser_sync { |
| 20 | 20 |
| 21 const char kPasswordTag[] = "google_chrome_passwords"; | 21 const char kPasswordTag[] = "google_chrome_passwords"; |
| 22 | 22 |
| 23 PasswordModelAssociator::PasswordModelAssociator( | 23 PasswordModelAssociator::PasswordModelAssociator( |
| 24 ProfileSyncService* sync_service, | 24 ProfileSyncService* sync_service, |
| 25 PasswordStore* password_store, | 25 PasswordStore* password_store) |
| 26 UnrecoverableErrorHandler* error_handler) | |
| 27 : sync_service_(sync_service), | 26 : sync_service_(sync_service), |
| 28 password_store_(password_store), | 27 password_store_(password_store), |
| 29 error_handler_(error_handler), | |
| 30 password_node_id_(sync_api::kInvalidId), | 28 password_node_id_(sync_api::kInvalidId), |
| 31 abort_association_pending_(false), | 29 abort_association_pending_(false), |
| 32 expected_loop_(MessageLoop::current()) { | 30 expected_loop_(MessageLoop::current()) { |
| 33 DCHECK(sync_service_); | 31 DCHECK(sync_service_); |
| 34 DCHECK(password_store_); | 32 DCHECK(password_store_); |
| 35 DCHECK(error_handler_); | |
| 36 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
| 37 DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::UI)); | 34 DCHECK(!ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 38 #else | 35 #else |
| 39 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); | 36 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); |
| 40 #endif | 37 #endif |
| 41 } | 38 } |
| 42 | 39 |
| 43 bool PasswordModelAssociator::AssociateModels() { | 40 bool PasswordModelAssociator::AssociateModels() { |
| 44 DCHECK(expected_loop_ == MessageLoop::current()); | 41 DCHECK(expected_loop_ == MessageLoop::current()); |
| 45 { | 42 { |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 std::string PasswordModelAssociator::MakeTag( | 390 std::string PasswordModelAssociator::MakeTag( |
| 394 const std::string& signon_realm, | 391 const std::string& signon_realm, |
| 395 const std::string& origin, | 392 const std::string& origin, |
| 396 const std::string& action) { | 393 const std::string& action) { |
| 397 return EscapePath(signon_realm) + "|" + | 394 return EscapePath(signon_realm) + "|" + |
| 398 EscapePath(origin) + "|" + | 395 EscapePath(origin) + "|" + |
| 399 EscapePath(action); | 396 EscapePath(action); |
| 400 } | 397 } |
| 401 | 398 |
| 402 } // namespace browser_sync | 399 } // namespace browser_sync |
| OLD | NEW |