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

Side by Side Diff: ash/accelerators/accelerator_controller.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 (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 <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 return l10n_util::GetStringFUTF16(message_id, new_shortcut, old_shortcut); 155 return l10n_util::GetStringFUTF16(message_id, new_shortcut, old_shortcut);
156 } 156 }
157 157
158 void ShowDeprecatedAcceleratorNotification(const char* const notification_id, 158 void ShowDeprecatedAcceleratorNotification(const char* const notification_id,
159 int message_id, 159 int message_id,
160 int old_shortcut_id, 160 int old_shortcut_id,
161 int new_shortcut_id) { 161 int new_shortcut_id) {
162 const base::string16 message = 162 const base::string16 message =
163 GetNotificationText(message_id, old_shortcut_id, new_shortcut_id); 163 GetNotificationText(message_id, old_shortcut_id, new_shortcut_id);
164 scoped_ptr<message_center::Notification> notification( 164 std::unique_ptr<message_center::Notification> notification(
165 new message_center::Notification( 165 new message_center::Notification(
166 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, 166 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id,
167 base::string16(), message, 167 base::string16(), message,
168 Shell::GetInstance()->delegate()->GetDeprecatedAcceleratorImage(), 168 Shell::GetInstance()->delegate()->GetDeprecatedAcceleratorImage(),
169 base::string16(), GURL(), 169 base::string16(), GURL(),
170 message_center::NotifierId( 170 message_center::NotifierId(
171 message_center::NotifierId::SYSTEM_COMPONENT, 171 message_center::NotifierId::SYSTEM_COMPONENT,
172 system_notifier::kNotifierDeprecatedAccelerator), 172 system_notifier::kNotifierDeprecatedAccelerator),
173 message_center::RichNotificationData(), 173 message_center::RichNotificationData(),
174 new DeprecatedAcceleratorNotificationDelegate)); 174 new DeprecatedAcceleratorNotificationDelegate));
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 } 812 }
813 return false; 813 return false;
814 } 814 }
815 815
816 AcceleratorController::AcceleratorProcessingRestriction 816 AcceleratorController::AcceleratorProcessingRestriction
817 AcceleratorController::GetCurrentAcceleratorRestriction() { 817 AcceleratorController::GetCurrentAcceleratorRestriction() {
818 return GetAcceleratorProcessingRestriction(-1); 818 return GetAcceleratorProcessingRestriction(-1);
819 } 819 }
820 820
821 void AcceleratorController::SetBrightnessControlDelegate( 821 void AcceleratorController::SetBrightnessControlDelegate(
822 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate) { 822 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate) {
823 brightness_control_delegate_ = std::move(brightness_control_delegate); 823 brightness_control_delegate_ = std::move(brightness_control_delegate);
824 } 824 }
825 825
826 void AcceleratorController::SetImeControlDelegate( 826 void AcceleratorController::SetImeControlDelegate(
827 scoped_ptr<ImeControlDelegate> ime_control_delegate) { 827 std::unique_ptr<ImeControlDelegate> ime_control_delegate) {
828 ime_control_delegate_ = std::move(ime_control_delegate); 828 ime_control_delegate_ = std::move(ime_control_delegate);
829 } 829 }
830 830
831 void AcceleratorController::SetScreenshotDelegate( 831 void AcceleratorController::SetScreenshotDelegate(
832 scoped_ptr<ScreenshotDelegate> screenshot_delegate) { 832 std::unique_ptr<ScreenshotDelegate> screenshot_delegate) {
833 screenshot_delegate_ = std::move(screenshot_delegate); 833 screenshot_delegate_ = std::move(screenshot_delegate);
834 } 834 }
835 835
836 bool AcceleratorController::ShouldCloseMenuAndRepostAccelerator( 836 bool AcceleratorController::ShouldCloseMenuAndRepostAccelerator(
837 const ui::Accelerator& accelerator) const { 837 const ui::Accelerator& accelerator) const {
838 auto itr = accelerators_.find(accelerator); 838 auto itr = accelerators_.find(accelerator);
839 if (itr == accelerators_.end()) 839 if (itr == accelerators_.end())
840 return false; // Menu shouldn't be closed for an invalid accelerator. 840 return false; // Menu shouldn't be closed for an invalid accelerator.
841 841
842 AcceleratorAction action = itr->second; 842 AcceleratorAction action = itr->second;
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 if (shell->mru_window_tracker()->BuildMruWindowList().empty() && 1423 if (shell->mru_window_tracker()->BuildMruWindowList().empty() &&
1424 actions_needing_window_.find(action) != actions_needing_window_.end()) { 1424 actions_needing_window_.find(action) != actions_needing_window_.end()) {
1425 Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert( 1425 Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
1426 ui::A11Y_ALERT_WINDOW_NEEDED); 1426 ui::A11Y_ALERT_WINDOW_NEEDED);
1427 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; 1427 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
1428 } 1428 }
1429 return RESTRICTION_NONE; 1429 return RESTRICTION_NONE;
1430 } 1430 }
1431 1431
1432 void AcceleratorController::SetKeyboardBrightnessControlDelegate( 1432 void AcceleratorController::SetKeyboardBrightnessControlDelegate(
1433 scoped_ptr<KeyboardBrightnessControlDelegate> 1433 std::unique_ptr<KeyboardBrightnessControlDelegate>
1434 keyboard_brightness_control_delegate) { 1434 keyboard_brightness_control_delegate) {
1435 keyboard_brightness_control_delegate_ = 1435 keyboard_brightness_control_delegate_ =
1436 std::move(keyboard_brightness_control_delegate); 1436 std::move(keyboard_brightness_control_delegate);
1437 } 1437 }
1438 1438
1439 } // namespace ash 1439 } // 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