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

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

Issue 378333003: Allow menus to stay open during a child view's drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« ui/views/widget/widget.h ('K') | « ui/views/widget/widget.h ('k') | 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/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 ui::InputMethod* Widget::GetHostInputMethod() { 780 ui::InputMethod* Widget::GetHostInputMethod() {
781 return native_widget_private()->GetHostInputMethod(); 781 return native_widget_private()->GetHostInputMethod();
782 } 782 }
783 783
784 void Widget::RunShellDrag(View* view, 784 void Widget::RunShellDrag(View* view,
785 const ui::OSExchangeData& data, 785 const ui::OSExchangeData& data,
786 const gfx::Point& location, 786 const gfx::Point& location,
787 int operation, 787 int operation,
788 ui::DragDropTypes::DragEventSource source) { 788 ui::DragDropTypes::DragEventSource source) {
789 dragged_view_ = view; 789 dragged_view_ = view;
790 OnDragWillStart();
790 native_widget_->RunShellDrag(view, data, location, operation, source); 791 native_widget_->RunShellDrag(view, data, location, operation, source);
791 // If the view is removed during the drag operation, dragged_view_ is set to 792 // If the view is removed during the drag operation, dragged_view_ is set to
792 // NULL. 793 // NULL.
793 if (view && dragged_view_ == view) { 794 if (view && dragged_view_ == view) {
794 dragged_view_ = NULL; 795 dragged_view_ = NULL;
795 view->OnDragDone(); 796 view->OnDragDone();
796 } 797 }
798 OnDragComplete(view);
797 } 799 }
798 800
799 void Widget::SchedulePaintInRect(const gfx::Rect& rect) { 801 void Widget::SchedulePaintInRect(const gfx::Rect& rect) {
800 native_widget_->SchedulePaintInRect(rect); 802 native_widget_->SchedulePaintInRect(rect);
801 } 803 }
802 804
803 void Widget::SetCursor(gfx::NativeCursor cursor) { 805 void Widget::SetCursor(gfx::NativeCursor cursor) {
804 native_widget_->SetCursor(cursor); 806 native_widget_->SetCursor(cursor);
805 } 807 }
806 808
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 return new internal::RootView(this); 1390 return new internal::RootView(this);
1389 } 1391 }
1390 1392
1391 void Widget::DestroyRootView() { 1393 void Widget::DestroyRootView() {
1392 non_client_view_ = NULL; 1394 non_client_view_ = NULL;
1393 root_view_.reset(); 1395 root_view_.reset();
1394 // Input method has to be destroyed before focus manager. 1396 // Input method has to be destroyed before focus manager.
1395 input_method_.reset(); 1397 input_method_.reset();
1396 } 1398 }
1397 1399
1400 void Widget::OnDragWillStart() {
1401 }
1402
1403 void Widget::OnDragComplete(View* view) {
1404 }
1405
1398 //////////////////////////////////////////////////////////////////////////////// 1406 ////////////////////////////////////////////////////////////////////////////////
1399 // Widget, private: 1407 // Widget, private:
1400 1408
1401 void Widget::SetInactiveRenderingDisabled(bool value) { 1409 void Widget::SetInactiveRenderingDisabled(bool value) {
1402 if (value == disable_inactive_rendering_) 1410 if (value == disable_inactive_rendering_)
1403 return; 1411 return;
1404 1412
1405 disable_inactive_rendering_ = value; 1413 disable_inactive_rendering_ = value;
1406 if (non_client_view_) 1414 if (non_client_view_)
1407 non_client_view_->SetInactiveRenderingDisabled(value); 1415 non_client_view_->SetInactiveRenderingDisabled(value);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 1514
1507 //////////////////////////////////////////////////////////////////////////////// 1515 ////////////////////////////////////////////////////////////////////////////////
1508 // internal::NativeWidgetPrivate, NativeWidget implementation: 1516 // internal::NativeWidgetPrivate, NativeWidget implementation:
1509 1517
1510 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1518 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1511 return this; 1519 return this;
1512 } 1520 }
1513 1521
1514 } // namespace internal 1522 } // namespace internal
1515 } // namespace views 1523 } // namespace views
OLDNEW
« ui/views/widget/widget.h ('K') | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698