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 "chrome/browser/ui/views/autofill/decorated_textfield.h" | 5 #include "chrome/browser/ui/views/autofill/decorated_textfield.h" |
6 | 6 |
7 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 7 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
8 #include "chrome/browser/ui/views/autofill/tooltip_icon.h" | 8 #include "chrome/browser/ui/views/autofill/tooltip_icon.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 return views::Textfield::GetPlaceholderText(); | 116 return views::Textfield::GetPlaceholderText(); |
117 } | 117 } |
118 | 118 |
119 const char* DecoratedTextfield::GetClassName() const { | 119 const char* DecoratedTextfield::GetClassName() const { |
120 return kViewClassName; | 120 return kViewClassName; |
121 } | 121 } |
122 | 122 |
123 views::View* DecoratedTextfield::GetEventHandlerForPoint( | 123 views::View* DecoratedTextfield::GetEventHandlerForPoint( |
124 const gfx::Point& point) { | 124 const gfx::Point& point) { |
| 125 views::View* handler = views::Textfield::GetEventHandlerForPoint(point); |
| 126 if (handler->GetClassName() == TooltipIcon::kViewClassName) |
| 127 return handler; |
125 return native_wrapper_->GetView(); | 128 return native_wrapper_->GetView(); |
126 } | 129 } |
127 | 130 |
128 void DecoratedTextfield::OnFocus() { | 131 void DecoratedTextfield::OnFocus() { |
129 border_->set_has_focus(true); | 132 border_->set_has_focus(true); |
130 views::Textfield::OnFocus(); | 133 views::Textfield::OnFocus(); |
131 } | 134 } |
132 | 135 |
133 void DecoratedTextfield::OnBlur() { | 136 void DecoratedTextfield::OnBlur() { |
134 border_->set_has_focus(false); | 137 border_->set_has_focus(false); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 icon_view_->GetPreferredSize().width() + 2 * kTextfieldIconPadding : 0; | 177 icon_view_->GetPreferredSize().width() + 2 * kTextfieldIconPadding : 0; |
175 | 178 |
176 bool is_rtl = base::i18n::IsRTL(); | 179 bool is_rtl = base::i18n::IsRTL(); |
177 SetHorizontalMargins(is_rtl ? icon_space : 0, is_rtl ? 0 : icon_space); | 180 SetHorizontalMargins(is_rtl ? icon_space : 0, is_rtl ? 0 : icon_space); |
178 | 181 |
179 Layout(); | 182 Layout(); |
180 SchedulePaint(); | 183 SchedulePaint(); |
181 } | 184 } |
182 | 185 |
183 } // namespace autofill | 186 } // namespace autofill |
OLD | NEW |