| OLD | NEW |
| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_table.h" | 7 #include "ash/accelerators/accelerator_table.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/md5.h" | 9 #include "base/md5.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace ash { | 14 namespace ash { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 // The number of non-Search-based accelerators as of 2017-04-06. | 18 // The number of non-Search-based accelerators as of 2017-04-11. |
| 19 constexpr int kNonSearchAcceleratorsNum = 92; | 19 constexpr int kNonSearchAcceleratorsNum = 93; |
| 20 // The hash of non-Search-based accelerators as of 2017-04-06. | 20 // The hash of non-Search-based accelerators as of 2017-04-11. |
| 21 // See HashAcceleratorData(). | 21 // See HashAcceleratorData(). |
| 22 constexpr char kNonSearchAcceleratorsHash[] = | 22 constexpr char kNonSearchAcceleratorsHash[] = |
| 23 "6c6695ca5f4d7298504e4d1e8a148902"; | 23 "c24f35143a69b4378834207913b5a708"; |
| 24 | 24 |
| 25 struct Cmp { | 25 struct Cmp { |
| 26 bool operator()(const AcceleratorData& lhs, const AcceleratorData& rhs) { | 26 bool operator()(const AcceleratorData& lhs, const AcceleratorData& rhs) { |
| 27 if (lhs.trigger_on_press != rhs.trigger_on_press) | 27 if (lhs.trigger_on_press != rhs.trigger_on_press) |
| 28 return lhs.trigger_on_press < rhs.trigger_on_press; | 28 return lhs.trigger_on_press < rhs.trigger_on_press; |
| 29 if (lhs.keycode != rhs.keycode) | 29 if (lhs.keycode != rhs.keycode) |
| 30 return lhs.keycode < rhs.keycode; | 30 return lhs.keycode < rhs.keycode; |
| 31 return lhs.modifiers < rhs.modifiers; | 31 return lhs.modifiers < rhs.modifiers; |
| 32 // Do not check |action|. | 32 // Do not check |action|. |
| 33 } | 33 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 << "New accelerators must use the Search key. Please talk to the UX " | 152 << "New accelerators must use the Search key. Please talk to the UX " |
| 153 "team.\n" | 153 "team.\n" |
| 154 "If you are removing a non-Search-based accelerator, please update " | 154 "If you are removing a non-Search-based accelerator, please update " |
| 155 "the date along with the following values\n" | 155 "the date along with the following values\n" |
| 156 << "kNonSearchAcceleratorsNum=" << accelerators_number << " and " | 156 << "kNonSearchAcceleratorsNum=" << accelerators_number << " and " |
| 157 << "kNonSearchAcceleratorsHash=\"" << non_search_accelerators_hash | 157 << "kNonSearchAcceleratorsHash=\"" << non_search_accelerators_hash |
| 158 << "\""; | 158 << "\""; |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace ash | 161 } // namespace ash |
| OLD | NEW |