| OLD | NEW |
| 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/combobox.h" | 5 #include "ui/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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // VKEY_ESCAPE should be handled by this view when the drop down list is active. | 85 // VKEY_ESCAPE should be handled by this view when the drop down list is active. |
| 86 // In other words, the list should be closed instead of the dialog. | 86 // In other words, the list should be closed instead of the dialog. |
| 87 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) { | 87 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) { |
| 88 if (e.key_code() != ui::VKEY_ESCAPE || | 88 if (e.key_code() != ui::VKEY_ESCAPE || |
| 89 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) { | 89 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) { |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 return native_wrapper_ && native_wrapper_->IsDropdownOpen(); | 92 return native_wrapper_ && native_wrapper_->IsDropdownOpen(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void Combobox::OnPaintFocusBorder(gfx::Canvas* canvas) { | 95 void Combobox::OnPaintFocusBorder(gfx::CanvasSkia* canvas) { |
| 96 if (NativeViewHost::kRenderNativeControlFocus) | 96 if (NativeViewHost::kRenderNativeControlFocus) |
| 97 View::OnPaintFocusBorder(canvas); | 97 View::OnPaintFocusBorder(canvas); |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool Combobox::OnKeyPressed(const views::KeyEvent& e) { | 100 bool Combobox::OnKeyPressed(const views::KeyEvent& e) { |
| 101 return native_wrapper_ && native_wrapper_->HandleKeyPressed(e); | 101 return native_wrapper_ && native_wrapper_->HandleKeyPressed(e); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool Combobox::OnKeyReleased(const views::KeyEvent& e) { | 104 bool Combobox::OnKeyReleased(const views::KeyEvent& e) { |
| 105 return native_wrapper_ && native_wrapper_->HandleKeyReleased(e); | 105 return native_wrapper_ && native_wrapper_->HandleKeyReleased(e); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 native_wrapper_->UpdateSelectedItem(); | 140 native_wrapper_->UpdateSelectedItem(); |
| 141 native_wrapper_->UpdateEnabled(); | 141 native_wrapper_->UpdateEnabled(); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 std::string Combobox::GetClassName() const { | 145 std::string Combobox::GetClassName() const { |
| 146 return kViewClassName; | 146 return kViewClassName; |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace views | 149 } // namespace views |
| OLD | NEW |