• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2012 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_MAC_SECURITY_WRAPPERS_H_
6 #define CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_
7 
8 #include <CoreFoundation/CFBase.h>
9 
10 #include "base/macros.h"
11 
12 namespace chrome {
13 
14 // Wraps SecKeychainSetUserInteractionAllowed, restoring the previous setting
15 // on destruction.
16 class ScopedSecKeychainSetUserInteractionAllowed {
17  public:
18   explicit ScopedSecKeychainSetUserInteractionAllowed(Boolean allowed);
19   ~ScopedSecKeychainSetUserInteractionAllowed();
20 
21  private:
22   Boolean old_allowed_;
23 
24   DISALLOW_COPY_AND_ASSIGN(ScopedSecKeychainSetUserInteractionAllowed);
25 };
26 
27 }  // namespace chrome
28 
29 #endif  // CHROME_BROWSER_MAC_SECURITY_WRAPPERS_H_
30