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

Unified Diff: ash/common/key_event_watcher.cc

Issue 2330403002: Do not activate system tray bubble by default (Closed)
Patch Set: Do not activate system tray bubble by default Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/key_event_watcher.h ('k') | ash/common/shelf/shelf_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/key_event_watcher.cc
diff --git a/ash/common/key_event_watcher.cc b/ash/common/key_event_watcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cf3d368c8c66909d41e63ba54476cac857ca991a
--- /dev/null
+++ b/ash/common/key_event_watcher.cc
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/common/key_event_watcher.h"
+
+namespace ash {
+
+KeyEventWatcher::KeyEventWatcher() {}
+
+KeyEventWatcher::~KeyEventWatcher() {}
+
+void KeyEventWatcher::AddKeyEventCallback(const ui::Accelerator& key,
+ const KeyEventCallback& callback) {
+ callback_map_.insert(std::make_pair(key, callback));
+}
+
+bool KeyEventWatcher::HandleKeyEvent(const ui::KeyEvent& event) {
+ auto iter = callback_map_.find(ui::Accelerator(event));
+ if (iter != callback_map_.end()) {
+ iter->second.Run(event);
+ return true;
+ }
+ return false;
+}
+
+} // namespace ash
« no previous file with comments | « ash/common/key_event_watcher.h ('k') | ash/common/shelf/shelf_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698