OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/native_combobox_views.h" | 5 #include "views/controls/combobox/native_combobox_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 255 |
256 void NativeComboboxViews::ExecuteCommand(int id) { | 256 void NativeComboboxViews::ExecuteCommand(int id) { |
257 // revert menu offset to map back to combobox model | 257 // revert menu offset to map back to combobox model |
258 id -= kFirstMenuItemId; | 258 id -= kFirstMenuItemId; |
259 DCHECK_LT(id, combobox_->model()->GetItemCount()); | 259 DCHECK_LT(id, combobox_->model()->GetItemCount()); |
260 selected_item_ = id; | 260 selected_item_ = id; |
261 combobox_->SelectionChanged(); | 261 combobox_->SelectionChanged(); |
262 SchedulePaint(); | 262 SchedulePaint(); |
263 } | 263 } |
264 | 264 |
265 bool NativeComboboxViews::GetAccelerator(int id, views::Accelerator* accel) { | 265 bool NativeComboboxViews::GetAccelerator(int id, ui::Accelerator* accel) { |
266 return false; | 266 return false; |
267 } | 267 } |
268 | 268 |
269 ///////////////////////////////////////////////////////////////// | 269 ///////////////////////////////////////////////////////////////// |
270 // NativeComboboxViews private methods: | 270 // NativeComboboxViews private methods: |
271 | 271 |
272 const gfx::Font& NativeComboboxViews::GetFont() const { | 272 const gfx::Font& NativeComboboxViews::GetFont() const { |
273 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 273 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
274 return rb.GetFont(ResourceBundle::BaseFont); | 274 return rb.GetFont(ResourceBundle::BaseFont); |
275 } | 275 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 #if defined(USE_AURA) | 378 #if defined(USE_AURA) |
379 // static | 379 // static |
380 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( | 380 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( |
381 Combobox* combobox) { | 381 Combobox* combobox) { |
382 return new NativeComboboxViews(combobox); | 382 return new NativeComboboxViews(combobox); |
383 } | 383 } |
384 #endif | 384 #endif |
385 | 385 |
386 } // namespace views | 386 } // namespace views |
OLD | NEW |