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

Side by Side Diff: base/message_loop/message_pump_win.cc

Issue 1267483003: Combine the WM_CHAR with WM_KEY* for key event flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | ui/base/ime/input_method_win.h » ('j') | ui/base/ime/input_method_win.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/message_loop/message_pump_win.h" 5 #include "base/message_loop/message_pump_win.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <math.h> 8 #include <math.h>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (state_->dispatcher) { 393 if (state_->dispatcher) {
394 // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed. 394 // TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed.
395 tracked_objects::ScopedTracker tracking_profile4( 395 tracked_objects::ScopedTracker tracking_profile4(
396 FROM_HERE_WITH_EXPLICIT_FUNCTION( 396 FROM_HERE_WITH_EXPLICIT_FUNCTION(
397 "440919 MessagePumpForUI::ProcessMessageHelper4")); 397 "440919 MessagePumpForUI::ProcessMessageHelper4"));
398 398
399 action = state_->dispatcher->Dispatch(msg); 399 action = state_->dispatcher->Dispatch(msg);
400 } 400 }
401 if (action & MessagePumpDispatcher::POST_DISPATCH_QUIT_LOOP) 401 if (action & MessagePumpDispatcher::POST_DISPATCH_QUIT_LOOP)
402 state_->should_quit = true; 402 state_->should_quit = true;
403 if (action & MessagePumpDispatcher::POST_DISPATCH_PERFORM_DEFAULT) { 403 if (action & MessagePumpDispatcher::POST_DISPATCH_PERFORM_DEFAULT)
404 TranslateMessage(&msg);
James Su 2015/08/03 16:09:00 better add comment to explain why we don't call Tr
Shu Chen 2015/08/04 08:18:42 Done.
405 DispatchMessage(&msg); 404 DispatchMessage(&msg);
406 }
407 405
408 return true; 406 return true;
409 } 407 }
410 408
411 bool MessagePumpForUI::ProcessPumpReplacementMessage() { 409 bool MessagePumpForUI::ProcessPumpReplacementMessage() {
412 // When we encounter a kMsgHaveWork message, this method is called to peek 410 // When we encounter a kMsgHaveWork message, this method is called to peek
413 // and process a replacement message, such as a WM_PAINT or WM_TIMER. The 411 // and process a replacement message, such as a WM_PAINT or WM_TIMER. The
414 // goal is to make the kMsgHaveWork as non-intrusive as possible, even though 412 // goal is to make the kMsgHaveWork as non-intrusive as possible, even though
415 // a continuous stream of such messages are posted. This method carefully 413 // a continuous stream of such messages are posted. This method carefully
416 // peeks a message while there is no chance for a kMsgHaveWork to be pending, 414 // peeks a message while there is no chance for a kMsgHaveWork to be pending,
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 670
673 // static 671 // static
674 MessagePumpForIO::IOHandler* MessagePumpForIO::KeyToHandler( 672 MessagePumpForIO::IOHandler* MessagePumpForIO::KeyToHandler(
675 ULONG_PTR key, 673 ULONG_PTR key,
676 bool* has_valid_io_context) { 674 bool* has_valid_io_context) {
677 *has_valid_io_context = ((key & 1) == 0); 675 *has_valid_io_context = ((key & 1) == 0);
678 return reinterpret_cast<IOHandler*>(key & ~static_cast<ULONG_PTR>(1)); 676 return reinterpret_cast<IOHandler*>(key & ~static_cast<ULONG_PTR>(1));
679 } 677 }
680 678
681 } // namespace base 679 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | ui/base/ime/input_method_win.h » ('j') | ui/base/ime/input_method_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698