Home | History | Annotate | Download | only in password_manager
      1 // Copyright (c) 2010 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_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__
      6 #define CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__
      7 #pragma once
      8 
      9 #include <string>
     10 
     11 #include "base/basictypes.h"
     12 
     13 class MacKeychain;
     14 
     15 class EncryptorPassword {
     16  public:
     17   explicit EncryptorPassword(const MacKeychain& keychain)
     18       : keychain_(keychain) {
     19   }
     20 
     21   // Get the Encryptor password for this system.  If no password exists
     22   // in the Keychain then one is generated, stored in the Mac keychain, and
     23   // returned.
     24   // If one exists then it is fetched from the Keychain and returned.
     25   // If the user disallows access to the Keychain (or an error occurs) then an
     26   // empty string is returned.
     27   std::string GetEncryptorPassword() const;
     28 
     29  private:
     30   DISALLOW_COPY_AND_ASSIGN(EncryptorPassword);
     31   const MacKeychain& keychain_;
     32 };
     33 
     34 #endif  // CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__
     35