OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
Jói
2013/05/23 17:58:08
2013, no (c)
Cait (Slow)
2013/05/24 16:17:08
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Chromium settings and storage represent user-selected preferences and | |
6 // information and MUST not be extracted, overwritten or modified except | |
7 // through Chromium defined APIs. | |
8 | |
9 #ifndef CHROME_BROWSER_WEBDATA_TOKEN_WEB_DATA_H__ | |
10 #define CHROME_BROWSER_WEBDATA_TOKEN_WEB_DATA_H__ | |
11 | |
12 #include <map> | |
13 #include <string> | |
14 #include <vector> | |
15 | |
16 #include "base/callback_forward.h" | |
17 #include "base/files/file_path.h" | |
18 #include "base/location.h" | |
19 #include "base/memory/ref_counted.h" | |
20 #include "components/webdata/common/web_data_results.h" | |
21 #include "components/webdata/common/web_data_service_base.h" | |
22 #include "components/webdata/common/web_data_service_consumer.h" | |
23 #include "components/webdata/common/web_database.h" | |
24 | |
25 class TokenWebDataBackend; | |
26 class WebDatabaseService; | |
27 class WebDataServiceConsumer; | |
28 | |
29 namespace content { | |
30 class BrowserContext; | |
31 } | |
32 | |
33 class TokenWebData : public WebDataServiceBase { | |
Jói
2013/05/23 17:58:08
Maybe one line of documentation? e.g. "Storage for
Cait (Slow)
2013/05/24 16:17:08
Done.
| |
34 public: | |
35 // Retrieve a WebDataService for the given context. | |
36 static scoped_refptr<TokenWebData> FromBrowserContext( | |
37 content::BrowserContext* context); | |
38 | |
39 TokenWebData(scoped_refptr<WebDatabaseService> wdbs, | |
40 const ProfileErrorCallback& callback); | |
41 | |
42 // Set a token to use for a specified service. | |
43 void SetTokenForService(const std::string& service, | |
44 const std::string& token); | |
45 | |
46 // Remove all tokens stored in the web database. | |
47 void RemoveAllTokens(); | |
48 | |
49 // Null on failure. Success is WDResult<std::vector<std::string> > | |
50 virtual Handle GetAllTokens(WebDataServiceConsumer* consumer); | |
51 | |
52 protected: | |
53 // For unit tests, passes a null callback. | |
54 TokenWebData(); | |
55 | |
56 virtual ~TokenWebData(); | |
57 | |
58 private: | |
59 scoped_refptr<TokenWebDataBackend> token_backend_; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(TokenWebData); | |
62 }; | |
63 | |
64 #endif // CHROME_BROWSER_WEBDATA_TOKEN_WEB_DATA_H__ | |
OLD | NEW |