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

Side by Side Diff: trunk/src/ui/views/ime/input_method_base.cc

Issue 23710009: Revert 219673 "Fix Views Combobox and Tree View text input." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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/ime/input_method_base.h" 5 #include "ui/views/ime/input_method_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/events/event.h" 8 #include "ui/base/events/event.h"
9 #include "ui/base/ime/text_input_client.h" 9 #include "ui/base/ime/text_input_client.h"
10 #include "ui/views/view.h" 10 #include "ui/views/view.h"
(...skipping 25 matching lines...) Expand all
36 widget->GetFocusManager()->AddFocusChangeListener(this); 36 widget->GetFocusManager()->AddFocusChangeListener(this);
37 } 37 }
38 38
39 views::View* InputMethodBase::GetFocusedView() const { 39 views::View* InputMethodBase::GetFocusedView() const {
40 return widget_ ? widget_->GetFocusManager()->GetFocusedView() : NULL; 40 return widget_ ? widget_->GetFocusManager()->GetFocusedView() : NULL;
41 } 41 }
42 42
43 void InputMethodBase::OnTextInputTypeChanged(View* view) {} 43 void InputMethodBase::OnTextInputTypeChanged(View* view) {}
44 44
45 ui::TextInputClient* InputMethodBase::GetTextInputClient() const { 45 ui::TextInputClient* InputMethodBase::GetTextInputClient() const {
46 return GetFocusedView() ? GetFocusedView()->GetTextInputClient() : NULL; 46 return (widget_ && widget_->IsActive() && GetFocusedView()) ?
47 GetFocusedView()->GetTextInputClient() : NULL;
47 } 48 }
48 49
49 ui::TextInputType InputMethodBase::GetTextInputType() const { 50 ui::TextInputType InputMethodBase::GetTextInputType() const {
50 ui::TextInputClient* client = GetTextInputClient(); 51 ui::TextInputClient* client = GetTextInputClient();
51 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; 52 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE;
52 } 53 }
53 54
54 bool InputMethodBase::IsMock() const { 55 bool InputMethodBase::IsMock() const {
55 return false; 56 return false;
56 } 57 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 99
99 void InputMethodBase::DetachFromWidget() { 100 void InputMethodBase::DetachFromWidget() {
100 if (!widget_) 101 if (!widget_)
101 return; 102 return;
102 103
103 widget_->GetFocusManager()->RemoveFocusChangeListener(this); 104 widget_->GetFocusManager()->RemoveFocusChangeListener(this);
104 widget_ = NULL; 105 widget_ = NULL;
105 } 106 }
106 107
107 } // namespace views 108 } // namespace views
OLDNEW
« no previous file with comments | « trunk/src/ui/views/ime/input_method_base.h ('k') | trunk/src/ui/views/ime/input_method_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698