Commit 22724956 authored by dcheng's avatar dcheng Committed by Commit bot

Convert Pass()→std::move() in //ash (CrOS edition)

(╯^□^)╯︵ 

BUG=557422
R=derat@chromium.org

Review URL: https://codereview.chromium.org/1551133002

Cr-Commit-Position: refs/heads/master@{#367223}
parent 955d90dc
...@@ -868,7 +868,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) { ...@@ -868,7 +868,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
{ {
TestVolumeControlDelegate* delegate = new TestVolumeControlDelegate; TestVolumeControlDelegate* delegate = new TestVolumeControlDelegate;
ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate( ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate(
scoped_ptr<VolumeControlDelegate>(delegate).Pass()); scoped_ptr<VolumeControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_volume_mute_count()); EXPECT_EQ(0, delegate->handle_volume_mute_count());
EXPECT_TRUE(ProcessInController(volume_mute)); EXPECT_TRUE(ProcessInController(volume_mute));
EXPECT_EQ(1, delegate->handle_volume_mute_count()); EXPECT_EQ(1, delegate->handle_volume_mute_count());
...@@ -890,7 +890,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) { ...@@ -890,7 +890,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
DummyBrightnessControlDelegate* delegate = DummyBrightnessControlDelegate* delegate =
new DummyBrightnessControlDelegate; new DummyBrightnessControlDelegate;
GetController()->SetBrightnessControlDelegate( GetController()->SetBrightnessControlDelegate(
scoped_ptr<BrightnessControlDelegate>(delegate).Pass()); scoped_ptr<BrightnessControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_brightness_down_count()); EXPECT_EQ(0, delegate->handle_brightness_down_count());
EXPECT_TRUE(ProcessInController(brightness_down)); EXPECT_TRUE(ProcessInController(brightness_down));
EXPECT_EQ(1, delegate->handle_brightness_down_count()); EXPECT_EQ(1, delegate->handle_brightness_down_count());
...@@ -912,7 +912,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) { ...@@ -912,7 +912,7 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) {
DummyKeyboardBrightnessControlDelegate* delegate = DummyKeyboardBrightnessControlDelegate* delegate =
new DummyKeyboardBrightnessControlDelegate; new DummyKeyboardBrightnessControlDelegate;
GetController()->SetKeyboardBrightnessControlDelegate( GetController()->SetKeyboardBrightnessControlDelegate(
scoped_ptr<KeyboardBrightnessControlDelegate>(delegate).Pass()); scoped_ptr<KeyboardBrightnessControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_keyboard_brightness_down_count()); EXPECT_EQ(0, delegate->handle_keyboard_brightness_down_count());
EXPECT_TRUE(ProcessInController(alt_brightness_down)); EXPECT_TRUE(ProcessInController(alt_brightness_down));
EXPECT_EQ(1, delegate->handle_keyboard_brightness_down_count()); EXPECT_EQ(1, delegate->handle_keyboard_brightness_down_count());
...@@ -1146,7 +1146,7 @@ TEST_F(AcceleratorControllerTest, ImeGlobalAccelerators) { ...@@ -1146,7 +1146,7 @@ TEST_F(AcceleratorControllerTest, ImeGlobalAccelerators) {
DummyImeControlDelegate* delegate = new DummyImeControlDelegate; DummyImeControlDelegate* delegate = new DummyImeControlDelegate;
GetController()->SetImeControlDelegate( GetController()->SetImeControlDelegate(
scoped_ptr<ImeControlDelegate>(delegate).Pass()); scoped_ptr<ImeControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_next_ime_count()); EXPECT_EQ(0, delegate->handle_next_ime_count());
EXPECT_FALSE(ProcessInController(shift_alt_press)); EXPECT_FALSE(ProcessInController(shift_alt_press));
EXPECT_TRUE(ProcessInController(shift_alt)); EXPECT_TRUE(ProcessInController(shift_alt));
...@@ -1408,7 +1408,7 @@ TEST_F(AcceleratorControllerTest, DisallowedAtModalWindow) { ...@@ -1408,7 +1408,7 @@ TEST_F(AcceleratorControllerTest, DisallowedAtModalWindow) {
DummyBrightnessControlDelegate* delegate = DummyBrightnessControlDelegate* delegate =
new DummyBrightnessControlDelegate; new DummyBrightnessControlDelegate;
GetController()->SetBrightnessControlDelegate( GetController()->SetBrightnessControlDelegate(
scoped_ptr<BrightnessControlDelegate>(delegate).Pass()); scoped_ptr<BrightnessControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_brightness_down_count()); EXPECT_EQ(0, delegate->handle_brightness_down_count());
EXPECT_TRUE(ProcessInController(brightness_down)); EXPECT_TRUE(ProcessInController(brightness_down));
EXPECT_EQ(1, delegate->handle_brightness_down_count()); EXPECT_EQ(1, delegate->handle_brightness_down_count());
...@@ -1428,7 +1428,7 @@ TEST_F(AcceleratorControllerTest, DisallowedAtModalWindow) { ...@@ -1428,7 +1428,7 @@ TEST_F(AcceleratorControllerTest, DisallowedAtModalWindow) {
EXPECT_TRUE(ProcessInController(volume_up)); EXPECT_TRUE(ProcessInController(volume_up));
TestVolumeControlDelegate* delegate = new TestVolumeControlDelegate; TestVolumeControlDelegate* delegate = new TestVolumeControlDelegate;
ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate( ash::Shell::GetInstance()->system_tray_delegate()->SetVolumeControlDelegate(
scoped_ptr<VolumeControlDelegate>(delegate).Pass()); scoped_ptr<VolumeControlDelegate>(delegate));
EXPECT_EQ(0, delegate->handle_volume_mute_count()); EXPECT_EQ(0, delegate->handle_volume_mute_count());
EXPECT_TRUE(ProcessInController(volume_mute)); EXPECT_TRUE(ProcessInController(volume_mute));
EXPECT_EQ(1, delegate->handle_volume_mute_count()); EXPECT_EQ(1, delegate->handle_volume_mute_count());
...@@ -1495,7 +1495,7 @@ class DeprecatedAcceleratorTester : public AcceleratorControllerTest { ...@@ -1495,7 +1495,7 @@ class DeprecatedAcceleratorTester : public AcceleratorControllerTest {
// For testing the deprecated and new IME shortcuts. // For testing the deprecated and new IME shortcuts.
DummyImeControlDelegate* delegate = new DummyImeControlDelegate; DummyImeControlDelegate* delegate = new DummyImeControlDelegate;
GetController()->SetImeControlDelegate( GetController()->SetImeControlDelegate(
scoped_ptr<ImeControlDelegate>(delegate).Pass()); scoped_ptr<ImeControlDelegate>(delegate));
} }
ui::Accelerator CreateAccelerator(const AcceleratorData& data) const { ui::Accelerator CreateAccelerator(const AcceleratorData& data) const {
......
...@@ -94,7 +94,7 @@ TEST_F(AcceleratorFilterTest, CanConsumeSystemKeys) { ...@@ -94,7 +94,7 @@ TEST_F(AcceleratorFilterTest, CanConsumeSystemKeys) {
scoped_ptr<ui::AcceleratorHistory> scoped_ptr<ui::AcceleratorHistory>
accelerator_history(new ui::AcceleratorHistory()); accelerator_history(new ui::AcceleratorHistory());
::wm::AcceleratorFilter filter( ::wm::AcceleratorFilter filter(
scoped_ptr< ::wm::AcceleratorDelegate>(new AcceleratorDelegate).Pass(), scoped_ptr<::wm::AcceleratorDelegate>(new AcceleratorDelegate),
accelerator_history.get()); accelerator_history.get());
aura::Window* root_window = Shell::GetPrimaryRootWindow(); aura::Window* root_window = Shell::GetPrimaryRootWindow();
......
...@@ -168,7 +168,7 @@ TEST_F(AcceleratorInteractiveUITest, MAYBE_ChromeOsAccelerators) { ...@@ -168,7 +168,7 @@ TEST_F(AcceleratorInteractiveUITest, MAYBE_ChromeOsAccelerators) {
// Test VOLUME_MUTE, VOLUME_DOWN, and VOLUME_UP. // Test VOLUME_MUTE, VOLUME_DOWN, and VOLUME_UP.
TestVolumeControlDelegate* volume_delegate = new TestVolumeControlDelegate; TestVolumeControlDelegate* volume_delegate = new TestVolumeControlDelegate;
shell()->system_tray_delegate()->SetVolumeControlDelegate( shell()->system_tray_delegate()->SetVolumeControlDelegate(
scoped_ptr<VolumeControlDelegate>(volume_delegate).Pass()); scoped_ptr<VolumeControlDelegate>(volume_delegate));
// VOLUME_MUTE. // VOLUME_MUTE.
EXPECT_EQ(0, volume_delegate->handle_volume_mute_count()); EXPECT_EQ(0, volume_delegate->handle_volume_mute_count());
SendKeyPressSync(ui::VKEY_VOLUME_MUTE, false, false, false); SendKeyPressSync(ui::VKEY_VOLUME_MUTE, false, false, false);
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/accelerators/key_hold_detector.h" #include "ash/accelerators/key_hold_detector.h"
#include <utility>
#include "ash/shell.h" #include "ash/shell.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "ui/aura/window_tracker.h" #include "ui/aura/window_tracker.h"
...@@ -43,8 +45,7 @@ void PostPressedEvent(ui::KeyEvent* event) { ...@@ -43,8 +45,7 @@ void PostPressedEvent(ui::KeyEvent* event) {
} // namespace } // namespace
KeyHoldDetector::KeyHoldDetector(scoped_ptr<Delegate> delegate) KeyHoldDetector::KeyHoldDetector(scoped_ptr<Delegate> delegate)
: state_(INITIAL), : state_(INITIAL), delegate_(std::move(delegate)) {}
delegate_(delegate.Pass()) {}
KeyHoldDetector::~KeyHoldDetector() {} KeyHoldDetector::~KeyHoldDetector() {}
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/accelerators/magnifier_key_scroller.h" #include "ash/accelerators/magnifier_key_scroller.h"
#include <utility>
#include "ash/accelerators/key_hold_detector.h" #include "ash/accelerators/key_hold_detector.h"
#include "ash/ash_switches.h" #include "ash/ash_switches.h"
#include "ash/magnifier/magnification_controller.h" #include "ash/magnifier/magnification_controller.h"
...@@ -36,7 +38,7 @@ void MagnifierKeyScroller::SetEnabled(bool enabled) { ...@@ -36,7 +38,7 @@ void MagnifierKeyScroller::SetEnabled(bool enabled) {
// static // static
scoped_ptr<ui::EventHandler> MagnifierKeyScroller::CreateHandler() { scoped_ptr<ui::EventHandler> MagnifierKeyScroller::CreateHandler() {
scoped_ptr<KeyHoldDetector::Delegate> delegate(new MagnifierKeyScroller()); scoped_ptr<KeyHoldDetector::Delegate> delegate(new MagnifierKeyScroller());
return scoped_ptr<ui::EventHandler>(new KeyHoldDetector(delegate.Pass())); return scoped_ptr<ui::EventHandler>(new KeyHoldDetector(std::move(delegate)));
} }
bool MagnifierKeyScroller::ShouldProcessEvent(const ui::KeyEvent* event) const { bool MagnifierKeyScroller::ShouldProcessEvent(const ui::KeyEvent* event) const {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/accelerators/spoken_feedback_toggler.h" #include "ash/accelerators/spoken_feedback_toggler.h"
#include <utility>
#include "ash/accelerators/key_hold_detector.h" #include "ash/accelerators/key_hold_detector.h"
#include "ash/accessibility_delegate.h" #include "ash/accessibility_delegate.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -27,7 +29,7 @@ void SpokenFeedbackToggler::SetEnabled(bool enabled) { ...@@ -27,7 +29,7 @@ void SpokenFeedbackToggler::SetEnabled(bool enabled) {
// static // static
scoped_ptr<ui::EventHandler> SpokenFeedbackToggler::CreateHandler() { scoped_ptr<ui::EventHandler> SpokenFeedbackToggler::CreateHandler() {
scoped_ptr<KeyHoldDetector::Delegate> delegate(new SpokenFeedbackToggler()); scoped_ptr<KeyHoldDetector::Delegate> delegate(new SpokenFeedbackToggler());
return scoped_ptr<ui::EventHandler>(new KeyHoldDetector(delegate.Pass())); return scoped_ptr<ui::EventHandler>(new KeyHoldDetector(std::move(delegate)));
} }
bool SpokenFeedbackToggler::ShouldProcessEvent( bool SpokenFeedbackToggler::ShouldProcessEvent(
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/display/display_color_manager_chromeos.h" #include "ash/display/display_color_manager_chromeos.h"
#include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/command_line.h" #include "base/command_line.h"
...@@ -129,7 +131,7 @@ void DisplayColorManager::LoadCalibrationForDisplay( ...@@ -129,7 +131,7 @@ void DisplayColorManager::LoadCalibrationForDisplay(
blocking_pool_, FROM_HERE, request, blocking_pool_, FROM_HERE, request,
base::Bind(&DisplayColorManager::UpdateCalibrationData, AsWeakPtr(), base::Bind(&DisplayColorManager::UpdateCalibrationData, AsWeakPtr(),
display->display_id(), display->product_id(), display->display_id(), display->product_id(),
base::Passed(data.Pass()))); base::Passed(std::move(data))));
} }
void DisplayColorManager::UpdateCalibrationData( void DisplayColorManager::UpdateCalibrationData(
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/display/display_error_observer_chromeos.h" #include "ash/display/display_error_observer_chromeos.h"
#include <utility>
#include "ash/system/system_notifier.h" #include "ash/system/system_notifier.h"
#include "grit/ash_resources.h" #include "grit/ash_resources.h"
#include "grit/ash_strings.h" #include "grit/ash_strings.h"
...@@ -52,7 +54,8 @@ void DisplayErrorObserver::OnDisplayModeChangeFailed( ...@@ -52,7 +54,8 @@ void DisplayErrorObserver::OnDisplayModeChangeFailed(
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
system_notifier::kNotifierDisplayError), system_notifier::kNotifierDisplayError),
message_center::RichNotificationData(), NULL)); message_center::RichNotificationData(), NULL));
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
base::string16 base::string16
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/display/resolution_notification_controller.h" #include "ash/display/resolution_notification_controller.h"
#include <utility>
#include "ash/display/display_info.h" #include "ash/display/display_info.h"
#include "ash/display/display_manager.h" #include "ash/display/display_manager.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -235,7 +237,7 @@ void ResolutionNotificationController::CreateOrUpdateNotification( ...@@ -235,7 +237,7 @@ void ResolutionNotificationController::CreateOrUpdateNotification(
data, new ResolutionChangeNotificationDelegate( data, new ResolutionChangeNotificationDelegate(
this, change_info_->timeout_count > 0))); this, change_info_->timeout_count > 0)));
notification->SetSystemPriority(); notification->SetSystemPriority();
message_center->AddNotification(notification.Pass()); message_center->AddNotification(std::move(notification));
} }
void ResolutionNotificationController::OnTimerTick() { void ResolutionNotificationController::OnTimerTick() {
......
...@@ -1062,7 +1062,7 @@ void Shell::Init(const ShellInitParams& init_params) { ...@@ -1062,7 +1062,7 @@ void Shell::Init(const ShellInitParams& init_params) {
// Set accelerator controller delegates. // Set accelerator controller delegates.
accelerator_controller_->SetBrightnessControlDelegate( accelerator_controller_->SetBrightnessControlDelegate(
scoped_ptr<ash::BrightnessControlDelegate>( scoped_ptr<ash::BrightnessControlDelegate>(
new ash::system::BrightnessControllerChromeos).Pass()); new ash::system::BrightnessControllerChromeos));
power_event_observer_.reset(new PowerEventObserver()); power_event_observer_.reset(new PowerEventObserver());
user_activity_notifier_.reset( user_activity_notifier_.reset(
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h" #include "ash/system/chromeos/bluetooth/bluetooth_notification_controller.h"
#include <utility>
#include "ash/system/system_notifier.h" #include "ash/system/system_notifier.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
...@@ -283,7 +285,8 @@ void BluetoothNotificationController::NotifyAdapterDiscoverable() { ...@@ -283,7 +285,8 @@ void BluetoothNotificationController::NotifyAdapterDiscoverable() {
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
system_notifier::kNotifierBluetooth), system_notifier::kNotifierBluetooth),
optional, NULL)); optional, NULL));
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
void BluetoothNotificationController::NotifyPairing( void BluetoothNotificationController::NotifyPairing(
...@@ -311,7 +314,8 @@ void BluetoothNotificationController::NotifyPairing( ...@@ -311,7 +314,8 @@ void BluetoothNotificationController::NotifyPairing(
system_notifier::kNotifierBluetooth), system_notifier::kNotifierBluetooth),
optional, new BluetoothPairingNotificationDelegate( optional, new BluetoothPairingNotificationDelegate(
adapter_, device->GetAddress()))); adapter_, device->GetAddress())));
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
void BluetoothNotificationController::NotifyPairedDevice( void BluetoothNotificationController::NotifyPairedDevice(
...@@ -336,7 +340,8 @@ void BluetoothNotificationController::NotifyPairedDevice( ...@@ -336,7 +340,8 @@ void BluetoothNotificationController::NotifyPairedDevice(
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
system_notifier::kNotifierBluetooth), system_notifier::kNotifierBluetooth),
optional, NULL)); optional, NULL));
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
} // namespace ash } // namespace ash
...@@ -94,8 +94,7 @@ BatteryNotification::BatteryNotification( ...@@ -94,8 +94,7 @@ BatteryNotification::BatteryNotification(
MessageCenter* message_center, MessageCenter* message_center,
TrayPower::NotificationState notification_state) TrayPower::NotificationState notification_state)
: message_center_(message_center) { : message_center_(message_center) {
message_center_->AddNotification( message_center_->AddNotification(CreateNotification(notification_state));
CreateNotification(notification_state).Pass());
} }
BatteryNotification::~BatteryNotification() { BatteryNotification::~BatteryNotification() {
...@@ -106,8 +105,8 @@ BatteryNotification::~BatteryNotification() { ...@@ -106,8 +105,8 @@ BatteryNotification::~BatteryNotification() {
void BatteryNotification::Update( void BatteryNotification::Update(
TrayPower::NotificationState notification_state) { TrayPower::NotificationState notification_state) {
if (message_center_->FindVisibleNotificationById(kBatteryNotificationId)) { if (message_center_->FindVisibleNotificationById(kBatteryNotificationId)) {
message_center_->UpdateNotification( message_center_->UpdateNotification(kBatteryNotificationId,
kBatteryNotificationId, CreateNotification(notification_state).Pass()); CreateNotification(notification_state));
} }
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/system/chromeos/power/tray_power.h" #include "ash/system/chromeos/power/tray_power.h"
#include <utility>
#include "ash/accessibility_delegate.h" #include "ash/accessibility_delegate.h"
#include "ash/ash_switches.h" #include "ash/ash_switches.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -230,7 +232,7 @@ bool TrayPower::MaybeShowUsbChargerNotification() { ...@@ -230,7 +232,7 @@ bool TrayPower::MaybeShowUsbChargerNotification() {
system_notifier::kNotifierPower), system_notifier::kNotifierPower),
message_center::RichNotificationData(), message_center::RichNotificationData(),
new UsbNotificationDelegate(this))); new UsbNotificationDelegate(this)));
message_center_->AddNotification(notification.Pass()); message_center_->AddNotification(std::move(notification));
return true; return true;
} else if (!usb_charger_is_connected && usb_charger_was_connected_) { } else if (!usb_charger_is_connected && usb_charger_was_connected_) {
// USB charger was unplugged or was identified as a different type while // USB charger was unplugged or was identified as a different type while
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/system/chromeos/screen_security/screen_capture_tray_item.h" #include "ash/system/chromeos/screen_security/screen_capture_tray_item.h"
#include <utility>
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/system_notifier.h" #include "ash/system/system_notifier.h"
#include "grit/ash_resources.h" #include "grit/ash_resources.h"
...@@ -66,7 +68,8 @@ void ScreenCaptureTrayItem::CreateOrUpdateNotification() { ...@@ -66,7 +68,8 @@ void ScreenCaptureTrayItem::CreateOrUpdateNotification() {
system_notifier::kNotifierScreenCapture), system_notifier::kNotifierScreenCapture),
data, new tray::ScreenNotificationDelegate(this))); data, new tray::ScreenNotificationDelegate(this)));
notification->SetSystemPriority(); notification->SetSystemPriority();
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
std::string ScreenCaptureTrayItem::GetNotificationId() { std::string ScreenCaptureTrayItem::GetNotificationId() {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/system/chromeos/screen_security/screen_share_tray_item.h" #include "ash/system/chromeos/screen_security/screen_share_tray_item.h"
#include <utility>
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/system_notifier.h" #include "ash/system/system_notifier.h"
#include "grit/ash_resources.h" #include "grit/ash_resources.h"
...@@ -74,7 +76,8 @@ void ScreenShareTrayItem::CreateOrUpdateNotification() { ...@@ -74,7 +76,8 @@ void ScreenShareTrayItem::CreateOrUpdateNotification() {
system_notifier::kNotifierScreenShare), system_notifier::kNotifierScreenShare),
data, new tray::ScreenNotificationDelegate(this))); data, new tray::ScreenNotificationDelegate(this)));
notification->SetSystemPriority(); notification->SetSystemPriority();
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
std::string ScreenShareTrayItem::GetNotificationId() { std::string ScreenShareTrayItem::GetNotificationId() {
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/system/chromeos/session/logout_button_tray.h" #include "ash/system/chromeos/session/logout_button_tray.h"
#include <utility>
#include "ash/shelf/shelf_types.h" #include "ash/shelf/shelf_types.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/chromeos/session/logout_confirmation_controller.h" #include "ash/system/chromeos/session/logout_confirmation_controller.h"
...@@ -83,7 +85,7 @@ LogoutButton::LogoutButton(views::ButtonListener* listener) ...@@ -83,7 +85,7 @@ LogoutButton::LogoutButton(views::ButtonListener* listener)
insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding, insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding,
0, kLogoutButtonHorizontalExtraPadding); 0, kLogoutButtonHorizontalExtraPadding);
border->set_insets(insets); border->set_insets(insets);
SetBorder(border.Pass()); SetBorder(std::move(border));
set_animate_on_state_change(false); set_animate_on_state_change(false);
SetMinSize(gfx::Size(0, kShelfItemHeight)); SetMinSize(gfx::Size(0, kShelfItemHeight));
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/system/chromeos/session/logout_confirmation_controller.h" #include "ash/system/chromeos/session/logout_confirmation_controller.h"
#include <utility>
#include "ash/session/session_state_delegate.h" #include "ash/session/session_state_delegate.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/chromeos/session/logout_confirmation_dialog.h" #include "ash/system/chromeos/session/logout_confirmation_dialog.h"
...@@ -56,7 +58,7 @@ void LogoutConfirmationController::ConfirmLogout( ...@@ -56,7 +58,7 @@ void LogoutConfirmationController::ConfirmLogout(
void LogoutConfirmationController::SetClockForTesting( void LogoutConfirmationController::SetClockForTesting(
scoped_ptr<base::TickClock> clock) { scoped_ptr<base::TickClock> clock) {
clock_ = clock.Pass(); clock_ = std::move(clock);
} }
void LogoutConfirmationController::OnLockStateChanged(bool locked) { void LogoutConfirmationController::OnLockStateChanged(bool locked) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "ash/system/chromeos/session/tray_session_length_limit.h" #include "ash/system/chromeos/session/tray_session_length_limit.h"
#include <algorithm> #include <algorithm>
#include <utility>
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/chromeos/label_tray_view.h" #include "ash/system/chromeos/label_tray_view.h"
...@@ -161,9 +162,10 @@ void TraySessionLengthLimit::UpdateNotification() { ...@@ -161,9 +162,10 @@ void TraySessionLengthLimit::UpdateNotification() {
data, NULL /* delegate */)); data, NULL /* delegate */));
notification->SetSystemPriority(); notification->SetSystemPriority();
if (message_center->FindVisibleNotificationById(kNotificationId)) if (message_center->FindVisibleNotificationById(kNotificationId))
message_center->UpdateNotification(kNotificationId, notification.Pass()); message_center->UpdateNotification(kNotificationId,
std::move(notification));
else else
message_center->AddNotification(notification.Pass()); message_center->AddNotification(std::move(notification));
last_limit_state_ = limit_state_; last_limit_state_ = limit_state_;
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/system/chromeos/supervised/tray_supervised_user.h" #include "ash/system/chromeos/supervised/tray_supervised_user.h"
#include <utility>
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/chromeos/label_tray_view.h" #include "ash/system/chromeos/label_tray_view.h"
#include "ash/system/system_notifier.h" #include "ash/system/system_notifier.h"
...@@ -100,7 +102,8 @@ void TraySupervisedUser::CreateOrUpdateNotification( ...@@ -100,7 +102,8 @@ void TraySupervisedUser::CreateOrUpdateNotification(
bundle.GetImageNamed(GetSupervisedUserIconId()), bundle.GetImageNamed(GetSupervisedUserIconId()),
system_notifier::kNotifierSupervisedUser, system_notifier::kNotifierSupervisedUser,
base::Closure() /* null callback */)); base::Closure() /* null callback */));
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
void TraySupervisedUser::CreateOrUpdateSupervisedWarningNotification() { void TraySupervisedUser::CreateOrUpdateSupervisedWarningNotification() {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "ash/system/chromeos/tray_display.h" #include "ash/system/chromeos/tray_display.h"
#include <utility>
#include <vector> #include <vector>
#include "ash/display/display_manager.h" #include "ash/display/display_manager.h"
...@@ -401,7 +402,8 @@ void TrayDisplay::CreateOrUpdateNotification( ...@@ -401,7 +402,8 @@ void TrayDisplay::CreateOrUpdateNotification(
new message_center::HandleNotificationClickedDelegate( new message_center::HandleNotificationClickedDelegate(
base::Bind(&OpenSettings)))); base::Bind(&OpenSettings))));
message_center::MessageCenter::Get()->AddNotification(notification.Pass()); message_center::MessageCenter::Get()->AddNotification(
std::move(notification));
} }
views::View* TrayDisplay::CreateDefaultView(user::LoginStatus status) { views::View* TrayDisplay::CreateDefaultView(user::LoginStatus status) {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "ash/virtual_keyboard_controller.h" #include "ash/virtual_keyboard_controller.h"
#include <utility>
#include <vector> #include <vector>
#include "ash/shell.h" #include "ash/shell.h"
...@@ -47,7 +48,7 @@ class VirtualKeyboardControllerTest : public AshTestBase { ...@@ -47,7 +48,7 @@ class VirtualKeyboardControllerTest : public AshTestBase {
void SetEventBlocker( void SetEventBlocker(
scoped_ptr<ScopedDisableInternalMouseAndKeyboard> blocker) { scoped_ptr<ScopedDisableInternalMouseAndKeyboard> blocker) {
Shell::GetInstance()->maximize_mode_controller()->event_blocker_ = Shell::GetInstance()->maximize_mode_controller()->event_blocker_ =
blocker.Pass(); std::move(blocker);
} }
void SetUp() override { void SetUp() override {
...@@ -103,7 +104,7 @@ TEST_F(VirtualKeyboardControllerTest, RestoreKeyboardDevices) { ...@@ -103,7 +104,7 @@ TEST_F(VirtualKeyboardControllerTest, RestoreKeyboardDevices) {
->EnableMaximizeModeWindowManager(true); ->EnableMaximizeModeWindowManager(true);
scoped_ptr<ScopedDisableInternalMouseAndKeyboard> blocker( scoped_ptr<ScopedDisableInternalMouseAndKeyboard> blocker(
new MockEventBlocker); new MockEventBlocker);
SetEventBlocker(blocker.Pass()); SetEventBlocker(std::move(blocker));
} }
class VirtualKeyboardControllerAutoTest : public VirtualKeyboardControllerTest, class VirtualKeyboardControllerAutoTest : public VirtualKeyboardControllerTest,
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "ash/wm/cursor_manager_chromeos.h" #include "ash/wm/cursor_manager_chromeos.h"
#include <utility>
#include "base/logging.h" #include "base/logging.h"
#include "ui/events/event.h" #include "ui/events/event.h"
#include "ui/keyboard/keyboard_util.h" #include "ui/keyboard/keyboard_util.h"
...@@ -12,10 +14,8 @@ ...@@ -12,10 +14,8 @@
namespace ash { namespace ash {
CursorManager::CursorManager( CursorManager::CursorManager(scoped_ptr<::wm::NativeCursorManager> delegate)
scoped_ptr< ::wm::NativeCursorManager> delegate) : ::wm::CursorManager(std::move(delegate)) {}
: ::wm::CursorManager(delegate.Pass()) {
}
CursorManager::~CursorManager() { CursorManager::~CursorManager() {
} }
......
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include <math.h> #include <math.h>
#include <utility>
#include <vector> #include <vector>
#include "ash/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/ash_switches.h" #include "ash/ash_switches.h"
#include "ash/display/display_manager.h" #include "ash/display/display_manager.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -120,7 +121,7 @@ class MaximizeModeControllerTest : public test::AshTestBase { ...@@ -120,7 +121,7 @@ class MaximizeModeControllerTest : public test::AshTestBase {
scoped_ptr<base::TickClock> tick_clock( scoped_ptr<base::TickClock> tick_clock(
test_tick_clock_ = new base::SimpleTestTickClock()); test_tick_clock_ = new base::SimpleTestTickClock());
test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1)); test_tick_clock_->Advance(base::TimeDelta::FromSeconds(1));
maximize_mode_controller()->SetTickClockForTest(tick_clock.Pass()); maximize_mode_controller()->SetTickClockForTest(std::move(tick_clock));
} }
void AdvanceTickClock(const base::TimeDelta& delta) { void AdvanceTickClock(const base::TimeDelta& delta) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment