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

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

Issue 173803002: Redesigns the text input focus handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reset the text input client in FocusController. Created 6 years, 7 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 | Annotate | Revision Log
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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 const Widget* toplevel = GetTopLevelWidget(); 779 const Widget* toplevel = GetTopLevelWidget();
780 // If GetTopLevelWidget() returns itself which is not toplevel, 780 // If GetTopLevelWidget() returns itself which is not toplevel,
781 // the widget is detached from toplevel widget. 781 // the widget is detached from toplevel widget.
782 // TODO(oshima): Fix GetTopLevelWidget() to return NULL 782 // TODO(oshima): Fix GetTopLevelWidget() to return NULL
783 // if there is no toplevel. We probably need to add GetTopMostWidget() 783 // if there is no toplevel. We probably need to add GetTopMostWidget()
784 // to replace some use cases. 784 // to replace some use cases.
785 return (toplevel && toplevel != this) ? toplevel->GetInputMethod() : NULL; 785 return (toplevel && toplevel != this) ? toplevel->GetInputMethod() : NULL;
786 } 786 }
787 } 787 }
788 788
789 ui::InputMethod* Widget::GetHostInputMethod() {
790 return native_widget_private()->GetHostInputMethod();
791 }
792
789 void Widget::RunShellDrag(View* view, 793 void Widget::RunShellDrag(View* view,
790 const ui::OSExchangeData& data, 794 const ui::OSExchangeData& data,
791 const gfx::Point& location, 795 const gfx::Point& location,
792 int operation, 796 int operation,
793 ui::DragDropTypes::DragEventSource source) { 797 ui::DragDropTypes::DragEventSource source) {
794 dragged_view_ = view; 798 dragged_view_ = view;
795 native_widget_->RunShellDrag(view, data, location, operation, source); 799 native_widget_->RunShellDrag(view, data, location, operation, source);
796 // If the view is removed during the drag operation, dragged_view_ is set to 800 // If the view is removed during the drag operation, dragged_view_ is set to
797 // NULL. 801 // NULL.
798 if (view && dragged_view_ == view) { 802 if (view && dragged_view_ == view) {
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1463 1467
1464 //////////////////////////////////////////////////////////////////////////////// 1468 ////////////////////////////////////////////////////////////////////////////////
1465 // internal::NativeWidgetPrivate, NativeWidget implementation: 1469 // internal::NativeWidgetPrivate, NativeWidget implementation:
1466 1470
1467 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1471 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1468 return this; 1472 return this;
1469 } 1473 }
1470 1474
1471 } // namespace internal 1475 } // namespace internal
1472 } // namespace views 1476 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698