| 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 const Widget* toplevel = GetTopLevelWidget(); | 760 const Widget* toplevel = GetTopLevelWidget(); |
| 761 // If GetTopLevelWidget() returns itself which is not toplevel, | 761 // If GetTopLevelWidget() returns itself which is not toplevel, |
| 762 // the widget is detached from toplevel widget. | 762 // the widget is detached from toplevel widget. |
| 763 // TODO(oshima): Fix GetTopLevelWidget() to return NULL | 763 // TODO(oshima): Fix GetTopLevelWidget() to return NULL |
| 764 // if there is no toplevel. We probably need to add GetTopMostWidget() | 764 // if there is no toplevel. We probably need to add GetTopMostWidget() |
| 765 // to replace some use cases. | 765 // to replace some use cases. |
| 766 return (toplevel && toplevel != this) ? toplevel->GetInputMethod() : NULL; | 766 return (toplevel && toplevel != this) ? toplevel->GetInputMethod() : NULL; |
| 767 } | 767 } |
| 768 } | 768 } |
| 769 | 769 |
| 770 ui::InputMethod* Widget::GetHostInputMethod() { |
| 771 return native_widget_private()->GetHostInputMethod(); |
| 772 } |
| 773 |
| 770 void Widget::RunShellDrag(View* view, | 774 void Widget::RunShellDrag(View* view, |
| 771 const ui::OSExchangeData& data, | 775 const ui::OSExchangeData& data, |
| 772 const gfx::Point& location, | 776 const gfx::Point& location, |
| 773 int operation, | 777 int operation, |
| 774 ui::DragDropTypes::DragEventSource source) { | 778 ui::DragDropTypes::DragEventSource source) { |
| 775 dragged_view_ = view; | 779 dragged_view_ = view; |
| 776 native_widget_->RunShellDrag(view, data, location, operation, source); | 780 native_widget_->RunShellDrag(view, data, location, operation, source); |
| 777 // If the view is removed during the drag operation, dragged_view_ is set to | 781 // If the view is removed during the drag operation, dragged_view_ is set to |
| 778 // NULL. | 782 // NULL. |
| 779 if (view && dragged_view_ == view) { | 783 if (view && dragged_view_ == view) { |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 | 1448 |
| 1445 //////////////////////////////////////////////////////////////////////////////// | 1449 //////////////////////////////////////////////////////////////////////////////// |
| 1446 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1450 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1447 | 1451 |
| 1448 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1452 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1449 return this; | 1453 return this; |
| 1450 } | 1454 } |
| 1451 | 1455 |
| 1452 } // namespace internal | 1456 } // namespace internal |
| 1453 } // namespace views | 1457 } // namespace views |
| OLD | NEW |