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.
5 #include "chrome/browser/mac/security_wrappers.h"
7 #include <Security/Security.h>
9 #include "base/mac/mac_logging.h"
13 ScopedSecKeychainSetUserInteractionAllowed::
14 ScopedSecKeychainSetUserInteractionAllowed(Boolean allowed
) {
15 OSStatus status
= SecKeychainGetUserInteractionAllowed(&old_allowed_
);
16 if (status
!= errSecSuccess
) {
17 OSSTATUS_LOG(ERROR
, status
);
21 status
= SecKeychainSetUserInteractionAllowed(allowed
);
22 if (status
!= errSecSuccess
) {
23 OSSTATUS_LOG(ERROR
, status
);
27 ScopedSecKeychainSetUserInteractionAllowed::
28 ~ScopedSecKeychainSetUserInteractionAllowed() {
29 OSStatus status
= SecKeychainSetUserInteractionAllowed(old_allowed_
);
30 if (status
!= errSecSuccess
) {
31 OSSTATUS_LOG(ERROR
, status
);