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

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

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build Created 7 years, 6 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) 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698