Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: ui/views/cocoa/bridged_content_view.mm

Issue 659233002: STASH: Epic Experimental patch for toolkit-views App List on Mac Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Fix a few things. Works@master Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/cocoa/bridged_native_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 hostedView_->GetWidget()->OnMouseEvent(&event); 70 hostedView_->GetWidget()->OnMouseEvent(&event);
71 } 71 }
72 72
73 - (void)doCommandByID:(int)commandId { 73 - (void)doCommandByID:(int)commandId {
74 if (textInputClient_ && textInputClient_->IsEditingCommandEnabled(commandId)) 74 if (textInputClient_ && textInputClient_->IsEditingCommandEnabled(commandId))
75 textInputClient_->ExecuteEditingCommand(commandId); 75 textInputClient_->ExecuteEditingCommand(commandId);
76 } 76 }
77 77
78 // NSView implementation. 78 // NSView implementation.
79 79
80 - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
81 return YES;
82 }
83
80 - (BOOL)acceptsFirstResponder { 84 - (BOOL)acceptsFirstResponder {
81 return YES; 85 return YES;
82 } 86 }
83 87
84 - (void)setFrameSize:(NSSize)newSize { 88 - (void)setFrameSize:(NSSize)newSize {
85 [super setFrameSize:newSize]; 89 [super setFrameSize:newSize];
86 if (!hostedView_) 90 if (!hostedView_)
87 return; 91 return;
88 92
89 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height)); 93 hostedView_->SetSize(gfx::Size(newSize.width, newSize.height));
90 } 94 }
91 95
92 - (void)drawRect:(NSRect)dirtyRect { 96 - (void)drawRect:(NSRect)dirtyRect {
93 // Note that on a Show, Cocoa calls drawRect: before changing 97 // Note that on a Show, Cocoa calls drawRect: before changing
94 // -[NSWindow isVisible], hence the extra check. 98 // -[NSWindow isVisible], hence the extra check.
95 if (!hostedView_ || (!willShow_ && ![[self window] isVisible])) 99 if (!hostedView_ || [self wantsLayer] || (!willShow_ && ![[self window] isVisi ble]))
96 return; 100 return;
97 101
98 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */); 102 gfx::CanvasSkiaPaint canvas(dirtyRect, false /* opaque */);
99 hostedView_->GetWidget()->OnNativeWidgetPaint(&canvas); 103 hostedView_->GetWidget()->OnNativeWidgetPaint(&canvas);
100 } 104 }
101 105
102 // NSResponder implementation. 106 // NSResponder implementation.
103 107
104 - (void)keyDown:(NSEvent*)theEvent { 108 - (void)keyDown:(NSEvent*)theEvent {
105 if (textInputClient_) 109 if (textInputClient_)
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 322 }
319 323
320 return [super accessibilityAttributeValue:attribute]; 324 return [super accessibilityAttributeValue:attribute];
321 } 325 }
322 326
323 - (id)accessibilityHitTest:(NSPoint)point { 327 - (id)accessibilityHitTest:(NSPoint)point {
324 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; 328 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point];
325 } 329 }
326 330
327 @end 331 @end
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/cocoa/bridged_native_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698