OLD | NEW |
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/sync/glue/password_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 const { | 35 const { |
36 return syncer::GROUP_PASSWORD; | 36 return syncer::GROUP_PASSWORD; |
37 } | 37 } |
38 | 38 |
39 PasswordDataTypeController::~PasswordDataTypeController() {} | 39 PasswordDataTypeController::~PasswordDataTypeController() {} |
40 | 40 |
41 bool PasswordDataTypeController::PostTaskOnBackendThread( | 41 bool PasswordDataTypeController::PostTaskOnBackendThread( |
42 const tracked_objects::Location& from_here, | 42 const tracked_objects::Location& from_here, |
43 const base::Closure& task) { | 43 const base::Closure& task) { |
44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
45 if (!password_store_) | 45 if (!password_store_.get()) |
46 return false; | 46 return false; |
47 return password_store_->ScheduleTask(task); | 47 return password_store_->ScheduleTask(task); |
48 } | 48 } |
49 | 49 |
50 bool PasswordDataTypeController::StartModels() { | 50 bool PasswordDataTypeController::StartModels() { |
51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
52 DCHECK_EQ(MODEL_STARTING, state()); | 52 DCHECK_EQ(MODEL_STARTING, state()); |
53 password_store_ = PasswordStoreFactory::GetForProfile( | 53 password_store_ = PasswordStoreFactory::GetForProfile( |
54 profile_, Profile::EXPLICIT_ACCESS); | 54 profile_, Profile::EXPLICIT_ACCESS); |
55 return !!password_store_; | 55 return !!password_store_.get(); |
56 } | 56 } |
57 | 57 |
58 } // namespace browser_sync | 58 } // namespace browser_sync |
OLD | NEW |