| 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 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 654 |
| 655 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). | 655 // If there's a layer, painting occurs in BridgedNativeWidget::OnPaintLayer(). |
| 656 if (hostedView_->GetWidget()->GetLayer()) | 656 if (hostedView_->GetWidget()->GetLayer()) |
| 657 return; | 657 return; |
| 658 | 658 |
| 659 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */); | 659 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */); |
| 660 hostedView_->GetWidget()->OnNativeWidgetPaint( | 660 hostedView_->GetWidget()->OnNativeWidgetPaint( |
| 661 ui::CanvasPainter(&canvas, 1.f).context()); | 661 ui::CanvasPainter(&canvas, 1.f).context()); |
| 662 } | 662 } |
| 663 | 663 |
| 664 - (BOOL)isOpaque { |
| 665 if (!hostedView_) |
| 666 return NO; |
| 667 |
| 668 ui::Layer* layer = hostedView_->GetWidget()->GetLayer(); |
| 669 return layer && layer->fills_bounds_opaquely(); |
| 670 } |
| 671 |
| 664 // To maximize consistency with the Cocoa browser (mac_views_browser=0), accept | 672 // To maximize consistency with the Cocoa browser (mac_views_browser=0), accept |
| 665 // mouse clicks immediately so that clicking on Chrome from an inactive window | 673 // mouse clicks immediately so that clicking on Chrome from an inactive window |
| 666 // will allow the event to be processed, rather than merely activate the window. | 674 // will allow the event to be processed, rather than merely activate the window. |
| 667 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { | 675 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { |
| 668 return YES; | 676 return YES; |
| 669 } | 677 } |
| 670 | 678 |
| 671 // NSDraggingDestination protocol overrides. | 679 // NSDraggingDestination protocol overrides. |
| 672 | 680 |
| 673 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender { | 681 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender { |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 } | 1309 } |
| 1302 | 1310 |
| 1303 return [super accessibilityAttributeValue:attribute]; | 1311 return [super accessibilityAttributeValue:attribute]; |
| 1304 } | 1312 } |
| 1305 | 1313 |
| 1306 - (id)accessibilityHitTest:(NSPoint)point { | 1314 - (id)accessibilityHitTest:(NSPoint)point { |
| 1307 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1315 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1308 } | 1316 } |
| 1309 | 1317 |
| 1310 @end | 1318 @end |
| OLD | NEW |