OLD | NEW |
---|---|
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 } | 151 } |
152 | 152 |
153 //////////////////////////////////////////////////////////////////////////////// | 153 //////////////////////////////////////////////////////////////////////////////// |
154 // Widget, public: | 154 // Widget, public: |
155 | 155 |
156 Widget::Widget() | 156 Widget::Widget() |
157 : native_widget_(NULL), | 157 : native_widget_(NULL), |
158 widget_delegate_(NULL), | 158 widget_delegate_(NULL), |
159 non_client_view_(NULL), | 159 non_client_view_(NULL), |
160 dragged_view_(NULL), | 160 dragged_view_(NULL), |
161 child_drag_in_progress_(false), | |
161 ownership_(InitParams::NATIVE_WIDGET_OWNS_WIDGET), | 162 ownership_(InitParams::NATIVE_WIDGET_OWNS_WIDGET), |
162 is_secondary_widget_(true), | 163 is_secondary_widget_(true), |
163 frame_type_(FRAME_TYPE_DEFAULT), | 164 frame_type_(FRAME_TYPE_DEFAULT), |
164 disable_inactive_rendering_(false), | 165 disable_inactive_rendering_(false), |
165 widget_closed_(false), | 166 widget_closed_(false), |
166 saved_show_state_(ui::SHOW_STATE_DEFAULT), | 167 saved_show_state_(ui::SHOW_STATE_DEFAULT), |
167 focus_on_creation_(true), | 168 focus_on_creation_(true), |
168 is_top_level_(false), | 169 is_top_level_(false), |
169 native_widget_initialized_(false), | 170 native_widget_initialized_(false), |
170 native_widget_destroyed_(false), | 171 native_widget_destroyed_(false), |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
780 ui::InputMethod* Widget::GetHostInputMethod() { | 781 ui::InputMethod* Widget::GetHostInputMethod() { |
781 return native_widget_private()->GetHostInputMethod(); | 782 return native_widget_private()->GetHostInputMethod(); |
782 } | 783 } |
783 | 784 |
784 void Widget::RunShellDrag(View* view, | 785 void Widget::RunShellDrag(View* view, |
785 const ui::OSExchangeData& data, | 786 const ui::OSExchangeData& data, |
786 const gfx::Point& location, | 787 const gfx::Point& location, |
787 int operation, | 788 int operation, |
788 ui::DragDropTypes::DragEventSource source) { | 789 ui::DragDropTypes::DragEventSource source) { |
789 dragged_view_ = view; | 790 dragged_view_ = view; |
791 GetTopLevelWidget()->set_child_drag_in_progress(true); | |
sky
2014/07/10 15:05:00
You shouldn't need a new field to determine if a d
Devlin
2014/07/10 15:33:00
The issue there is that dragged_view_ is typically
| |
790 native_widget_->RunShellDrag(view, data, location, operation, source); | 792 native_widget_->RunShellDrag(view, data, location, operation, source); |
791 // If the view is removed during the drag operation, dragged_view_ is set to | 793 // If the view is removed during the drag operation, dragged_view_ is set to |
792 // NULL. | 794 // NULL. |
795 GetTopLevelWidget()->set_child_drag_in_progress(false); | |
Devlin
2014/07/09 18:28:44
This still has the problem that, since capture was
sky
2014/07/10 15:05:00
More specifically the menu is left in a weird stat
Devlin
2014/07/10 15:33:00
Yeah, I would assume that we want to leave the men
| |
793 if (view && dragged_view_ == view) { | 796 if (view && dragged_view_ == view) { |
794 dragged_view_ = NULL; | 797 dragged_view_ = NULL; |
795 view->OnDragDone(); | 798 view->OnDragDone(); |
796 } | 799 } |
797 } | 800 } |
798 | 801 |
799 void Widget::SchedulePaintInRect(const gfx::Rect& rect) { | 802 void Widget::SchedulePaintInRect(const gfx::Rect& rect) { |
800 native_widget_->SchedulePaintInRect(rect); | 803 native_widget_->SchedulePaintInRect(rect); |
801 } | 804 } |
802 | 805 |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1506 | 1509 |
1507 //////////////////////////////////////////////////////////////////////////////// | 1510 //////////////////////////////////////////////////////////////////////////////// |
1508 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1511 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1509 | 1512 |
1510 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1513 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1511 return this; | 1514 return this; |
1512 } | 1515 } |
1513 | 1516 |
1514 } // namespace internal | 1517 } // namespace internal |
1515 } // namespace views | 1518 } // namespace views |
OLD | NEW |