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_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include "ash/caps_lock_delegate.h" | 7 #include "ash/caps_lock_delegate.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
10 #include "ash/screenshot_delegate.h" | 10 #include "ash/screenshot_delegate.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void AcceleratorController::UnregisterAll( | 155 void AcceleratorController::UnregisterAll( |
156 ui::AcceleratorTarget* target) { | 156 ui::AcceleratorTarget* target) { |
157 accelerator_manager_->UnregisterAll(target); | 157 accelerator_manager_->UnregisterAll(target); |
158 } | 158 } |
159 | 159 |
160 bool AcceleratorController::Process(const ui::Accelerator& accelerator) { | 160 bool AcceleratorController::Process(const ui::Accelerator& accelerator) { |
161 return accelerator_manager_->Process(accelerator); | 161 return accelerator_manager_->Process(accelerator); |
162 } | 162 } |
163 | 163 |
164 void AcceleratorController::SetScreenshotDelegate( | 164 void AcceleratorController::SetScreenshotDelegate( |
165 ScreenshotDelegate* screenshot_delegate) { | 165 scoped_ptr<ScreenshotDelegate> screenshot_delegate) { |
166 screenshot_delegate_.reset(screenshot_delegate); | 166 screenshot_delegate_.swap(screenshot_delegate); |
167 } | 167 } |
168 | 168 |
169 void AcceleratorController::SetCapsLockDelegate( | 169 void AcceleratorController::SetCapsLockDelegate( |
170 scoped_ptr<CapsLockDelegate> caps_lock_delegate) { | 170 scoped_ptr<CapsLockDelegate> caps_lock_delegate) { |
171 caps_lock_delegate_.swap(caps_lock_delegate); | 171 caps_lock_delegate_.swap(caps_lock_delegate); |
172 } | 172 } |
173 | 173 |
174 //////////////////////////////////////////////////////////////////////////////// | 174 //////////////////////////////////////////////////////////////////////////////// |
175 // AcceleratorController, ui::AcceleratorTarget implementation: | 175 // AcceleratorController, ui::AcceleratorTarget implementation: |
176 | 176 |
(...skipping 30 matching lines...) Expand all Loading... |
207 NOTREACHED() << "Unhandled action " << it->second;; | 207 NOTREACHED() << "Unhandled action " << it->second;; |
208 } | 208 } |
209 return false; | 209 return false; |
210 } | 210 } |
211 | 211 |
212 bool AcceleratorController::CanHandleAccelerators() const { | 212 bool AcceleratorController::CanHandleAccelerators() const { |
213 return true; | 213 return true; |
214 } | 214 } |
215 | 215 |
216 } // namespace ash | 216 } // namespace ash |
OLD | NEW |