| 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 "ash/accelerators/accelerator_dispatcher.h" | 5 #include "ash/accelerators/accelerator_dispatcher.h" |
| 6 | 6 |
| 7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 // Xlib defines RootWindow | 10 // Xlib defines RootWindow |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 (key_code == ui::VKEY_TAB)) { | 60 (key_code == ui::VKEY_TAB)) { |
| 61 return true; | 61 return true; |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 return false; | 64 return false; |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 AcceleratorDispatcher::AcceleratorDispatcher( | 69 AcceleratorDispatcher::AcceleratorDispatcher( |
| 70 base::MessagePumpDispatcher* nested_dispatcher, | 70 base::MessageLoop::Dispatcher* nested_dispatcher, |
| 71 aura::Window* associated_window) | 71 aura::Window* associated_window) |
| 72 : nested_dispatcher_(nested_dispatcher), | 72 : nested_dispatcher_(nested_dispatcher), |
| 73 associated_window_(associated_window) { | 73 associated_window_(associated_window) { |
| 74 DCHECK(nested_dispatcher_); | 74 DCHECK(nested_dispatcher_); |
| 75 associated_window_->AddObserver(this); | 75 associated_window_->AddObserver(this); |
| 76 } | 76 } |
| 77 | 77 |
| 78 AcceleratorDispatcher::~AcceleratorDispatcher() { | 78 AcceleratorDispatcher::~AcceleratorDispatcher() { |
| 79 if (associated_window_) | 79 if (associated_window_) |
| 80 associated_window_->RemoveObserver(this); | 80 associated_window_->RemoveObserver(this); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return true; | 130 return true; |
| 131 } | 131 } |
| 132 | 132 |
| 133 return nested_dispatcher_->Dispatch(key_event.native_event()); | 133 return nested_dispatcher_->Dispatch(key_event.native_event()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 return nested_dispatcher_->Dispatch(event); | 136 return nested_dispatcher_->Dispatch(event); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace ash | 139 } // namespace ash |
| OLD | NEW |