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

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

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DisableOnHover test? Created 9 years, 6 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') | views/controls/label.h » ('j') | 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return gfx::Size(); 71 return gfx::Size();
72 } 72 }
73 73
74 void Combobox::Layout() { 74 void Combobox::Layout() {
75 if (native_wrapper_) { 75 if (native_wrapper_) {
76 native_wrapper_->GetView()->SetBounds(0, 0, width(), height()); 76 native_wrapper_->GetView()->SetBounds(0, 0, width(), height());
77 native_wrapper_->GetView()->Layout(); 77 native_wrapper_->GetView()->Layout();
78 } 78 }
79 } 79 }
80 80
81 void Combobox::SetEnabled(bool flag) { 81 void Combobox::OnEnabledChanged() {
82 View::SetEnabled(flag); 82 View::OnEnabledChanged();
83 if (native_wrapper_) 83 if (native_wrapper_)
84 native_wrapper_->UpdateEnabled(); 84 native_wrapper_->UpdateEnabled();
85 } 85 }
86 86
87 // VKEY_ESCAPE should be handled by this view when the drop down list is active. 87 // VKEY_ESCAPE should be handled by this view when the drop down list is active.
88 // In other words, the list should be closed instead of the dialog. 88 // In other words, the list should be closed instead of the dialog.
89 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) { 89 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) {
90 if (e.key_code() != ui::VKEY_ESCAPE || 90 if (e.key_code() != ui::VKEY_ESCAPE ||
91 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) { 91 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) {
92 return false; 92 return false;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this); 135 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this);
136 AddChildView(native_wrapper_->GetView()); 136 AddChildView(native_wrapper_->GetView());
137 } 137 }
138 } 138 }
139 139
140 std::string Combobox::GetClassName() const { 140 std::string Combobox::GetClassName() const {
141 return kViewClassName; 141 return kViewClassName;
142 } 142 }
143 143
144 } // namespace views 144 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/combobox/combobox.h ('k') | views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698