OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/cocoa/bridged_content_view.h" | 5 #import "ui/views/cocoa/bridged_content_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "skia/ext/skia_utils_mac.h" | 10 #include "skia/ext/skia_utils_mac.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height)); | 305 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height)); |
306 } | 306 } |
307 | 307 |
308 - (void)drawRect:(NSRect)dirtyRect { | 308 - (void)drawRect:(NSRect)dirtyRect { |
309 // Note that BridgedNativeWidget uses -[NSWindow setAutodisplay:NO] to | 309 // Note that BridgedNativeWidget uses -[NSWindow setAutodisplay:NO] to |
310 // suppress calls to this when the window is known to be hidden. | 310 // suppress calls to this when the window is known to be hidden. |
311 if (!hostedView_) | 311 if (!hostedView_) |
312 return; | 312 return; |
313 | 313 |
314 if (drawMenuBackgroundForBlur_) { | 314 if (drawMenuBackgroundForBlur_) { |
315 const CGFloat radius = views::MenuConfig::instance(nullptr).corner_radius; | 315 const CGFloat radius = views::MenuConfig::instance().corner_radius; |
316 [skia::SkColorToSRGBNSColor(0x01000000) set]; | 316 [skia::SkColorToSRGBNSColor(0x01000000) set]; |
317 [[NSBezierPath bezierPathWithRoundedRect:[self bounds] | 317 [[NSBezierPath bezierPathWithRoundedRect:[self bounds] |
318 xRadius:radius | 318 xRadius:radius |
319 yRadius:radius] fill]; | 319 yRadius:radius] fill]; |
320 } | 320 } |
321 | 321 |
322 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). | 322 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). |
323 if (hostedView_->GetWidget()->GetLayer()) | 323 if (hostedView_->GetWidget()->GetLayer()) |
324 return; | 324 return; |
325 | 325 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 } | 722 } |
723 | 723 |
724 return [super accessibilityAttributeValue:attribute]; | 724 return [super accessibilityAttributeValue:attribute]; |
725 } | 725 } |
726 | 726 |
727 - (id)accessibilityHitTest:(NSPoint)point { | 727 - (id)accessibilityHitTest:(NSPoint)point { |
728 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 728 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
729 } | 729 } |
730 | 730 |
731 @end | 731 @end |
OLD | NEW |