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/password_manager/password_store.h" | 5 #include "chrome/browser/password_manager/password_store.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 observers_.AddObserver(observer); | 146 observers_.AddObserver(observer); |
147 } | 147 } |
148 | 148 |
149 void PasswordStore::RemoveObserver(Observer* observer) { | 149 void PasswordStore::RemoveObserver(Observer* observer) { |
150 observers_.RemoveObserver(observer); | 150 observers_.RemoveObserver(observer); |
151 } | 151 } |
152 | 152 |
153 PasswordStore::~PasswordStore() {} | 153 PasswordStore::~PasswordStore() {} |
154 | 154 |
155 bool PasswordStore::ScheduleTask(const base::Closure& task) { | 155 bool PasswordStore::ScheduleTask(const base::Closure& task) { |
156 scoped_refptr<base::SequencedTaskRunner> task_runner( | 156 scoped_refptr<base::SingleThreadTaskRunner> task_runner( |
157 GetBackgroundTaskRunner()); | 157 GetBackgroundTaskRunner()); |
158 if (task_runner.get()) | 158 if (task_runner.get()) |
159 return task_runner->PostTask(FROM_HERE, task); | 159 return task_runner->PostTask(FROM_HERE, task); |
160 return false; | 160 return false; |
161 } | 161 } |
162 | 162 |
163 scoped_refptr<base::SequencedTaskRunner> | 163 scoped_refptr<base::SingleThreadTaskRunner> |
164 PasswordStore::GetBackgroundTaskRunner() { | 164 PasswordStore::GetBackgroundTaskRunner() { |
165 return db_thread_runner_; | 165 return db_thread_runner_; |
166 } | 166 } |
167 | 167 |
168 void PasswordStore::ForwardLoginsResult(GetLoginsRequest* request) { | 168 void PasswordStore::ForwardLoginsResult(GetLoginsRequest* request) { |
169 request->ApplyIgnoreLoginsCutoff(); | 169 request->ApplyIgnoreLoginsCutoff(); |
170 request->ForwardResult(); | 170 request->ForwardResult(); |
171 } | 171 } |
172 | 172 |
173 void PasswordStore::CopyAndForwardLoginsResult( | 173 void PasswordStore::CopyAndForwardLoginsResult( |
(...skipping 29 matching lines...) Expand all Loading... |
203 void PasswordStore::PostNotifyLoginsChanged() { | 203 void PasswordStore::PostNotifyLoginsChanged() { |
204 main_thread_runner_->PostTask( | 204 main_thread_runner_->PostTask( |
205 FROM_HERE, | 205 FROM_HERE, |
206 base::Bind(&PasswordStore::NotifyLoginsChanged, this)); | 206 base::Bind(&PasswordStore::NotifyLoginsChanged, this)); |
207 } | 207 } |
208 | 208 |
209 void PasswordStore::NotifyLoginsChanged() { | 209 void PasswordStore::NotifyLoginsChanged() { |
210 DCHECK(main_thread_runner_->BelongsToCurrentThread()); | 210 DCHECK(main_thread_runner_->BelongsToCurrentThread()); |
211 FOR_EACH_OBSERVER(Observer, observers_, OnLoginsChanged()); | 211 FOR_EACH_OBSERVER(Observer, observers_, OnLoginsChanged()); |
212 } | 212 } |
OLD | NEW |