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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 517103003: Aura: Don't activate menus and other non-activatable widgets on drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 return last_drop_operation_; 1133 return last_drop_operation_;
1134 } 1134 }
1135 1135
1136 void DesktopNativeWidgetAura::OnDragExited() { 1136 void DesktopNativeWidgetAura::OnDragExited() {
1137 DCHECK(drop_helper_.get() != NULL); 1137 DCHECK(drop_helper_.get() != NULL);
1138 drop_helper_->OnDragExit(); 1138 drop_helper_->OnDragExit();
1139 } 1139 }
1140 1140
1141 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { 1141 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) {
1142 DCHECK(drop_helper_.get() != NULL); 1142 DCHECK(drop_helper_.get() != NULL);
1143 Activate(); 1143 if (ShouldActivate())
1144 Activate();
1144 return drop_helper_->OnDrop(event.data(), event.location(), 1145 return drop_helper_->OnDrop(event.data(), event.location(),
1145 last_drop_operation_); 1146 last_drop_operation_);
1146 } 1147 }
1147 1148
1148 //////////////////////////////////////////////////////////////////////////////// 1149 ////////////////////////////////////////////////////////////////////////////////
1149 // DesktopNativeWidgetAura, aura::WindowTreeHostObserver implementation: 1150 // DesktopNativeWidgetAura, aura::WindowTreeHostObserver implementation:
1150 1151
1151 void DesktopNativeWidgetAura::OnHostCloseRequested( 1152 void DesktopNativeWidgetAura::OnHostCloseRequested(
1152 const aura::WindowTreeHost* host) { 1153 const aura::WindowTreeHost* host) {
1153 GetWidget()->Close(); 1154 GetWidget()->Close();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 if (cursor_reference_count_ == 0) { 1204 if (cursor_reference_count_ == 0) {
1204 // We are the last DesktopNativeWidgetAura instance, and we are responsible 1205 // We are the last DesktopNativeWidgetAura instance, and we are responsible
1205 // for cleaning up |cursor_manager_|. 1206 // for cleaning up |cursor_manager_|.
1206 delete cursor_manager_; 1207 delete cursor_manager_;
1207 native_cursor_manager_ = NULL; 1208 native_cursor_manager_ = NULL;
1208 cursor_manager_ = NULL; 1209 cursor_manager_ = NULL;
1209 } 1210 }
1210 } 1211 }
1211 1212
1212 } // namespace views 1213 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698