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" |
11 #include "ui/base/models/combobox_model.h" | 11 #include "ui/base/models/combobox_model.h" |
| 12 #include "ui/base/resource/resource_bundle.h" |
12 #include "ui/views/controls/combobox/combobox_listener.h" | 13 #include "ui/views/controls/combobox/combobox_listener.h" |
13 #include "ui/views/controls/native/native_view_host.h" | 14 #include "ui/views/controls/native/native_view_host.h" |
14 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
15 | 16 |
16 namespace views { | 17 namespace views { |
17 | 18 |
18 // static | 19 // static |
19 const char Combobox::kViewClassName[] = "views/Combobox"; | 20 const char Combobox::kViewClassName[] = "views/Combobox"; |
20 | 21 |
21 //////////////////////////////////////////////////////////////////////////////// | 22 //////////////////////////////////////////////////////////////////////////////// |
22 // Combobox, public: | 23 // Combobox, public: |
23 | 24 |
| 25 // static |
| 26 const gfx::Font& Combobox::GetFont() { |
| 27 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 28 return rb.GetFont(ui::ResourceBundle::BaseFont); |
| 29 } |
| 30 |
24 Combobox::Combobox(ui::ComboboxModel* model) | 31 Combobox::Combobox(ui::ComboboxModel* model) |
25 : native_wrapper_(NULL), | 32 : native_wrapper_(NULL), |
26 model_(model), | 33 model_(model), |
27 listener_(NULL), | 34 listener_(NULL), |
28 selected_item_(0) { | 35 selected_item_(0) { |
29 set_focusable(true); | 36 set_focusable(true); |
30 } | 37 } |
31 | 38 |
32 Combobox::~Combobox() { | 39 Combobox::~Combobox() { |
33 } | 40 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 native_wrapper_->UpdateSelectedItem(); | 147 native_wrapper_->UpdateSelectedItem(); |
141 native_wrapper_->UpdateEnabled(); | 148 native_wrapper_->UpdateEnabled(); |
142 } | 149 } |
143 } | 150 } |
144 | 151 |
145 std::string Combobox::GetClassName() const { | 152 std::string Combobox::GetClassName() const { |
146 return kViewClassName; | 153 return kViewClassName; |
147 } | 154 } |
148 | 155 |
149 } // namespace views | 156 } // namespace views |
OLD | NEW |