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

Side by Side Diff: trunk/src/chrome/browser/ui/views/tabs/tab_strip.cc

Issue 23814008: Revert 220417 "[temporary M30 fix] Disable dragging tabs with we..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/ui/views/tabs/tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/tab_strip.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windowsx.h> 8 #include <windowsx.h>
9 #endif 9 #endif
10 10
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 // is maximized or fullscreen, we know there are no other tabbed browsers the 1120 // is maximized or fullscreen, we know there are no other tabbed browsers the
1121 // user can drag to. 1121 // user can drag to.
1122 const chrome::HostDesktopType host_desktop_type = 1122 const chrome::HostDesktopType host_desktop_type =
1123 chrome::GetHostDesktopTypeForNativeView(widget->GetNativeView()); 1123 chrome::GetHostDesktopTypeForNativeView(widget->GetNativeView());
1124 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH && 1124 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH &&
1125 (widget->IsMaximized() || widget->IsFullscreen()) && 1125 (widget->IsMaximized() || widget->IsFullscreen()) &&
1126 static_cast<int>(tabs.size()) == tab_count() && 1126 static_cast<int>(tabs.size()) == tab_count() &&
1127 gfx::Screen::GetScreenFor(widget->GetNativeView())->GetNumDisplays() == 1) 1127 gfx::Screen::GetScreenFor(widget->GetNativeView())->GetNumDisplays() == 1)
1128 detach_behavior = TabDragController::NOT_DETACHABLE; 1128 detach_behavior = TabDragController::NOT_DETACHABLE;
1129 1129
1130 #if defined(OS_CHROMEOS)
1131 // TODO(wittman): This is a temporary workaround to avoid crbug.com/275274 and
1132 // crbug.com/274856 in M30 and should be reverted after merge, as we have a
1133 // solution to these bugs in trunk.
1134 //
1135 // Don't allow detaching if the tab has a WebContentsModalDialogView opened.
1136 if (controller()->IsTabShowingWebViewModalDialog(GetModelIndexOfTab(tab)))
1137 detach_behavior = TabDragController::NOT_DETACHABLE;
1138 #endif
1139
1140 #if defined(OS_WIN) 1130 #if defined(OS_WIN)
1141 // It doesn't make sense to drag tabs out on Win8's single window Metro mode. 1131 // It doesn't make sense to drag tabs out on Win8's single window Metro mode.
1142 if (win8::IsSingleWindowMetroMode()) 1132 if (win8::IsSingleWindowMetroMode())
1143 detach_behavior = TabDragController::NOT_DETACHABLE; 1133 detach_behavior = TabDragController::NOT_DETACHABLE;
1144 #endif 1134 #endif
1145 // Gestures don't automatically do a capture. We don't allow multiple drags at 1135 // Gestures don't automatically do a capture. We don't allow multiple drags at
1146 // the same time, so we explicitly capture. 1136 // the same time, so we explicitly capture.
1147 if (event.type() == ui::ET_GESTURE_BEGIN) 1137 if (event.type() == ui::ET_GESTURE_BEGIN)
1148 widget->SetCapture(this); 1138 widget->SetCapture(this);
1149 drag_controller_.reset(new TabDragController); 1139 drag_controller_.reset(new TabDragController);
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
2722 if (!adjust_layout_) 2712 if (!adjust_layout_)
2723 return false; 2713 return false;
2724 2714
2725 #if !defined(OS_CHROMEOS) 2715 #if !defined(OS_CHROMEOS)
2726 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH) 2716 if (ui::GetDisplayLayout() != ui::LAYOUT_TOUCH)
2727 return false; 2717 return false;
2728 #endif 2718 #endif
2729 2719
2730 return true; 2720 return true;
2731 } 2721 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698