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

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

Issue 1964283002: MacViews: Implemented Drag & Drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "ui/views/widget/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 dragged_view_ = view; 774 dragged_view_ = view;
775 OnDragWillStart(); 775 OnDragWillStart();
776 776
777 WidgetDeletionObserver widget_deletion_observer(this); 777 WidgetDeletionObserver widget_deletion_observer(this);
778 native_widget_->RunShellDrag(view, data, location, operation, source); 778 native_widget_->RunShellDrag(view, data, location, operation, source);
779 779
780 // The widget may be destroyed during the drag operation. 780 // The widget may be destroyed during the drag operation.
781 if (!widget_deletion_observer.IsWidgetAlive()) 781 if (!widget_deletion_observer.IsWidgetAlive())
782 return; 782 return;
783 783
784 // If the view is removed during the drag operation, dragged_view_ is set to 784 #if !defined(OS_MACOSX)
785 // NULL. 785 DraggingEnded(view);
tapted 2016/05/26 12:31:42 Hm - x11 spins its own runloop to "force" it to be
786 if (view && dragged_view_ == view) { 786 #endif
787 dragged_view_ = NULL;
788 view->OnDragDone();
789 }
790 OnDragComplete();
791 } 787 }
792 788
793 void Widget::SchedulePaintInRect(const gfx::Rect& rect) { 789 void Widget::SchedulePaintInRect(const gfx::Rect& rect) {
794 native_widget_->SchedulePaintInRect(rect); 790 native_widget_->SchedulePaintInRect(rect);
795 } 791 }
796 792
797 void Widget::SetCursor(gfx::NativeCursor cursor) { 793 void Widget::SetCursor(gfx::NativeCursor cursor) {
798 native_widget_->SetCursor(cursor); 794 native_widget_->SetCursor(cursor);
799 } 795 }
800 796
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 return new internal::RootView(this); 1356 return new internal::RootView(this);
1361 } 1357 }
1362 1358
1363 void Widget::DestroyRootView() { 1359 void Widget::DestroyRootView() {
1364 non_client_view_ = NULL; 1360 non_client_view_ = NULL;
1365 root_view_.reset(); 1361 root_view_.reset();
1366 } 1362 }
1367 1363
1368 void Widget::OnDragWillStart() {} 1364 void Widget::OnDragWillStart() {}
1369 1365
1366 void Widget::DraggingEnded(View* view) {
1367 // If the view is removed during the drag operation, dragged_view_ is set to
1368 // NULL.
1369 if (view && dragged_view_ == view) {
1370 dragged_view_ = NULL;
1371 view->OnDragDone();
1372 }
1373 OnDragComplete();
1374 }
1375
1370 void Widget::OnDragComplete() {} 1376 void Widget::OnDragComplete() {}
1371 1377
1372 //////////////////////////////////////////////////////////////////////////////// 1378 ////////////////////////////////////////////////////////////////////////////////
1373 // Widget, private: 1379 // Widget, private:
1374 1380
1375 void Widget::SetAlwaysRenderAsActive(bool always_render_as_active) { 1381 void Widget::SetAlwaysRenderAsActive(bool always_render_as_active) {
1376 if (always_render_as_active_ == always_render_as_active) 1382 if (always_render_as_active_ == always_render_as_active)
1377 return; 1383 return;
1378 1384
1379 always_render_as_active_ = always_render_as_active; 1385 always_render_as_active_ = always_render_as_active;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 1489
1484 //////////////////////////////////////////////////////////////////////////////// 1490 ////////////////////////////////////////////////////////////////////////////////
1485 // internal::NativeWidgetPrivate, NativeWidget implementation: 1491 // internal::NativeWidgetPrivate, NativeWidget implementation:
1486 1492
1487 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1493 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1488 return this; 1494 return this;
1489 } 1495 }
1490 1496
1491 } // namespace internal 1497 } // namespace internal
1492 } // namespace views 1498 } // namespace views
OLDNEW
« ui/views/cocoa/drag_drop_client_mac.mm ('K') | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698