| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/keycodes/keyboard_codes.h" | 9 #include "ui/base/keycodes/keyboard_codes.h" |
| 10 #include "ui/base/models/combobox_model.h" | 10 #include "ui/base/models/combobox_model.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void Combobox::SetEnabled(bool flag) { | 71 void Combobox::SetEnabled(bool flag) { |
| 72 View::SetEnabled(flag); | 72 View::SetEnabled(flag); |
| 73 if (native_wrapper_) | 73 if (native_wrapper_) |
| 74 native_wrapper_->UpdateEnabled(); | 74 native_wrapper_->UpdateEnabled(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 // VKEY_ESCAPE should be handled by this view when the drop down list is active. | 77 // VKEY_ESCAPE should be handled by this view when the drop down list is active. |
| 78 // In other words, the list should be closed instead of the dialog. | 78 // In other words, the list should be closed instead of the dialog. |
| 79 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) { | 79 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) { |
| 80 if (e.GetKeyCode() != ui::VKEY_ESCAPE || | 80 if (e.key_code() != ui::VKEY_ESCAPE || |
| 81 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) { | 81 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) { |
| 82 return false; | 82 return false; |
| 83 } | 83 } |
| 84 return native_wrapper_ && native_wrapper_->IsDropdownOpen(); | 84 return native_wrapper_ && native_wrapper_->IsDropdownOpen(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void Combobox::PaintFocusBorder(gfx::Canvas* canvas) { | 87 void Combobox::PaintFocusBorder(gfx::Canvas* canvas) { |
| 88 if (NativeViewHost::kRenderNativeControlFocus) | 88 if (NativeViewHost::kRenderNativeControlFocus) |
| 89 View::PaintFocusBorder(canvas); | 89 View::PaintFocusBorder(canvas); |
| 90 } | 90 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 112 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this); | 112 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this); |
| 113 AddChildView(native_wrapper_->GetView()); | 113 AddChildView(native_wrapper_->GetView()); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 std::string Combobox::GetClassName() const { | 117 std::string Combobox::GetClassName() const { |
| 118 return kViewClassName; | 118 return kViewClassName; |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace views | 121 } // namespace views |
| OLD | NEW |