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/native_combobox_views.h" | 5 #include "ui/views/controls/combobox/native_combobox_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 View::ConvertPointToScreen(this, &menu_position); | 391 View::ConvertPointToScreen(this, &menu_position); |
392 if (menu_position.x() < 0) | 392 if (menu_position.x() < 0) |
393 menu_position.set_x(0); | 393 menu_position.set_x(0); |
394 | 394 |
395 gfx::Rect bounds(menu_position, lb.size()); | 395 gfx::Rect bounds(menu_position, lb.size()); |
396 | 396 |
397 dropdown_open_ = true; | 397 dropdown_open_ = true; |
398 if (dropdown_list_menu_runner_->RunMenuAt( | 398 if (dropdown_list_menu_runner_->RunMenuAt( |
399 GetWidget(), NULL, bounds, MenuItemView::TOPLEFT, | 399 GetWidget(), NULL, bounds, MenuItemView::TOPLEFT, |
400 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) | 400 ui::MENU_SOURCE_NONE, MenuRunner::HAS_MNEMONICS) == |
| 401 MenuRunner::MENU_DELETED) |
401 return; | 402 return; |
402 dropdown_open_ = false; | 403 dropdown_open_ = false; |
403 | 404 |
404 // Need to explicitly clear mouse handler so that events get sent | 405 // Need to explicitly clear mouse handler so that events get sent |
405 // properly after the menu finishes running. If we don't do this, then | 406 // properly after the menu finishes running. If we don't do this, then |
406 // the first click to other parts of the UI is eaten. | 407 // the first click to other parts of the UI is eaten. |
407 SetMouseHandler(NULL); | 408 SetMouseHandler(NULL); |
408 } | 409 } |
409 | 410 |
410 //////////////////////////////////////////////////////////////////////////////// | 411 //////////////////////////////////////////////////////////////////////////////// |
411 // NativeComboboxWrapper, public: | 412 // NativeComboboxWrapper, public: |
412 | 413 |
413 #if defined(USE_AURA) | 414 #if defined(USE_AURA) |
414 // static | 415 // static |
415 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( | 416 NativeComboboxWrapper* NativeComboboxWrapper::CreateWrapper( |
416 Combobox* combobox) { | 417 Combobox* combobox) { |
417 return new NativeComboboxViews(combobox); | 418 return new NativeComboboxViews(combobox); |
418 } | 419 } |
419 #endif | 420 #endif |
420 | 421 |
421 } // namespace views | 422 } // namespace views |
OLD | NEW |