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

Side by Side Diff: ui/views/controls/combobox/native_combobox_views.cc

Issue 13607006: rAc: don't clobber user input when accepting autofill popup suggestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years, 8 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 | « chrome/browser/ui/views/autofill/autofill_dialog_views.cc ('k') | no next file » | 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/controls/combobox/native_combobox_views.h" 5 #include "ui/views/controls/combobox/native_combobox_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "ui/base/events/event.h" 10 #include "ui/base/events/event.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 menu->AppendMenuItem(i + kFirstMenuItemId, text, MenuItemView::NORMAL); 212 menu->AppendMenuItem(i + kFirstMenuItemId, text, MenuItemView::NORMAL);
213 max_width = std::max(max_width, font.GetStringWidth(text)); 213 max_width = std::max(max_width, font.GetStringWidth(text));
214 } 214 }
215 215
216 content_width_ = max_width; 216 content_width_ = max_width;
217 content_height_ = font.GetHeight(); 217 content_height_ = font.GetHeight();
218 } 218 }
219 219
220 void NativeComboboxViews::UpdateSelectedIndex() { 220 void NativeComboboxViews::UpdateSelectedIndex() {
221 selected_index_ = combobox_->selected_index(); 221 selected_index_ = combobox_->selected_index();
222 SchedulePaint();
222 } 223 }
223 224
224 void NativeComboboxViews::UpdateEnabled() { 225 void NativeComboboxViews::UpdateEnabled() {
225 SetEnabled(combobox_->enabled()); 226 SetEnabled(combobox_->enabled());
226 } 227 }
227 228
228 int NativeComboboxViews::GetSelectedIndex() const { 229 int NativeComboboxViews::GetSelectedIndex() const {
229 return selected_index_; 230 return selected_index_;
230 } 231 }
231 232
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 410
410 #if defined(USE_AURA) 411 #if defined(USE_AURA)
411 // static 412 // static
412 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( 413 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper(
413 Combobox* combobox) { 414 Combobox* combobox) {
414 return new NativeComboboxViews(combobox); 415 return new NativeComboboxViews(combobox);
415 } 416 }
416 #endif 417 #endif
417 418
418 } // namespace views 419 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_dialog_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698