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

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

Issue 1560293002: Rename KEY_ constants to avoid conflict with <linux/input.h> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments (Wez) Created 4 years, 11 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/ozone/demo/ozone_demo.cc ('k') | ui/views/controls/combobox/combobox_unittest.cc » ('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 "skia/ext/skia_utils_mac.h" 10 #include "skia/ext/skia_utils_mac.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 - (void)undo:(id)sender { 202 - (void)undo:(id)sender {
203 // This DCHECK is more strict than a similar check in handleAction:. It can be 203 // This DCHECK is more strict than a similar check in handleAction:. It can be
204 // done here because the actors sending these actions should be calling 204 // done here because the actors sending these actions should be calling
205 // validateUserInterfaceItem: before enabling UI that allows these messages to 205 // validateUserInterfaceItem: before enabling UI that allows these messages to
206 // be sent. Checking it here would be too late to provide correct UI feedback 206 // be sent. Checking it here would be too late to provide correct UI feedback
207 // (e.g. there will be no "beep"). 207 // (e.g. there will be no "beep").
208 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_UNDO)); 208 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_UNDO));
209 [self handleAction:IDS_APP_UNDO 209 [self handleAction:IDS_APP_UNDO
210 keyCode:ui::VKEY_Z 210 keyCode:ui::VKEY_Z
211 domCode:ui::DomCode::KEY_Z 211 domCode:ui::DomCode::US_Z
212 eventFlags:ui::EF_CONTROL_DOWN]; 212 eventFlags:ui::EF_CONTROL_DOWN];
213 } 213 }
214 214
215 - (void)redo:(id)sender { 215 - (void)redo:(id)sender {
216 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_REDO)); 216 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_REDO));
217 [self handleAction:IDS_APP_REDO 217 [self handleAction:IDS_APP_REDO
218 keyCode:ui::VKEY_Z 218 keyCode:ui::VKEY_Z
219 domCode:ui::DomCode::KEY_Z 219 domCode:ui::DomCode::US_Z
220 eventFlags:ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN]; 220 eventFlags:ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN];
221 } 221 }
222 222
223 - (void)cut:(id)sender { 223 - (void)cut:(id)sender {
224 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_CUT)); 224 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_CUT));
225 [self handleAction:IDS_APP_CUT 225 [self handleAction:IDS_APP_CUT
226 keyCode:ui::VKEY_X 226 keyCode:ui::VKEY_X
227 domCode:ui::DomCode::KEY_X 227 domCode:ui::DomCode::US_X
228 eventFlags:ui::EF_CONTROL_DOWN]; 228 eventFlags:ui::EF_CONTROL_DOWN];
229 } 229 }
230 230
231 - (void)copy:(id)sender { 231 - (void)copy:(id)sender {
232 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_COPY)); 232 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_COPY));
233 [self handleAction:IDS_APP_COPY 233 [self handleAction:IDS_APP_COPY
234 keyCode:ui::VKEY_C 234 keyCode:ui::VKEY_C
235 domCode:ui::DomCode::KEY_C 235 domCode:ui::DomCode::US_C
236 eventFlags:ui::EF_CONTROL_DOWN]; 236 eventFlags:ui::EF_CONTROL_DOWN];
237 } 237 }
238 238
239 - (void)paste:(id)sender { 239 - (void)paste:(id)sender {
240 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_PASTE)); 240 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_PASTE));
241 [self handleAction:IDS_APP_PASTE 241 [self handleAction:IDS_APP_PASTE
242 keyCode:ui::VKEY_V 242 keyCode:ui::VKEY_V
243 domCode:ui::DomCode::KEY_V 243 domCode:ui::DomCode::US_V
244 eventFlags:ui::EF_CONTROL_DOWN]; 244 eventFlags:ui::EF_CONTROL_DOWN];
245 } 245 }
246 246
247 - (void)selectAll:(id)sender { 247 - (void)selectAll:(id)sender {
248 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_SELECT_ALL)); 248 DCHECK(textInputClient_->IsEditCommandEnabled(IDS_APP_SELECT_ALL));
249 [self handleAction:IDS_APP_SELECT_ALL 249 [self handleAction:IDS_APP_SELECT_ALL
250 keyCode:ui::VKEY_A 250 keyCode:ui::VKEY_A
251 domCode:ui::DomCode::KEY_A 251 domCode:ui::DomCode::US_A
252 eventFlags:ui::EF_CONTROL_DOWN]; 252 eventFlags:ui::EF_CONTROL_DOWN];
253 } 253 }
254 254
255 // BaseView implementation. 255 // BaseView implementation.
256 256
257 // Don't use tracking areas from BaseView. BridgedContentView's tracks 257 // Don't use tracking areas from BaseView. BridgedContentView's tracks
258 // NSTrackingCursorUpdate and Apple's documentation suggests it's incompatible. 258 // NSTrackingCursorUpdate and Apple's documentation suggests it's incompatible.
259 - (void)enableTracking { 259 - (void)enableTracking {
260 } 260 }
261 261
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ui/ozone/demo/ozone_demo.cc ('k') | ui/views/controls/combobox/combobox_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698