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

Side by Side Diff: chrome/views/menu.cc

Issue 41006: Fixes regression in menus. Specifically selecting by way of press,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/views/menu.h" 5 #include "chrome/views/menu.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcrack.h> 8 #include <atlcrack.h>
9 #include <atlapp.h> 9 #include <atlapp.h>
10 #include <atlframe.h> 10 #include <atlframe.h>
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 547
548 for (size_t i = 0; i < submenus_.size(); ++i) 548 for (size_t i = 0; i < submenus_.size(); ++i)
549 submenus_[i]->SetMenuInfo(); 549 submenus_[i]->SetMenuInfo();
550 } 550 }
551 551
552 void Menu::RunMenuAt(int x, int y) { 552 void Menu::RunMenuAt(int x, int y) {
553 SetMenuInfo(); 553 SetMenuInfo();
554 554
555 delegate_->MenuWillShow(); 555 delegate_->MenuWillShow();
556 556
557 // Show the menu. Blocks until the menu is dismissed or an item is chosen. 557 // NOTE: we don't use TPM_RIGHTBUTTON here as it breaks selecting by way of
558 // press, drag, release. See bugs 718 and 8560.
558 UINT flags = 559 UINT flags =
559 GetTPMAlignFlags() | TPM_RIGHTBUTTON | TPM_RETURNCMD | TPM_RECURSE; 560 GetTPMAlignFlags() | TPM_LEFTBUTTON | TPM_RETURNCMD | TPM_RECURSE;
560 is_menu_visible_ = true; 561 is_menu_visible_ = true;
561 DCHECK(owner_); 562 DCHECK(owner_);
562 // In order for context menus on menus to work, the context menu needs to 563 // In order for context menus on menus to work, the context menu needs to
563 // share the same window as the first menu is parented to. 564 // share the same window as the first menu is parented to.
564 bool created_host = false; 565 bool created_host = false;
565 if (!active_host_window) { 566 if (!active_host_window) {
566 created_host = true; 567 created_host = true;
567 active_host_window = new MenuHostWindow(this, owner_); 568 active_host_window = new MenuHostWindow(this, owner_);
568 } 569 }
569 UINT selected_id = 570 UINT selected_id =
(...skipping 11 matching lines...) Expand all
581 582
582 void Menu::Cancel() { 583 void Menu::Cancel() {
583 DCHECK(is_menu_visible_); 584 DCHECK(is_menu_visible_);
584 EndMenu(); 585 EndMenu();
585 } 586 }
586 587
587 int Menu::ItemCount() { 588 int Menu::ItemCount() {
588 return GetMenuItemCount(menu_); 589 return GetMenuItemCount(menu_);
589 } 590 }
590 591
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