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

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

Issue 6246001: Move app/key* to ui/base/keycodes/* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/button/native_button.cc ('k') | views/controls/link.cc » ('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) 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 "app/combobox_model.h" 7 #include "app/combobox_model.h"
8 #include "app/keyboard_codes.h"
9 #include "base/logging.h" 8 #include "base/logging.h"
10 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "ui/base/keycodes/keyboard_codes.h"
11 #include "views/controls/combobox/native_combobox_wrapper.h" 11 #include "views/controls/combobox/native_combobox_wrapper.h"
12 #include "views/controls/native/native_view_host.h" 12 #include "views/controls/native/native_view_host.h"
13 13
14 namespace views { 14 namespace views {
15 15
16 // static 16 // static
17 const char Combobox::kViewClassName[] = "views/Combobox"; 17 const char Combobox::kViewClassName[] = "views/Combobox";
18 18
19 //////////////////////////////////////////////////////////////////////////////// 19 ////////////////////////////////////////////////////////////////////////////////
20 // Combobox, public: 20 // Combobox, public:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 void Combobox::SetEnabled(bool flag) { 69 void Combobox::SetEnabled(bool flag) {
70 View::SetEnabled(flag); 70 View::SetEnabled(flag);
71 if (native_wrapper_) 71 if (native_wrapper_)
72 native_wrapper_->UpdateEnabled(); 72 native_wrapper_->UpdateEnabled();
73 } 73 }
74 74
75 // VKEY_ESCAPE should be handled by this view when the drop down list is active. 75 // VKEY_ESCAPE should be handled by this view when the drop down list is active.
76 // In other words, the list should be closed instead of the dialog. 76 // In other words, the list should be closed instead of the dialog.
77 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) { 77 bool Combobox::SkipDefaultKeyEventProcessing(const KeyEvent& e) {
78 if (e.GetKeyCode() != app::VKEY_ESCAPE || 78 if (e.GetKeyCode() != ui::VKEY_ESCAPE ||
79 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) { 79 e.IsShiftDown() || e.IsControlDown() || e.IsAltDown()) {
80 return false; 80 return false;
81 } 81 }
82 return native_wrapper_ && native_wrapper_->IsDropdownOpen(); 82 return native_wrapper_ && native_wrapper_->IsDropdownOpen();
83 } 83 }
84 84
85 void Combobox::PaintFocusBorder(gfx::Canvas* canvas) { 85 void Combobox::PaintFocusBorder(gfx::Canvas* canvas) {
86 if (NativeViewHost::kRenderNativeControlFocus) 86 if (NativeViewHost::kRenderNativeControlFocus)
87 View::PaintFocusBorder(canvas); 87 View::PaintFocusBorder(canvas);
88 } 88 }
(...skipping 21 matching lines...) Expand all
110 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this); 110 native_wrapper_ = NativeComboboxWrapper::CreateWrapper(this);
111 AddChildView(native_wrapper_->GetView()); 111 AddChildView(native_wrapper_->GetView());
112 } 112 }
113 } 113 }
114 114
115 std::string Combobox::GetClassName() const { 115 std::string Combobox::GetClassName() const {
116 return kViewClassName; 116 return kViewClassName;
117 } 117 }
118 118
119 } // namespace views 119 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/native_button.cc ('k') | views/controls/link.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698