summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 14:39:52 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 14:39:52 +0000
commit54fafc8b4df90b8a219fdc4d0f1c08ae013f4458 (patch)
treec0209f03916e0b4cef640d0e54d3576892e3a401 /chrome/browser
parent44c012f70c4664d8f44ebdd80764b52bf369a913 (diff)
downloadchromium_src-54fafc8b4df90b8a219fdc4d0f1c08ae013f4458.zip
chromium_src-54fafc8b4df90b8a219fdc4d0f1c08ae013f4458.tar.gz
chromium_src-54fafc8b4df90b8a219fdc4d0f1c08ae013f4458.tar.bz2
Turns on multi-tab selection by default on windows.
BUG=30572 TEST=make sure tab selection isn't broke. You should also be able to control click to toggle, shift-click to reset the selection, and control-shift to add to the selection. R=ben@chromium.org Review URL: http://codereview.chromium.org/6714016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/ui/views/tabs/base_tab.cc35
1 files changed, 14 insertions, 21 deletions
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index 1b55e07..4810411 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -287,26 +287,20 @@ bool BaseTab::OnMousePressed(const views::MouseEvent& event) {
return false;
if (event.IsOnlyLeftMouseButton()) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableMultiTabSelection)) {
- if (event.IsShiftDown() && event.IsControlDown()) {
- controller()->AddSelectionFromAnchorTo(this);
- } else if (event.IsShiftDown()) {
- controller()->ExtendSelectionTo(this);
- } else if (event.IsControlDown()) {
- controller()->ToggleSelected(this);
- if (!IsSelected()) {
- // Don't allow dragging non-selected tabs.
- return false;
- }
- } else if (!IsSelected()) {
- controller()->SelectTab(this);
+ if (event.IsShiftDown() && event.IsControlDown()) {
+ controller()->AddSelectionFromAnchorTo(this);
+ } else if (event.IsShiftDown()) {
+ controller()->ExtendSelectionTo(this);
+ } else if (event.IsControlDown()) {
+ controller()->ToggleSelected(this);
+ if (!IsSelected()) {
+ // Don't allow dragging non-selected tabs.
+ return false;
}
- controller()->MaybeStartDrag(this, event);
- } else {
+ } else if (!IsSelected()) {
controller()->SelectTab(this);
- controller()->MaybeStartDrag(this, event);
}
+ controller()->MaybeStartDrag(this, event);
}
return true;
}
@@ -344,12 +338,11 @@ void BaseTab::OnMouseReleased(const views::MouseEvent& event, bool canceled) {
if (closest_tab)
controller()->CloseTab(closest_tab);
}
- } else if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableMultiTabSelection) &&
- event.IsOnlyLeftMouseButton() && !event.IsShiftDown() &&
+ } else if (event.IsOnlyLeftMouseButton() && !event.IsShiftDown() &&
!event.IsControlDown()) {
// If the tab was already selected mouse pressed doesn't change the
- // selection. Reset it now.
+ // selection. Reset it now to handle the case where multiple tabs were
+ // selected.
controller()->SelectTab(this);
}
}