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

Unified Diff: chrome/browser/webdata/token_web_data.h

Issue 129253003: Revert of Create signin component and componentize TokenWebData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « chrome/browser/webdata/token_service_table_unittest.cc ('k') | chrome/browser/webdata/token_web_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/token_web_data.h
diff --git a/chrome/browser/webdata/token_web_data.h b/chrome/browser/webdata/token_web_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..03147824b587470e2464b7485520f587fded91fc
--- /dev/null
+++ b/chrome/browser/webdata/token_web_data.h
@@ -0,0 +1,69 @@
+// Copyright 2013 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.
+
+// Chromium settings and storage represent user-selected preferences and
+// information and MUST not be extracted, overwritten or modified except
+// through Chromium defined APIs.
+
+#ifndef CHROME_BROWSER_WEBDATA_TOKEN_WEB_DATA_H__
+#define CHROME_BROWSER_WEBDATA_TOKEN_WEB_DATA_H__
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "base/callback_forward.h"
+#include "base/files/file_path.h"
+#include "base/location.h"
+#include "base/memory/ref_counted.h"
+#include "components/webdata/common/web_data_results.h"
+#include "components/webdata/common/web_data_service_base.h"
+#include "components/webdata/common/web_data_service_consumer.h"
+#include "components/webdata/common/web_database.h"
+
+class TokenWebDataBackend;
+class WebDatabaseService;
+class WebDataServiceConsumer;
+
+namespace content {
+class BrowserContext;
+}
+
+// TokenWebData is a data repository for storage of authentication tokens.
+
+class TokenWebData : public WebDataServiceBase {
+ public:
+ // Retrieve a WebDataService for the given context.
+ static scoped_refptr<TokenWebData> FromBrowserContext(
+ content::BrowserContext* context);
+
+ TokenWebData(scoped_refptr<WebDatabaseService> wdbs,
+ const ProfileErrorCallback& callback);
+
+ // Set a token to use for a specified service.
+ void SetTokenForService(const std::string& service,
+ const std::string& token);
+
+ // Remove all tokens stored in the web database.
+ void RemoveAllTokens();
+
+ // Removes a token related to |service| from the web database.
+ void RemoveTokenForService(const std::string& service);
+
+ // Null on failure. Success is WDResult<std::vector<std::string> >
+ virtual Handle GetAllTokens(WebDataServiceConsumer* consumer);
+
+ protected:
+ // For unit tests, passes a null callback.
+ TokenWebData();
+
+ virtual ~TokenWebData();
+
+ private:
+ scoped_refptr<TokenWebDataBackend> token_backend_;
+
+ DISALLOW_COPY_AND_ASSIGN(TokenWebData);
+};
+
+#endif // CHROME_BROWSER_WEBDATA_TOKEN_WEB_DATA_H__
« no previous file with comments | « chrome/browser/webdata/token_service_table_unittest.cc ('k') | chrome/browser/webdata/token_web_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698