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

Side by Side Diff: ui/wm/core/accelerator_filter.cc

Issue 1161853004: Revert "Converting (Alt+LeftClick -> RightClick) to (Search+LeftClick -> RightClick)" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/wm/core/accelerator_filter.h ('k') | 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 "ui/wm/core/accelerator_filter.h" 5 #include "ui/wm/core/accelerator_filter.h"
6 6
7 #include "ui/base/accelerators/accelerator.h" 7 #include "ui/base/accelerators/accelerator.h"
8 #include "ui/base/accelerators/accelerator_history.h" 8 #include "ui/base/accelerators/accelerator_history.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/wm/core/accelerator_delegate.h" 10 #include "ui/wm/core/accelerator_delegate.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 accelerator_history_->StoreCurrentAccelerator(accelerator); 64 accelerator_history_->StoreCurrentAccelerator(accelerator);
65 65
66 AcceleratorDelegate::KeyType key_type = 66 AcceleratorDelegate::KeyType key_type =
67 IsSystemKey(event->key_code()) ? AcceleratorDelegate::KEY_TYPE_SYSTEM 67 IsSystemKey(event->key_code()) ? AcceleratorDelegate::KEY_TYPE_SYSTEM
68 : AcceleratorDelegate::KEY_TYPE_OTHER; 68 : AcceleratorDelegate::KEY_TYPE_OTHER;
69 69
70 if (delegate_->ProcessAccelerator(*event, accelerator, key_type)) 70 if (delegate_->ProcessAccelerator(*event, accelerator, key_type))
71 event->StopPropagation(); 71 event->StopPropagation();
72 } 72 }
73 73
74 void AcceleratorFilter::OnMouseEvent(ui::MouseEvent* event) {
75 // When a mouse event is interleaved between two key accelerators, we must
76 // store this event as an empty default accelerator in the accelerator
77 // history, so that the |AcceleratorController| can notice that something
78 // actually happened between those two key accelerators.
79 // Non-real synthesized mouse events should be ignored because we don't want
80 // them to interfere with tracking the key accelerator.
81 if (event->flags() & ui::EF_IS_SYNTHESIZED)
82 return;
83
84 accelerator_history_->StoreCurrentAccelerator(ui::Accelerator());
85 }
86
87 } // namespace wm 74 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/accelerator_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698