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

Side by Side Diff: views/controls/menu/menu_controller.cc

Issue 291006: Control Click to all bookmarks in folder in background tabs. This currently w... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « views/controls/button/menu_button.cc ('k') | 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 "views/controls/menu/menu_controller.h" 5 #include "views/controls/menu/menu_controller.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/os_exchange_data.h" 9 #include "app/os_exchange_data.h"
10 #include "base/keyboard_codes.h" 10 #include "base/keyboard_codes.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 SetSelection(pending_state_.item, open_submenu, true); 434 SetSelection(pending_state_.item, open_submenu, true);
435 gfx::Point loc(event.location()); 435 gfx::Point loc(event.location());
436 View::ConvertPointToScreen(source->GetScrollViewContainer(), &loc); 436 View::ConvertPointToScreen(source->GetScrollViewContainer(), &loc);
437 437
438 // If we open a context menu just return now 438 // If we open a context menu just return now
439 if (part.menu->GetDelegate()->ShowContextMenu( 439 if (part.menu->GetDelegate()->ShowContextMenu(
440 part.menu, part.menu->GetCommand(), loc.x(), loc.y(), true)) 440 part.menu, part.menu->GetCommand(), loc.x(), loc.y(), true))
441 return; 441 return;
442 } 442 }
443 443
444 if (!part.is_scroll() && part.menu && !part.menu->HasSubmenu()) { 444 // We can use Ctrl+click or the middle mouse button to recursively open urls
445 // for selected folder menu items. If it's only a left click, show the
446 // contents of the folder.
447 if (!part.is_scroll() && part.menu && !(part.menu->HasSubmenu() &&
448 (event.GetFlags() == MouseEvent::EF_LEFT_BUTTON_DOWN))) {
445 if (part.menu->GetDelegate()->IsTriggerableEvent(event)) { 449 if (part.menu->GetDelegate()->IsTriggerableEvent(event)) {
446 Accept(part.menu, event.GetFlags()); 450 Accept(part.menu, event.GetFlags());
447 return; 451 return;
448 } 452 }
449 } else if (part.type == MenuPart::MENU_ITEM) { 453 } else if (part.type == MenuPart::MENU_ITEM) {
450 // User either clicked on empty space, or a menu that has children. 454 // User either clicked on empty space, or a menu that has children.
451 SetSelection(part.menu ? part.menu : state_.item, true, true); 455 SetSelection(part.menu ? part.menu : state_.item, true, true);
452 } 456 }
453 } 457 }
454 458
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 if (!scroll_task_.get()) 1408 if (!scroll_task_.get())
1405 scroll_task_.reset(new MenuScrollTask()); 1409 scroll_task_.reset(new MenuScrollTask());
1406 scroll_task_->Update(part); 1410 scroll_task_->Update(part);
1407 } 1411 }
1408 1412
1409 void MenuController::StopScrolling() { 1413 void MenuController::StopScrolling() {
1410 scroll_task_.reset(NULL); 1414 scroll_task_.reset(NULL);
1411 } 1415 }
1412 1416
1413 } // namespace views 1417 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/menu_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698