Home | History | Annotate | Download | only in ui
      1 // Copyright 2013 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.
      4 
      5 #ifndef CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_NSS_H_
      6 #define CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_NSS_H_
      7 
      8 #include <string>
      9 #include <vector>
     10 
     11 #include "base/callback_forward.h"
     12 #include "base/memory/ref_counted.h"
     13 #include "chrome/browser/ui/crypto_module_password_dialog.h"
     14 #include "net/base/host_port_pair.h"
     15 #include "ui/gfx/native_widget_types.h"
     16 
     17 namespace net {
     18 class CryptoModule;
     19 typedef std::vector<scoped_refptr<CryptoModule> > CryptoModuleList;
     20 class X509Certificate;
     21 }
     22 
     23 namespace chrome {
     24 
     25 // Asynchronously unlock |modules|, if necessary. |callback| is called when
     26 // done (regardless if any modules were successfully unlocked or not).  Should
     27 // only be called on UI thread.
     28 void UnlockSlotsIfNecessary(const net::CryptoModuleList& modules,
     29                             CryptoModulePasswordReason reason,
     30                             const net::HostPortPair& server,
     31                             gfx::NativeWindow parent,
     32                             const base::Closure& callback);
     33 
     34 // Asynchronously unlock the |cert|'s module, if necessary. |callback| is
     35 // called when done (regardless if module was successfully unlocked or not).
     36 // Should only be called on UI thread.
     37 void UnlockCertSlotIfNecessary(net::X509Certificate* cert,
     38                                CryptoModulePasswordReason reason,
     39                                const net::HostPortPair& server,
     40                                gfx::NativeWindow parent,
     41                                const base::Closure& callback);
     42 
     43 }  // namespace chrome
     44 
     45 #endif  // CHROME_BROWSER_UI_CRYPTO_MODULE_PASSWORD_DIALOG_NSS_H_
     46