Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / platform_keys_certificate_selector_chromeos.h
blobcfee8bc70b38cafb0708e213697d39cf9a0e76c8
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_PLATFORM_KEYS_CERTIFICATE_SELECTOR_CHROMEOS_H_
6 #define CHROME_BROWSER_UI_PLATFORM_KEYS_CERTIFICATE_SELECTOR_CHROMEOS_H_
8 #include <string>
9 #include <vector>
11 #include "base/callback_forward.h"
12 #include "base/memory/ref_counted.h"
14 namespace content {
15 class WebContents;
18 namespace net {
19 class X509Certificate;
20 typedef std::vector<scoped_refptr<X509Certificate>> CertificateList;
23 namespace chromeos {
25 typedef base::Callback<void(
26 const scoped_refptr<net::X509Certificate>& selected_certificate)>
27 CertificateSelectedCallback;
29 // Opens a constrained client certificate selection dialog associated with
30 // |web_contents|, offering |certificates| to the user and explaining that the
31 // selection will grant access to the extension with |extension_id|.
32 // When the user has made a selection, the dialog will report back to
33 // |callback|. |callback| is notified when the dialog closes in call cases; if
34 // the user cancels the dialog, |callback| will be called with a nullptr
35 // argument.
36 void ShowPlatformKeysCertificateSelector(
37 content::WebContents* web_contents,
38 const std::string& extension_id,
39 const net::CertificateList& certificates,
40 const CertificateSelectedCallback& callback);
42 } // namespace chromeos
44 #endif // CHROME_BROWSER_UI_PLATFORM_KEYS_CERTIFICATE_SELECTOR_CHROMEOS_H_