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

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

Issue 8893019: Fix loss of mouse events when an Aura combobox is open in a modal dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | « no previous file | no next file » | 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) 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 "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 "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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 gfx::Rect lb = GetLocalBounds(); 354 gfx::Rect lb = GetLocalBounds();
355 gfx::Point menu_position(lb.origin()); 355 gfx::Point menu_position(lb.origin());
356 View::ConvertPointToScreen(this, &menu_position); 356 View::ConvertPointToScreen(this, &menu_position);
357 if (menu_position.x() < 0) 357 if (menu_position.x() < 0)
358 menu_position.set_x(0); 358 menu_position.set_x(0);
359 359
360 gfx::Rect bounds(menu_position, lb.size()); 360 gfx::Rect bounds(menu_position, lb.size());
361 361
362 dropdown_open_ = true; 362 dropdown_open_ = true;
363 if (dropdown_list_menu_runner_->RunMenuAt( 363 if (dropdown_list_menu_runner_->RunMenuAt(
364 NULL, NULL, bounds, MenuItemView::TOPLEFT, 364 GetWidget(), NULL, bounds, MenuItemView::TOPLEFT,
365 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) 365 MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED)
366 return; 366 return;
367 dropdown_open_ = false; 367 dropdown_open_ = false;
368 368
369 // Need to explicitly clear mouse handler so that events get sent 369 // Need to explicitly clear mouse handler so that events get sent
370 // properly after the menu finishes running. If we don't do this, then 370 // properly after the menu finishes running. If we don't do this, then
371 // the first click to other parts of the UI is eaten. 371 // the first click to other parts of the UI is eaten.
372 SetMouseHandler(NULL); 372 SetMouseHandler(NULL);
373 } 373 }
374 374
375 //////////////////////////////////////////////////////////////////////////////// 375 ////////////////////////////////////////////////////////////////////////////////
376 // NativeComboboxWrapper, public: 376 // NativeComboboxWrapper, public:
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698