Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_ | 5 #ifndef ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_ |
| 6 #define ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_ | 6 #define ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/time/time.h" | |
| 10 | 11 |
| 11 namespace ui { | 12 namespace ui { |
| 12 class Accelerator; | 13 class Accelerator; |
| 13 class KeyEvent; | 14 class KeyEvent; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 | 18 |
| 18 class WmWindow; | 19 class WmWindow; |
| 19 | 20 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 34 private: | 35 private: |
| 35 // Returns true if the window should be allowed a chance to handle | 36 // Returns true if the window should be allowed a chance to handle |
| 36 // system keys. | 37 // system keys. |
| 37 bool CanConsumeSystemKeys(WmWindow* target, const ui::KeyEvent& event); | 38 bool CanConsumeSystemKeys(WmWindow* target, const ui::KeyEvent& event); |
| 38 | 39 |
| 39 // Returns true if the |accelerator| should be processed now. | 40 // Returns true if the |accelerator| should be processed now. |
| 40 bool ShouldProcessAcceleratorNow(WmWindow* target, | 41 bool ShouldProcessAcceleratorNow(WmWindow* target, |
| 41 const ui::KeyEvent& event, | 42 const ui::KeyEvent& event, |
| 42 const ui::Accelerator& accelerator); | 43 const ui::Accelerator& accelerator); |
| 43 | 44 |
| 45 // Records a histogram on how long the "Search" key is held when a user | |
| 46 // presses an accelerator that involes the "Search" key. | |
| 47 void RecordSearchKeyStats(const ui::Accelerator& accelerator); | |
| 48 | |
| 49 bool search_key_pressed_ = false; | |
| 50 bool search_key_pressed_recorded_ = false; | |
|
oshima
2017/02/14 05:10:57
instead of having two variable, can you use state
| |
| 51 base::TimeTicks search_key_pressed_timestamp_; | |
| 52 | |
| 44 DISALLOW_COPY_AND_ASSIGN(AcceleratorRouter); | 53 DISALLOW_COPY_AND_ASSIGN(AcceleratorRouter); |
| 45 }; | 54 }; |
| 46 | 55 |
| 47 } // namespace ash | 56 } // namespace ash |
| 48 | 57 |
| 49 #endif // ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_ | 58 #endif // ASH_ACCELERATORS_ACCELERATOR_ROUTER_H_ |
| OLD | NEW |