| 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/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 // by windowMask_. | 725 // by windowMask_. |
| 726 [outerPath fill]; | 726 [outerPath fill]; |
| 727 // Regerate drop shadow around the window boundary. | 727 // Regerate drop shadow around the window boundary. |
| 728 [[self window] invalidateShadow]; | 728 [[self window] invalidateShadow]; |
| 729 } | 729 } |
| 730 | 730 |
| 731 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). | 731 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). |
| 732 if (hostedView_->GetWidget()->GetLayer()) | 732 if (hostedView_->GetWidget()->GetLayer()) |
| 733 return; | 733 return; |
| 734 | 734 |
| 735 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */); | 735 // TODO(tapted): Add a NOTREACHED() here. At the moment, low-level |
| 736 hostedView_->GetWidget()->OnNativeWidgetPaint( | 736 // BridgedNativeWidget unit tests may not have a ui::Layer. |
| 737 ui::CanvasPainter(&canvas, 1.f).context()); | |
| 738 } | 737 } |
| 739 | 738 |
| 740 - (BOOL)isOpaque { | 739 - (BOOL)isOpaque { |
| 741 if (!hostedView_) | 740 if (!hostedView_) |
| 742 return NO; | 741 return NO; |
| 743 | 742 |
| 744 ui::Layer* layer = hostedView_->GetWidget()->GetLayer(); | 743 ui::Layer* layer = hostedView_->GetWidget()->GetLayer(); |
| 745 return layer && layer->fills_bounds_opaquely(); | 744 return layer && layer->fills_bounds_opaquely(); |
| 746 } | 745 } |
| 747 | 746 |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1489 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1488 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1490 } | 1489 } |
| 1491 | 1490 |
| 1492 - (id)accessibilityFocusedUIElement { | 1491 - (id)accessibilityFocusedUIElement { |
| 1493 if (!hostedView_) | 1492 if (!hostedView_) |
| 1494 return nil; | 1493 return nil; |
| 1495 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; | 1494 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; |
| 1496 } | 1495 } |
| 1497 | 1496 |
| 1498 @end | 1497 @end |
| OLD | NEW |