Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / mac / security_wrappers.cc
blob0bf17849dc6df3f64388cd310debeefb9f4cef40
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"
11 namespace chrome {
13 ScopedSecKeychainSetUserInteractionAllowed::
14 ScopedSecKeychainSetUserInteractionAllowed(Boolean allowed) {
15 OSStatus status = SecKeychainGetUserInteractionAllowed(&old_allowed_);
16 if (status != errSecSuccess) {
17 OSSTATUS_LOG(ERROR, status);
18 old_allowed_ = TRUE;
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);
35 } // namespace chrome