| Index: ash/drag_drop/drag_drop_controller.cc
|
| diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
|
| index 4a2603f05309c9bef34dc3df07db606225f6e5a9..f50f4f4e75169d7710d795dc7946d25f5cc026a0 100644
|
| --- a/ash/drag_drop/drag_drop_controller.cc
|
| +++ b/ash/drag_drop/drag_drop_controller.cc
|
| @@ -246,11 +246,12 @@ int DragDropController::StartDragAndDrop(
|
|
|
| void DragDropController::DragUpdate(aura::Window* target,
|
| const ui::LocatedEvent& event) {
|
| - aura::client::DragDropDelegate* delegate = NULL;
|
| int op = ui::DragDropTypes::DRAG_NONE;
|
| if (target != drag_window_) {
|
| if (drag_window_) {
|
| - if ((delegate = aura::client::GetDragDropDelegate(drag_window_)))
|
| + aura::client::DragDropDelegate* delegate =
|
| + aura::client::GetDragDropDelegate(drag_window_);
|
| + if (delegate)
|
| delegate->OnDragExited();
|
| if (drag_window_ != drag_source_window_)
|
| drag_window_->RemoveObserver(this);
|
| @@ -259,7 +260,9 @@ void DragDropController::DragUpdate(aura::Window* target,
|
| // We are already an observer of |drag_source_window_| so no need to add.
|
| if (drag_window_ != drag_source_window_)
|
| drag_window_->AddObserver(this);
|
| - if ((delegate = aura::client::GetDragDropDelegate(drag_window_))) {
|
| + aura::client::DragDropDelegate* delegate =
|
| + aura::client::GetDragDropDelegate(drag_window_);
|
| + if (delegate) {
|
| ui::DropTargetEvent e(*drag_data_,
|
| event.location(),
|
| event.root_location(),
|
| @@ -268,7 +271,9 @@ void DragDropController::DragUpdate(aura::Window* target,
|
| delegate->OnDragEntered(e);
|
| }
|
| } else {
|
| - if ((delegate = aura::client::GetDragDropDelegate(drag_window_))) {
|
| + aura::client::DragDropDelegate* delegate =
|
| + aura::client::GetDragDropDelegate(drag_window_);
|
| + if (delegate) {
|
| ui::DropTargetEvent e(*drag_data_,
|
| event.location(),
|
| event.root_location(),
|
| @@ -300,7 +305,6 @@ void DragDropController::DragUpdate(aura::Window* target,
|
| void DragDropController::Drop(aura::Window* target,
|
| const ui::LocatedEvent& event) {
|
| ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorPointer);
|
| - aura::client::DragDropDelegate* delegate = NULL;
|
|
|
| // We must guarantee that a target gets a OnDragEntered before Drop. WebKit
|
| // depends on not getting a Drop without DragEnter. This behavior is
|
| @@ -309,7 +313,9 @@ void DragDropController::Drop(aura::Window* target,
|
| DragUpdate(target, event);
|
| DCHECK(target == drag_window_);
|
|
|
| - if ((delegate = aura::client::GetDragDropDelegate(target))) {
|
| + aura::client::DragDropDelegate* delegate =
|
| + aura::client::GetDragDropDelegate(target);
|
| + if (delegate) {
|
| ui::DropTargetEvent e(
|
| *drag_data_, event.location(), event.root_location(), drag_operation_);
|
| e.set_flags(event.flags());
|
|
|