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

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

Issue 7982009: views: Add comment to Combobox's native wrapper about its lifetime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | « views/controls/combobox/combobox.h ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/controls/combobox/combobox.h" 5 #include "views/controls/combobox/combobox.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "ui/base/accessibility/accessible_view_state.h" 9 #include "ui/base/accessibility/accessible_view_state.h"
10 #include "ui/base/keycodes/keyboard_codes.h" 10 #include "ui/base/keycodes/keyboard_codes.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 void Combobox::GetAccessibleState(ui::AccessibleViewState* state) { 121 void Combobox::GetAccessibleState(ui::AccessibleViewState* state) {
122 state->role = ui::AccessibilityTypes::ROLE_COMBOBOX; 122 state->role = ui::AccessibilityTypes::ROLE_COMBOBOX;
123 state->name = accessible_name_; 123 state->name = accessible_name_;
124 state->value = model_->GetItemAt(selected_item_); 124 state->value = model_->GetItemAt(selected_item_);
125 state->index = selected_item(); 125 state->index = selected_item();
126 state->count = model()->GetItemCount(); 126 state->count = model()->GetItemCount();
127 } 127 }
128 128
129 void Combobox::ViewHierarchyChanged(bool is_add, View* parent, 129 void Combobox::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
130 View* child) {
131 if (is_add && !native_wrapper_ && GetWidget()) { 130 if (is_add && !native_wrapper_ && GetWidget()) {
131 // The native wrapper's lifetime will be managed by the view hierarchy after
132 // we call AddChildView.
132 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this); 133 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this);
133 AddChildView(native_wrapper_->GetView()); 134 AddChildView(native_wrapper_->GetView());
134 } 135 }
135 } 136 }
136 137
137 std::string Combobox::GetClassName() const { 138 std::string Combobox::GetClassName() const {
138 return kViewClassName; 139 return kViewClassName;
139 } 140 }
140 141
141 } // namespace views 142 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/combobox/combobox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698