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

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 9240002: Change the signature of SetScreenshotDelegate() to show ownership transfer more clearly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698