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 "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 - (void)setFrameSize:(NSSize)newSize { | 83 - (void)setFrameSize:(NSSize)newSize { |
84 [super setFrameSize:newSize]; | 84 [super setFrameSize:newSize]; |
85 if (!hostedView_) | 85 if (!hostedView_) |
86 return; | 86 return; |
87 | 87 |
88 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height)); | 88 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height)); |
89 } | 89 } |
90 | 90 |
91 - (void)drawRect:(NSRect)dirtyRect { | 91 - (void)drawRect:(NSRect)dirtyRect { |
92 if (!hostedView_) | 92 if (!hostedView_ || [self wantsLayer]) |
93 return; | 93 return; |
94 | 94 |
95 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */); | 95 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */); |
96 hostedView_->Paint(&canvas, views::CullSet()); | 96 hostedView_->Paint(&canvas, views::CullSet()); |
97 } | 97 } |
98 | 98 |
99 // NSResponder implementation. | 99 // NSResponder implementation. |
100 | 100 |
101 - (void)keyDown:(NSEvent*)theEvent { | 101 - (void)keyDown:(NSEvent*)theEvent { |
102 if (textInputClient_) | 102 if (textInputClient_) |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 311 } |
312 | 312 |
313 return [super accessibilityAttributeValue:attribute]; | 313 return [super accessibilityAttributeValue:attribute]; |
314 } | 314 } |
315 | 315 |
316 - (id)accessibilityHitTest:(NSPoint)point { | 316 - (id)accessibilityHitTest:(NSPoint)point { |
317 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 317 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
318 } | 318 } |
319 | 319 |
320 @end | 320 @end |
OLD | NEW |