OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/controls/prefix_selector.h" | 5 #include "ui/views/controls/prefix_selector.h" |
6 | 6 |
7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
8 #include "ui/base/ime/text_input_type.h" | 8 #include "ui/base/ime/text_input_type.h" |
9 #include "ui/base/range/range.h" | 9 #include "ui/base/range/range.h" |
10 #include "ui/views/controls/prefix_delegate.h" | 10 #include "ui/views/controls/prefix_delegate.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 gfx::NativeWindow PrefixSelector::GetAttachedWindow() const { | 58 gfx::NativeWindow PrefixSelector::GetAttachedWindow() const { |
59 return prefix_delegate_->GetWidget()->GetNativeWindow(); | 59 return prefix_delegate_->GetWidget()->GetNativeWindow(); |
60 } | 60 } |
61 | 61 |
62 ui::TextInputType PrefixSelector::GetTextInputType() const { | 62 ui::TextInputType PrefixSelector::GetTextInputType() const { |
63 return ui::TEXT_INPUT_TYPE_TEXT; | 63 return ui::TEXT_INPUT_TYPE_TEXT; |
64 } | 64 } |
65 | 65 |
| 66 ui::TextInputMode PrefixSelector::GetTextInputMode() const { |
| 67 return ui::TEXT_INPUT_MODE_DEFAULT; |
| 68 } |
| 69 |
66 bool PrefixSelector::CanComposeInline() const { | 70 bool PrefixSelector::CanComposeInline() const { |
67 return false; | 71 return false; |
68 } | 72 } |
69 | 73 |
70 gfx::Rect PrefixSelector::GetCaretBounds() { | 74 gfx::Rect PrefixSelector::GetCaretBounds() { |
71 gfx::Rect rect(prefix_delegate_->GetVisibleBounds().origin(), gfx::Size()); | 75 gfx::Rect rect(prefix_delegate_->GetVisibleBounds().origin(), gfx::Size()); |
72 // TextInputClient::GetCaretBounds is expected to return a value in screen | 76 // TextInputClient::GetCaretBounds is expected to return a value in screen |
73 // coordinates. | 77 // coordinates. |
74 ConvertRectToScreen(prefix_delegate_, &rect); | 78 ConvertRectToScreen(prefix_delegate_, &rect); |
75 return rect; | 79 return rect; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 return (model_text.size() >= lower_text.size()) && | 177 return (model_text.size() >= lower_text.size()) && |
174 (model_text.compare(0, lower_text.size(), lower_text) == 0); | 178 (model_text.compare(0, lower_text.size(), lower_text) == 0); |
175 } | 179 } |
176 | 180 |
177 void PrefixSelector::ClearText() { | 181 void PrefixSelector::ClearText() { |
178 current_text_.clear(); | 182 current_text_.clear(); |
179 time_of_last_key_ = base::TimeTicks(); | 183 time_of_last_key_ = base::TimeTicks(); |
180 } | 184 } |
181 | 185 |
182 } // namespace views | 186 } // namespace views |
OLD | NEW |