OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/cocoa/tab_view.h" | 5 #import "chrome/browser/cocoa/tab_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "base/mac_util.h" | 8 #import "base/mac_util.h" |
| 9 #include "base/mac/mac/scoped_cftyperef.h" |
9 #include "base/nsimage_cache_mac.h" | 10 #include "base/nsimage_cache_mac.h" |
10 #include "base/scoped_cftyperef.h" | |
11 #import "chrome/browser/cocoa/tab_controller.h" | 11 #import "chrome/browser/cocoa/tab_controller.h" |
12 #import "chrome/browser/cocoa/tab_window_controller.h" | 12 #import "chrome/browser/cocoa/tab_window_controller.h" |
13 #import "chrome/browser/cocoa/themed_window.h" | 13 #import "chrome/browser/cocoa/themed_window.h" |
14 #import "chrome/browser/cocoa/view_id_util.h" | 14 #import "chrome/browser/cocoa/view_id_util.h" |
15 #include "chrome/browser/themes/browser_theme_provider.h" | 15 #include "chrome/browser/themes/browser_theme_provider.h" |
16 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Constants for inset and control points for tab shape. | 20 // Constants for inset and control points for tab shape. |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 CGWindowID windowID = [window windowNumber]; | 960 CGWindowID windowID = [window windowNumber]; |
961 if (useCache) { | 961 if (useCache) { |
962 std::map<CGWindowID, int>::iterator iter = | 962 std::map<CGWindowID, int>::iterator iter = |
963 workspaceIDCache_.find(windowID); | 963 workspaceIDCache_.find(windowID); |
964 if (iter != workspaceIDCache_.end()) | 964 if (iter != workspaceIDCache_.end()) |
965 return iter->second; | 965 return iter->second; |
966 } | 966 } |
967 | 967 |
968 int workspace = -1; | 968 int workspace = -1; |
969 // It's possible to query in bulk, but probably not necessary. | 969 // It's possible to query in bulk, but probably not necessary. |
970 scoped_cftyperef<CFArrayRef> windowIDs(CFArrayCreate( | 970 base::mac::ScopedCFTypeRef<CFArrayRef> windowIDs(CFArrayCreate( |
971 NULL, reinterpret_cast<const void **>(&windowID), 1, NULL)); | 971 NULL, reinterpret_cast<const void **>(&windowID), 1, NULL)); |
972 scoped_cftyperef<CFArrayRef> descriptions( | 972 base::mac::ScopedCFTypeRef<CFArrayRef> descriptions( |
973 CGWindowListCreateDescriptionFromArray(windowIDs)); | 973 CGWindowListCreateDescriptionFromArray(windowIDs)); |
974 DCHECK(CFArrayGetCount(descriptions.get()) <= 1); | 974 DCHECK(CFArrayGetCount(descriptions.get()) <= 1); |
975 if (CFArrayGetCount(descriptions.get()) > 0) { | 975 if (CFArrayGetCount(descriptions.get()) > 0) { |
976 CFDictionaryRef dict = static_cast<CFDictionaryRef>( | 976 CFDictionaryRef dict = static_cast<CFDictionaryRef>( |
977 CFArrayGetValueAtIndex(descriptions.get(), 0)); | 977 CFArrayGetValueAtIndex(descriptions.get(), 0)); |
978 DCHECK(CFGetTypeID(dict) == CFDictionaryGetTypeID()); | 978 DCHECK(CFGetTypeID(dict) == CFDictionaryGetTypeID()); |
979 | 979 |
980 // Sanity check the ID. | 980 // Sanity check the ID. |
981 CFNumberRef otherIDRef = (CFNumberRef)mac_util::GetValueFromDictionary( | 981 CFNumberRef otherIDRef = (CFNumberRef)mac_util::GetValueFromDictionary( |
982 dict, kCGWindowNumber, CFNumberGetTypeID()); | 982 dict, kCGWindowNumber, CFNumberGetTypeID()); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 controlPoint1:NSMakePoint(topRight.x + bottomControlPointInset, | 1037 controlPoint1:NSMakePoint(topRight.x + bottomControlPointInset, |
1038 topRight.y) | 1038 topRight.y) |
1039 controlPoint2:NSMakePoint(bottomRight.x - baseControlPointOutset, | 1039 controlPoint2:NSMakePoint(bottomRight.x - baseControlPointOutset, |
1040 bottomRight.y)]; | 1040 bottomRight.y)]; |
1041 [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y)]; | 1041 [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y)]; |
1042 [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y - 2)]; | 1042 [path lineToPoint:NSMakePoint(bottomRight.x + 1, bottomRight.y - 2)]; |
1043 return path; | 1043 return path; |
1044 } | 1044 } |
1045 | 1045 |
1046 @end // @implementation TabView(Private) | 1046 @end // @implementation TabView(Private) |
OLD | NEW |