summaryrefslogtreecommitdiffstats
path: root/ash/drag_drop
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 01:40:47 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 01:40:47 +0000
commit481c3e82e2dcbcb676501f18bc8f58900071b935 (patch)
treeb41b70589f0b082edffa7322b1c06af23c4b32bc /ash/drag_drop
parentcf85b9ad701b8363e3d1d54d54390dcdf4a45291 (diff)
downloadchromium_src-481c3e82e2dcbcb676501f18bc8f58900071b935.zip
chromium_src-481c3e82e2dcbcb676501f18bc8f58900071b935.tar.gz
chromium_src-481c3e82e2dcbcb676501f18bc8f58900071b935.tar.bz2
Fixes for re-enabling more MSVC level 4 warnings: misc edition #2
This contains fixes for the following sorts of issues: * Assignment inside conditional * Taking the address of a temporary * Octal escape sequence terminated by decimal number * Signedness mismatch * Possibly-uninitialized local variable This also contains a small number of cleanups to nearby code (e.g. no else after return). BUG=81439 TEST=none Review URL: https://codereview.chromium.org/382673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/drag_drop')
-rw-r--r--ash/drag_drop/drag_drop_controller.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index b1a4289..2ff526f 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -244,11 +244,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);
@@ -257,7 +258,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(),
@@ -266,7 +269,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(),
@@ -298,7 +303,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
@@ -307,7 +311,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());