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

Unified Diff: chrome/browser/password_manager/password_store_default.h

Issue 113189: Add password store interface.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/password_store_default.h
===================================================================
--- chrome/browser/password_manager/password_store_default.h (revision 0)
+++ chrome/browser/password_manager/password_store_default.h (revision 0)
@@ -0,0 +1,49 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT
+#define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT
+
+#include <map>
+
+#include "base/file_path.h"
+#include "base/ref_counted.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/password_manager/password_store.h"
+#include "chrome/browser/webdata/web_data_service.h"
+
+class Task;
+
+// Simple password store implementation that delegates everything to
+// the WebDatabase.
+class PasswordStoreDefault : public PasswordStore,
+ public WebDataServiceConsumer {
+ public:
+ explicit PasswordStoreDefault(WebDataService* web_data_service);
+ virtual ~PasswordStoreDefault();
+
+ protected:
+ // Implements PasswordStore interface.
+ void AddLoginImpl(const PasswordForm& form);
+ void UpdateLoginImpl(const PasswordForm& form);
+ void RemoveLoginImpl(const PasswordForm& form);
+ void GetLoginsImpl(GetLoginsRequest* request);
+
+ // Called when a WebDataService method finishes.
+ virtual void OnWebDataServiceRequestDone(WebDataService::Handle h,
+ const WDTypedResult* result);
+
+ scoped_refptr<WebDataService> web_data_service_;
+
+ // Methods in this class call async WebDataService methods. This mapping
+ // remembers which WebDataService request corresponds to which PasswordStore
+ // request.
+ typedef std::map<WebDataService::Handle, GetLoginsRequest*> PendingRequestMap;
+ PendingRequestMap pending_requests_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PasswordStoreDefault);
+};
+
+#endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_DEFAULT
« no previous file with comments | « chrome/browser/password_manager/password_store.cc ('k') | chrome/browser/password_manager/password_store_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698