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_win.h" | 5 #include "chrome/browser/password_manager/password_store_win.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // We hold a copy of the |form| used in GetLoginsImpl as a pointer. If the | 32 // We hold a copy of the |form| used in GetLoginsImpl as a pointer. If the |
33 // form is not set (is NULL), then we are not a GetLogins request. | 33 // form is not set (is NULL), then we are not a GetLogins request. |
34 void SetLoginsRequestForm(const PasswordForm& form) { | 34 void SetLoginsRequestForm(const PasswordForm& form) { |
35 form_.reset(new PasswordForm(form)); | 35 form_.reset(new PasswordForm(form)); |
36 } | 36 } |
37 PasswordForm* form() const { | 37 PasswordForm* form() const { |
38 return form_.get(); | 38 return form_.get(); |
39 } | 39 } |
40 bool IsLoginsRequest() const { return !!form_.get(); } | 40 bool IsLoginsRequest() const { return !!form_.get(); } |
41 | 41 |
| 42 protected: |
| 43 virtual ~FormGetLoginsRequest() {} |
| 44 |
42 private: | 45 private: |
43 scoped_ptr<PasswordForm> form_; | 46 scoped_ptr<PasswordForm> form_; |
44 }; | 47 }; |
45 | 48 |
46 } // namespace | 49 } // namespace |
47 | 50 |
48 // Handles requests to WebDataService. | 51 // Handles requests to WebDataService. |
49 class PasswordStoreWin::DBHandler : public WebDataServiceConsumer { | 52 class PasswordStoreWin::DBHandler : public WebDataServiceConsumer { |
50 public: | 53 public: |
51 DBHandler(WebDataService* web_data_service, | 54 DBHandler(WebDataService* web_data_service, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 PasswordStore::ForwardLoginsResult(request); | 206 PasswordStore::ForwardLoginsResult(request); |
204 } | 207 } |
205 } | 208 } |
206 | 209 |
207 void PasswordStoreWin::GetLoginsImpl(GetLoginsRequest* request, | 210 void PasswordStoreWin::GetLoginsImpl(GetLoginsRequest* request, |
208 const PasswordForm& form) { | 211 const PasswordForm& form) { |
209 static_cast<FormGetLoginsRequest*>(request)->SetLoginsRequestForm(form); | 212 static_cast<FormGetLoginsRequest*>(request)->SetLoginsRequestForm(form); |
210 | 213 |
211 PasswordStoreDefault::GetLoginsImpl(request, form); | 214 PasswordStoreDefault::GetLoginsImpl(request, form); |
212 } | 215 } |
OLD | NEW |