diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 01:35:57 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 01:35:57 +0000 |
commit | 729897a909bf672aeaaad7fdf5fad883542653bd (patch) | |
tree | c7b185603c553846973a806ecf789859dee1a5c4 /ui/views | |
parent | e3b65563444a258d8114964f285135a7c6b366c9 (diff) | |
download | chromium_src-729897a909bf672aeaaad7fdf5fad883542653bd.zip chromium_src-729897a909bf672aeaaad7fdf5fad883542653bd.tar.gz chromium_src-729897a909bf672aeaaad7fdf5fad883542653bd.tar.bz2 |
Revert 122849 - Update state on creating NativeComboboxWrapper.
Replace inconsistent and incomplete state initialization code with
explicit Update calls to the wrapper after initiliazation. This fixes
the issue with views comboboxes not being initialized correctly in case
the state was set up before the combobox was added to the view
hierarchy.
BUG=chromium-os:26633
TEST=EAP method dropdown is initialized correctly for policy-pushed networks on Chrome OS.
Review URL: http://codereview.chromium.org/9395079
TBR=mnissler@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9455001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/controls/combobox/combobox.cc | 2 | ||||
-rw-r--r-- | ui/views/controls/combobox/native_combobox_gtk.cc | 10 | ||||
-rw-r--r-- | ui/views/controls/combobox/native_combobox_gtk.h | 3 | ||||
-rw-r--r-- | ui/views/controls/combobox/native_combobox_win.cc | 4 |
4 files changed, 14 insertions, 5 deletions
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc index 475b36c..fff6014 100644 --- a/ui/views/controls/combobox/combobox.cc +++ b/ui/views/controls/combobox/combobox.cc @@ -132,8 +132,6 @@ void Combobox::ViewHierarchyChanged(bool is_add, View* parent, View* child) { // The native wrapper's lifetime will be managed by the view hierarchy after // we call AddChildView. native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this); - native_wrapper_->UpdateFromModel(); - native_wrapper_->UpdateSelectedItem(); native_wrapper_->UpdateEnabled(); AddChildView(native_wrapper_->GetView()); } diff --git a/ui/views/controls/combobox/native_combobox_gtk.cc b/ui/views/controls/combobox/native_combobox_gtk.cc index 4214f32..dc7e97b 100644 --- a/ui/views/controls/combobox/native_combobox_gtk.cc +++ b/ui/views/controls/combobox/native_combobox_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -146,6 +146,14 @@ void NativeComboboxGtk::CreateNativeControl() { NativeControlCreated(widget); } +void NativeComboboxGtk::NativeControlCreated(GtkWidget* native_control) { + NativeControlGtk::NativeControlCreated(native_control); + // Set the initial state of the combobox. + UpdateFromModel(); + UpdateEnabled(); + UpdateSelectedItem(); +} + //////////////////////////////////////////////////////////////////////////////// // NativeComboboxGtk, private: void NativeComboboxGtk::SelectionChanged() { diff --git a/ui/views/controls/combobox/native_combobox_gtk.h b/ui/views/controls/combobox/native_combobox_gtk.h index b7e3609..7b08410 100644 --- a/ui/views/controls/combobox/native_combobox_gtk.h +++ b/ui/views/controls/combobox/native_combobox_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -36,6 +36,7 @@ class NativeComboboxGtk : public NativeControlGtk, protected: // Overridden from NativeControlGtk: virtual void CreateNativeControl() OVERRIDE; + virtual void NativeControlCreated(GtkWidget* widget) OVERRIDE; private: void SelectionChanged(); diff --git a/ui/views/controls/combobox/native_combobox_win.cc b/ui/views/controls/combobox/native_combobox_win.cc index 7b0fca4..2d43d80 100644 --- a/ui/views/controls/combobox/native_combobox_win.cc +++ b/ui/views/controls/combobox/native_combobox_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -188,6 +188,8 @@ void NativeComboboxWin::NativeControlCreated(HWND native_control) { NativeControlWin::NativeControlCreated(native_control); UpdateFont(); + UpdateFromModel(); + UpdateSelectedItem(); } //////////////////////////////////////////////////////////////////////////////// |