OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/mac_util.h" | 5 #include "base/mac/mac_util.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 ScopedCFTypeRef<LSSharedFileListItemRef> item(GetLoginItemForApp()); | 475 ScopedCFTypeRef<LSSharedFileListItemRef> item(GetLoginItemForApp()); |
476 if (!item.get()) { | 476 if (!item.get()) { |
477 LOG(ERROR) << "Process launched at Login but can't access Login Item List."; | 477 LOG(ERROR) << "Process launched at Login but can't access Login Item List."; |
478 return false; | 478 return false; |
479 } | 479 } |
480 return IsHiddenLoginItem(item); | 480 return IsHiddenLoginItem(item); |
481 } | 481 } |
482 | 482 |
483 } // namespace mac | 483 } // namespace mac |
484 } // namespace base | 484 } // namespace base |
| 485 |
| 486 std::ostream& operator<<(std::ostream& o, const CFStringRef string) { |
| 487 return o << base::SysCFStringRefToUTF8(string); |
| 488 } |
| 489 |
| 490 std::ostream& operator<<(std::ostream& o, const CFErrorRef err) { |
| 491 base::mac::ScopedCFTypeRef<CFStringRef> desc(CFErrorCopyDescription(err)); |
| 492 base::mac::ScopedCFTypeRef<CFDictionaryRef> user_info( |
| 493 CFErrorCopyUserInfo(err)); |
| 494 CFStringRef errorDesc = NULL; |
| 495 if (user_info.get()) { |
| 496 errorDesc = reinterpret_cast<CFStringRef>( |
| 497 CFDictionaryGetValue(user_info.get(), kCFErrorDescriptionKey)); |
| 498 } |
| 499 o << "Code: " << CFErrorGetCode(err) |
| 500 << " Domain: " << CFErrorGetDomain(err) |
| 501 << " Desc: " << desc.get(); |
| 502 if(errorDesc) { |
| 503 o << "(" << errorDesc << ")"; |
| 504 } |
| 505 return o; |
| 506 } |
| 507 |
OLD | NEW |