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

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

Issue 6480001: Migrate Event API methods to Google Style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698