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

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 // Don't call TranslateMessage() here but call TranslateMessage() in
404 TranslateMessage(&msg); 404 // InputMethodWin, so that the WM_KEYDOWN & WM_CHAR can be combined for key
James Su 2015/08/04 17:06:44 WM_KEYDOWN/WM_KEYUP
Shu Chen 2015/08/05 01:36:45 Done.
405 // event flow. The combination as single key event is required for Chrome
406 // IMEs, which can do IME related actions based on the single key event.
407 if (action & MessagePumpDispatcher::POST_DISPATCH_PERFORM_DEFAULT)
405 DispatchMessage(&msg); 408 DispatchMessage(&msg);
406 }
407 409
408 return true; 410 return true;
409 } 411 }
410 412
411 bool MessagePumpForUI::ProcessPumpReplacementMessage() { 413 bool MessagePumpForUI::ProcessPumpReplacementMessage() {
412 // When we encounter a kMsgHaveWork message, this method is called to peek 414 // 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 415 // 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 416 // 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 417 // 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, 418 // 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 674
673 // static 675 // static
674 MessagePumpForIO::IOHandler* MessagePumpForIO::KeyToHandler( 676 MessagePumpForIO::IOHandler* MessagePumpForIO::KeyToHandler(
675 ULONG_PTR key, 677 ULONG_PTR key,
676 bool* has_valid_io_context) { 678 bool* has_valid_io_context) {
677 *has_valid_io_context = ((key & 1) == 0); 679 *has_valid_io_context = ((key & 1) == 0);
678 return reinterpret_cast<IOHandler*>(key & ~static_cast<ULONG_PTR>(1)); 680 return reinterpret_cast<IOHandler*>(key & ~static_cast<ULONG_PTR>(1));
679 } 681 }
680 682
681 } // namespace base 683 } // 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