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

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

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/magnifier_key_scroller.h" 5 #include "ash/accelerators/magnifier_key_scroller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/accelerators/key_hold_detector.h" 9 #include "ash/accelerators/key_hold_detector.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 18 matching lines...) Expand all
29 return (magnifier_key_scroller_enabled || has_switch) && 29 return (magnifier_key_scroller_enabled || has_switch) &&
30 ash::Shell::GetInstance()->magnification_controller()->IsEnabled(); 30 ash::Shell::GetInstance()->magnification_controller()->IsEnabled();
31 } 31 }
32 32
33 // static 33 // static
34 void MagnifierKeyScroller::SetEnabled(bool enabled) { 34 void MagnifierKeyScroller::SetEnabled(bool enabled) {
35 magnifier_key_scroller_enabled = enabled; 35 magnifier_key_scroller_enabled = enabled;
36 } 36 }
37 37
38 // static 38 // static
39 scoped_ptr<ui::EventHandler> MagnifierKeyScroller::CreateHandler() { 39 std::unique_ptr<ui::EventHandler> MagnifierKeyScroller::CreateHandler() {
40 scoped_ptr<KeyHoldDetector::Delegate> delegate(new MagnifierKeyScroller()); 40 std::unique_ptr<KeyHoldDetector::Delegate> delegate(
41 return scoped_ptr<ui::EventHandler>(new KeyHoldDetector(std::move(delegate))); 41 new MagnifierKeyScroller());
42 return std::unique_ptr<ui::EventHandler>(
43 new KeyHoldDetector(std::move(delegate)));
42 } 44 }
43 45
44 bool MagnifierKeyScroller::ShouldProcessEvent(const ui::KeyEvent* event) const { 46 bool MagnifierKeyScroller::ShouldProcessEvent(const ui::KeyEvent* event) const {
45 return IsEnabled() && 47 return IsEnabled() &&
46 (event->key_code() == ui::VKEY_UP || 48 (event->key_code() == ui::VKEY_UP ||
47 event->key_code() == ui::VKEY_DOWN || 49 event->key_code() == ui::VKEY_DOWN ||
48 event->key_code() == ui::VKEY_LEFT || 50 event->key_code() == ui::VKEY_LEFT ||
49 event->key_code() == ui::VKEY_RIGHT); 51 event->key_code() == ui::VKEY_RIGHT);
50 } 52 }
51 53
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 MagnificationController* controller = 85 MagnificationController* controller =
84 Shell::GetInstance()->magnification_controller(); 86 Shell::GetInstance()->magnification_controller();
85 controller->SetScrollDirection(MagnificationController::SCROLL_NONE); 87 controller->SetScrollDirection(MagnificationController::SCROLL_NONE);
86 } 88 }
87 89
88 MagnifierKeyScroller::MagnifierKeyScroller() {} 90 MagnifierKeyScroller::MagnifierKeyScroller() {}
89 91
90 MagnifierKeyScroller::~MagnifierKeyScroller() {} 92 MagnifierKeyScroller::~MagnifierKeyScroller() {}
91 93
92 } // namespace ash 94 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/magnifier_key_scroller.h ('k') | ash/accelerators/magnifier_key_scroller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698