OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/mac/foundation_util.h" | 5 #include "base/mac/foundation_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/mac/bundle_locations.h" | 13 #include "base/mac/bundle_locations.h" |
14 #include "base/mac/mac_logging.h" | 14 #include "base/mac/mac_logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/numerics/safe_conversions.h" | 16 #include "base/numerics/safe_conversions.h" |
17 #include "base/strings/sys_string_conversions.h" | 17 #include "base/strings/sys_string_conversions.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 | 19 |
20 #if !defined(OS_IOS) | 20 #if !defined(OS_IOS) |
21 #import <AppKit/AppKit.h> | 21 #import <AppKit/AppKit.h> |
22 #endif | 22 #endif |
23 | 23 |
24 #if !defined(OS_IOS) | 24 #if !defined(OS_IOS) |
25 extern "C" { | 25 extern "C" { |
26 CFTypeID SecACLGetTypeID(); | 26 CFTypeID SecACLGetTypeID(); |
27 CFTypeID SecTrustedApplicationGetTypeID(); | 27 CFTypeID SecTrustedApplicationGetTypeID(); |
| 28 CFTypeID AXTextMarkerGetTypeID(); |
| 29 CFTypeID AXTextMarkerRangeGetTypeID(); |
28 Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj); | 30 Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj); |
29 } // extern "C" | 31 } // extern "C" |
30 #endif | 32 #endif |
31 | 33 |
32 namespace base { | 34 namespace base { |
33 namespace mac { | 35 namespace mac { |
34 | 36 |
35 namespace { | 37 namespace { |
36 | 38 |
37 bool g_cached_am_i_bundled_called = false; | 39 bool g_cached_am_i_bundled_called = false; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 CTFontRef rv = CFCast<CTFontRef>(cf_val); | 409 CTFontRef rv = CFCast<CTFontRef>(cf_val); |
408 DCHECK(cf_val == NULL || rv); | 410 DCHECK(cf_val == NULL || rv); |
409 return rv; | 411 return rv; |
410 } | 412 } |
411 #endif | 413 #endif |
412 | 414 |
413 #if !defined(OS_IOS) | 415 #if !defined(OS_IOS) |
414 CF_CAST_DEFN(SecACL); | 416 CF_CAST_DEFN(SecACL); |
415 CF_CAST_DEFN(SecPolicy); | 417 CF_CAST_DEFN(SecPolicy); |
416 CF_CAST_DEFN(SecTrustedApplication); | 418 CF_CAST_DEFN(SecTrustedApplication); |
| 419 CF_CAST_DEFN(AXTextMarker); |
| 420 CF_CAST_DEFN(AXTextMarkerRange); |
417 #endif | 421 #endif |
418 | 422 |
419 #undef CF_CAST_DEFN | 423 #undef CF_CAST_DEFN |
420 | 424 |
421 std::string GetValueFromDictionaryErrorMessage( | 425 std::string GetValueFromDictionaryErrorMessage( |
422 CFStringRef key, const std::string& expected_type, CFTypeRef value) { | 426 CFStringRef key, const std::string& expected_type, CFTypeRef value) { |
423 ScopedCFTypeRef<CFStringRef> actual_type_ref( | 427 ScopedCFTypeRef<CFStringRef> actual_type_ref( |
424 CFCopyTypeIDDescription(CFGetTypeID(value))); | 428 CFCopyTypeIDDescription(CFGetTypeID(value))); |
425 return "Expected value for key " + | 429 return "Expected value for key " + |
426 base::SysCFStringRefToUTF8(key) + | 430 base::SysCFStringRefToUTF8(key) + |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); | 476 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); |
473 } | 477 } |
474 o << "Code: " << CFErrorGetCode(err) | 478 o << "Code: " << CFErrorGetCode(err) |
475 << " Domain: " << CFErrorGetDomain(err) | 479 << " Domain: " << CFErrorGetDomain(err) |
476 << " Desc: " << desc.get(); | 480 << " Desc: " << desc.get(); |
477 if(errorDesc) { | 481 if(errorDesc) { |
478 o << "(" << errorDesc << ")"; | 482 o << "(" << errorDesc << ")"; |
479 } | 483 } |
480 return o; | 484 return o; |
481 } | 485 } |
OLD | NEW |