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

Unified Diff: chrome/browser/ui/views/tabs/base_tab.cc

Issue 10213011: Attempt 3 at a better touch tabstrip. There is still a bunch to do, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove Tab::GetTouchModeMinimumSize Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/base_tab.cc
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index 1769bdcfd9afcd2fa5c4be48d1496759820ab76e..b7f2a0196e239dd366c87c580c53e51ba6975000 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -290,20 +290,24 @@ bool BaseTab::OnMousePressed(const views::MouseEvent& event) {
if (event.IsOnlyLeftMouseButton()) {
TabStripSelectionModel original_selection;
original_selection.Copy(controller()->GetSelectionModel());
- 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;
+ if (controller()->SupportsMultipleSelection()) {
+ 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);
+ } else if (IsActive()) {
+ controller()->ClickActiveTab(this);
}
} else if (!IsSelected()) {
controller()->SelectTab(this);
- } else if (IsActive()) {
- controller()->ClickActiveTab(this);
}
controller()->MaybeStartDrag(this, event, original_selection);
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698