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

Unified Diff: ash/accelerators/accelerator_dispatcher_linux.cc

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync, addressed comments Created 8 years, 8 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/accelerators/accelerator_dispatcher.cc ('k') | ash/accelerators/accelerator_dispatcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_dispatcher_linux.cc
diff --git a/ash/accelerators/accelerator_dispatcher_linux.cc b/ash/accelerators/accelerator_dispatcher_linux.cc
deleted file mode 100644
index 3167f75a34fb88d7725f658aa6181431927671ef..0000000000000000000000000000000000000000
--- a/ash/accelerators/accelerator_dispatcher_linux.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2012 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/accelerators/accelerator_dispatcher.h"
-
-#include <X11/Xlib.h>
-
-// Xlib defines RootWindow
-#ifdef RootWindow
-#undef RootWindow
-#endif
-
-#include "ash/accelerators/accelerator_controller.h"
-#include "ash/shell.h"
-#include "ui/aura/env.h"
-#include "ui/aura/event.h"
-#include "ui/aura/root_window.h"
-#include "ui/base/accelerators/accelerator.h"
-#include "ui/base/events.h"
-
-namespace ash {
-
-namespace {
-
-const int kModifierMask = (ui::EF_SHIFT_DOWN |
- ui::EF_CONTROL_DOWN |
- ui::EF_ALT_DOWN);
-} // namespace
-
-base::MessagePumpDispatcher::DispatchStatus AcceleratorDispatcher::Dispatch(
- XEvent* xev) {
- // TODO(oshima): Consolidate win and linux. http://crbug.com/116282
- if (!associated_window_)
- return EVENT_QUIT;
- if (!ui::IsNoopEvent(xev) && !associated_window_->CanReceiveEvents())
- return aura::Env::GetInstance()->GetDispatcher()->Dispatch(xev);
-
- if (xev->type == KeyPress || xev->type == KeyRelease) {
- ash::AcceleratorController* accelerator_controller =
- ash::Shell::GetInstance()->accelerator_controller();
- if (accelerator_controller) {
- ui::Accelerator accelerator(ui::KeyboardCodeFromNative(xev),
- ui::EventFlagsFromNative(xev) & kModifierMask);
- if (xev->type == KeyRelease)
- accelerator.set_type(ui::ET_KEY_RELEASED);
- if (accelerator_controller->Process(accelerator))
- return EVENT_PROCESSED;
-
- accelerator.set_type(aura::TranslatedKeyEvent(xev, false).type());
- if (accelerator_controller->Process(accelerator))
- return EVENT_PROCESSED;
- }
- }
- return nested_dispatcher_->Dispatch(xev);
-}
-
-} // namespace ash
« no previous file with comments | « ash/accelerators/accelerator_dispatcher.cc ('k') | ash/accelerators/accelerator_dispatcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698