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

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

Issue 23245012: Fix Views Combobox and Tree View text input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nit. 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
« no previous file with comments | « ui/views/ime/input_method_base.h ('k') | ui/views/ime/input_method_bridge.h » ('j') | 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/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 (widget_ && widget_->IsActive() && GetFocusedView()) ? 46 return GetFocusedView() ? GetFocusedView()->GetTextInputClient() : NULL;
47 GetFocusedView()->GetTextInputClient() : NULL;
48 } 47 }
49 48
50 ui::TextInputType InputMethodBase::GetTextInputType() const { 49 ui::TextInputType InputMethodBase::GetTextInputType() const {
51 ui::TextInputClient* client = GetTextInputClient(); 50 ui::TextInputClient* client = GetTextInputClient();
52 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE; 51 return client ? client->GetTextInputType() : ui::TEXT_INPUT_TYPE_NONE;
53 } 52 }
54 53
55 bool InputMethodBase::IsMock() const { 54 bool InputMethodBase::IsMock() const {
56 return false; 55 return false;
57 } 56 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 98
100 void InputMethodBase::DetachFromWidget() { 99 void InputMethodBase::DetachFromWidget() {
101 if (!widget_) 100 if (!widget_)
102 return; 101 return;
103 102
104 widget_->GetFocusManager()->RemoveFocusChangeListener(this); 103 widget_->GetFocusManager()->RemoveFocusChangeListener(this);
105 widget_ = NULL; 104 widget_ = NULL;
106 } 105 }
107 106
108 } // namespace views 107 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/ime/input_method_base.h ('k') | ui/views/ime/input_method_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698