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

Side by Side Diff: services/ui/ws/platform_display.cc

Issue 2203953002: mus: Remove DCHECK that was causing false positives. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | 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 #include "services/ui/ws/platform_display.h" 5 #include "services/ui/ws/platform_display.h"
6 6
7 #include "base/numerics/safe_conversions.h" 7 #include "base/numerics/safe_conversions.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "cc/ipc/quads.mojom.h" 9 #include "cc/ipc/quads.mojom.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // trying to have one way of doing things, we need to standardize on and 215 // trying to have one way of doing things, we need to standardize on and
216 // emulate Windows character events. 216 // emulate Windows character events.
217 // 217 //
218 // This is equivalent to what we're doing in the current Linux port, but 218 // This is equivalent to what we're doing in the current Linux port, but
219 // done once instead of done multiple times in different places. 219 // done once instead of done multiple times in different places.
220 if (event->type() == ui::ET_KEY_PRESSED) { 220 if (event->type() == ui::ET_KEY_PRESSED) {
221 ui::KeyEvent* key_press_event = event->AsKeyEvent(); 221 ui::KeyEvent* key_press_event = event->AsKeyEvent();
222 ui::KeyEvent char_event(key_press_event->GetCharacter(), 222 ui::KeyEvent char_event(key_press_event->GetCharacter(),
223 key_press_event->key_code(), 223 key_press_event->key_code(),
224 key_press_event->flags()); 224 key_press_event->flags());
225 DCHECK_EQ(key_press_event->GetCharacter(), char_event.GetCharacter()); 225 // We don't check that GetCharacter() is equal because changing a key event
226 // with an accelerator to a character event can change the character, for
227 // example, from 'M' to '^M'.
226 DCHECK_EQ(key_press_event->key_code(), char_event.key_code()); 228 DCHECK_EQ(key_press_event->key_code(), char_event.key_code());
227 DCHECK_EQ(key_press_event->flags(), char_event.flags()); 229 DCHECK_EQ(key_press_event->flags(), char_event.flags());
228 delegate_->OnEvent(char_event); 230 delegate_->OnEvent(char_event);
229 } 231 }
230 #endif 232 #endif
231 } 233 }
232 234
233 void DefaultPlatformDisplay::OnCloseRequest() { 235 void DefaultPlatformDisplay::OnCloseRequest() {
234 platform_window_->Close(); 236 platform_window_->Close();
235 } 237 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 return delegate_ ? delegate_->IsInHighContrastMode() : false; 279 return delegate_ ? delegate_->IsInHighContrastMode() : false;
278 } 280 }
279 281
280 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() { 282 const ViewportMetrics& DefaultPlatformDisplay::GetViewportMetrics() {
281 return metrics_; 283 return metrics_;
282 } 284 }
283 285
284 } // namespace ws 286 } // namespace ws
285 287
286 } // namespace ui 288 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698