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

Side by Side Diff: chrome/browser/chromeos/platform_keys/platform_keys.h

Issue 430563002: Enable system token in platformKeys api. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_
6 #define CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ 6 #define CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 15
16 namespace content { 16 namespace content {
17 class BrowserContext; 17 class BrowserContext;
18 } 18 }
19 19
20 namespace net { 20 namespace net {
21 class X509Certificate; 21 class X509Certificate;
22 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; 22 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList;
23 } 23 }
24 24
25 namespace chromeos { 25 namespace chromeos {
26 26
27 namespace platform_keys { 27 namespace platform_keys {
28 28
29 const char kTokenIdUser[] = "user";
Joao da Silva 2014/07/30 08:46:38 Change to "extern const char kTokenIdUser[];" and
Joao da Silva 2014/07/30 08:46:38 Also, what are these constants for? Document them
pneubeck (no reviews) 2014/07/30 13:53:44 Done.
pneubeck (no reviews) 2014/07/30 13:53:44 Done.
30 const char kTokenIdSystem[] = "system";
31
29 // Supported hash algorithms. 32 // Supported hash algorithms.
30 enum HashAlgorithm { 33 enum HashAlgorithm {
31 HASH_ALGORITHM_SHA1, 34 HASH_ALGORITHM_SHA1,
32 HASH_ALGORITHM_SHA256, 35 HASH_ALGORITHM_SHA256,
33 HASH_ALGORITHM_SHA384, 36 HASH_ALGORITHM_SHA384,
34 HASH_ALGORITHM_SHA512 37 HASH_ALGORITHM_SHA512
35 }; 38 };
36 39
37 namespace subtle { 40 namespace subtle {
38 // Functions of this namespace shouldn't be called directly from the context of 41 // Functions of this namespace shouldn't be called directly from the context of
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 111
109 // Removes |certificate| from the given token if present. Any intermediate of 112 // Removes |certificate| from the given token if present. Any intermediate of
110 // |certificate| will be ignored. |token_id| is currently ignored, instead the 113 // |certificate| will be ignored. |token_id| is currently ignored, instead the
111 // user token associated with |browser_context| is always used. |callback| will 114 // user token associated with |browser_context| is always used. |callback| will
112 // be invoked when the removal is finished, possibly with an error message. 115 // be invoked when the removal is finished, possibly with an error message.
113 void RemoveCertificate(const std::string& token_id, 116 void RemoveCertificate(const std::string& token_id,
114 scoped_refptr<net::X509Certificate> certificate, 117 scoped_refptr<net::X509Certificate> certificate,
115 const RemoveCertificateCallback& callback, 118 const RemoveCertificateCallback& callback,
116 content::BrowserContext* browser_context); 119 content::BrowserContext* browser_context);
117 120
121 // If the list of available tokens could be successfully retrieved, |token_ids|
122 // will contain the token ids. If an error, |token_ids| will be NULL and
Joao da Silva 2014/07/30 08:46:38 "If an error" occurs
pneubeck (no reviews) 2014/07/30 13:53:45 Done.
123 // |error_message| will be set to an/ error message.
Joao da Silva 2014/07/30 08:46:38 remove /
pneubeck (no reviews) 2014/07/30 13:53:44 Done.
124 typedef base::Callback<void(scoped_ptr<std::vector<std::string> > token_ids,
125 const std::string& error_message)>
126 GetTokensCallback;
127
128 // Gets the list of available tokens.
129 void GetTokens(const GetTokensCallback& callback,
Joao da Silva 2014/07/30 08:46:38 Document that this must be called on UI, and |call
pneubeck (no reviews) 2014/07/30 13:53:44 Done.
130 content::BrowserContext* browser_context);
131
118 } // namespace platform_keys 132 } // namespace platform_keys
119 133
120 } // namespace chromeos 134 } // namespace chromeos
121 135
122 #endif // CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_ 136 #endif // CHROME_BROWSER_CHROMEOS_PLATFORM_KEYS_PLATFORM_KEYS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698