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

Side by Side Diff: chrome/browser/ui/views/autofill/decorated_textfield.cc

Issue 22891016: Add support for rect-based event targeting in views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 7 years, 1 month 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 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (!editable_) 113 if (!editable_)
114 return base::string16(); 114 return base::string16();
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::GetEventHandlerForRect(const gfx::Rect& rect) {
124 const gfx::Point& point) {
125 return native_wrapper_->GetView(); 124 return native_wrapper_->GetView();
126 } 125 }
127 126
128 void DecoratedTextfield::OnFocus() { 127 void DecoratedTextfield::OnFocus() {
129 border_->set_has_focus(true); 128 border_->set_has_focus(true);
130 views::Textfield::OnFocus(); 129 views::Textfield::OnFocus();
131 } 130 }
132 131
133 void DecoratedTextfield::OnBlur() { 132 void DecoratedTextfield::OnBlur() {
134 border_->set_has_focus(false); 133 border_->set_has_focus(false);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 icon_view_->GetPreferredSize().width() + 2 * kTextfieldIconPadding : 0; 173 icon_view_->GetPreferredSize().width() + 2 * kTextfieldIconPadding : 0;
175 174
176 bool is_rtl = base::i18n::IsRTL(); 175 bool is_rtl = base::i18n::IsRTL();
177 SetHorizontalMargins(is_rtl ? icon_space : 0, is_rtl ? 0 : icon_space); 176 SetHorizontalMargins(is_rtl ? icon_space : 0, is_rtl ? 0 : icon_space);
178 177
179 Layout(); 178 Layout();
180 SchedulePaint(); 179 SchedulePaint();
181 } 180 }
182 181
183 } // namespace autofill 182 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698