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

Unified Diff: chrome/browser/chromeos/events/event_rewriter.cc

Issue 575093003: Revert of Track the active ExtensionKeybindingRegistry and make it available to EventRewriter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 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 | « no previous file | chrome/browser/extensions/extension_commands_global_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/events/event_rewriter.cc
diff --git a/chrome/browser/chromeos/events/event_rewriter.cc b/chrome/browser/chromeos/events/event_rewriter.cc
index 879e85a0d22706dff47da9a82b62563493210b06..314a3ecd272cc4987b081631fbc14a31bac25219 100644
--- a/chrome/browser/chromeos/events/event_rewriter.cc
+++ b/chrome/browser/chromeos/events/event_rewriter.cc
@@ -16,7 +16,6 @@
#include "base/strings/string_util.h"
#include "base/sys_info.h"
#include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
-#include "chrome/browser/extensions/extension_commands_global_registry.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
@@ -103,28 +102,6 @@
input_method::InputMethodManager* manager =
input_method::InputMethodManager::Get();
return manager->IsISOLevel5ShiftUsedByCurrentInputMethod();
-}
-
-bool IsExtensionCommandRegistered(const ui::KeyEvent& key_event) {
- // Some keyboard events for ChromeOS get rewritten, such as:
- // Search+Shift+Left gets converted to Shift+Home (BeginDocument).
- // This doesn't make sense if the user has assigned that shortcut
- // to an extension. Because:
- // 1) The extension would, upon seeing a request for Ctrl+Shift+Home have
- // to register for Shift+Home, instead.
- // 2) The conversion is unnecessary, because Shift+Home (BeginDocument) isn't
- // going to be executed.
- // Therefore, we skip converting the accelerator if an extension has
- // registered for this shortcut.
- Profile* profile = ProfileManager::GetActiveUserProfile();
- if (!profile || !extensions::ExtensionCommandsGlobalRegistry::Get(profile))
- return false;
-
- int modifiers = key_event.flags() & (ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN |
- ui::EF_ALT_DOWN | ui::EF_COMMAND_DOWN);
- ui::Accelerator accelerator(key_event.key_code(), modifiers);
- return extensions::ExtensionCommandsGlobalRegistry::Get(profile)
- ->IsRegistered(accelerator);
}
EventRewriter::DeviceType GetDeviceType(const std::string& device_name) {
@@ -383,8 +360,6 @@
ui::EventRewriteStatus EventRewriter::RewriteKeyEvent(
const ui::KeyEvent& key_event,
scoped_ptr<ui::Event>* rewritten_event) {
- if (IsExtensionCommandRegistered(key_event))
- return ui::EVENT_REWRITE_CONTINUE;
if (key_event.source_device_id() != ui::ED_UNKNOWN_DEVICE)
DeviceKeyPressedOrReleased(key_event.source_device_id());
MutableKeyState state = {key_event.flags(), key_event.key_code()};
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_commands_global_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698