Commit 57dbc99b authored by wittman@chromium.org's avatar wittman@chromium.org

Revert 220417 "[temporary M30 fix] Disable dragging tabs with we..."

Reverting per the original change description.

> [temporary M30 fix] Disable dragging tabs with web contents modal dialogs displayed
> 
> The full fix for the crashes in the associated bugs in trunk is too
> risky to merge into M30. After discussions among kareng and sky, the
> best approach was to disable dragging of tabs while a web contents modal
> dialog is displayed, to prevent the crashes. This only affects Chrome
> OS and will be reverted after testing in Canary and merging to the
> branch.
> 
> BUG=275274, 274856
> R=sky@chromium.org
> 
> Review URL: https://codereview.chromium.org/23698003

TBR=wittman@chromium.org
BUG=281831

Review URL: https://codereview.chromium.org/23814008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221834 0039d316-1c4b-4281-b951-d872f2087c98
parent 841e8b04
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "content/public/browser/user_metrics.h" #include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -39,7 +38,6 @@ ...@@ -39,7 +38,6 @@
using content::UserMetricsAction; using content::UserMetricsAction;
using content::WebContents; using content::WebContents;
using web_modal::WebContentsModalDialogManager;
namespace { namespace {
...@@ -366,15 +364,6 @@ void BrowserTabStripController::LayoutTypeMaybeChanged() { ...@@ -366,15 +364,6 @@ void BrowserTabStripController::LayoutTypeMaybeChanged() {
static_cast<int>(tabstrip_->layout_type())); static_cast<int>(tabstrip_->layout_type()));
} }
bool BrowserTabStripController::IsTabShowingWebViewModalDialog(int index) {
DCHECK(model_->ContainsIndex(index));
WebContentsModalDialogManager* contents_modal_dialog_manager =
WebContentsModalDialogManager::FromWebContents(
model_->GetWebContentsAt(index));
return contents_modal_dialog_manager &&
contents_modal_dialog_manager->IsShowingDialog();
}
void BrowserTabStripController::OnStartedDraggingTabs() { void BrowserTabStripController::OnStartedDraggingTabs() {
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
if (browser_view && !immersive_reveal_lock_.get()) { if (browser_view && !immersive_reveal_lock_.get()) {
......
...@@ -71,7 +71,6 @@ class BrowserTabStripController : public TabStripController, ...@@ -71,7 +71,6 @@ class BrowserTabStripController : public TabStripController,
virtual void CreateNewTab() OVERRIDE; virtual void CreateNewTab() OVERRIDE;
virtual bool IsIncognito() OVERRIDE; virtual bool IsIncognito() OVERRIDE;
virtual void LayoutTypeMaybeChanged() OVERRIDE; virtual void LayoutTypeMaybeChanged() OVERRIDE;
virtual bool IsTabShowingWebViewModalDialog(int index) OVERRIDE;
virtual void OnStartedDraggingTabs() OVERRIDE; virtual void OnStartedDraggingTabs() OVERRIDE;
virtual void OnStoppedDraggingTabs() OVERRIDE; virtual void OnStoppedDraggingTabs() OVERRIDE;
......
...@@ -115,10 +115,6 @@ bool FakeBaseTabStripController::IsIncognito() { ...@@ -115,10 +115,6 @@ bool FakeBaseTabStripController::IsIncognito() {
void FakeBaseTabStripController::LayoutTypeMaybeChanged() { void FakeBaseTabStripController::LayoutTypeMaybeChanged() {
} }
bool FakeBaseTabStripController::IsTabShowingWebViewModalDialog(int index) {
return false;
}
void FakeBaseTabStripController::OnStartedDraggingTabs() { void FakeBaseTabStripController::OnStartedDraggingTabs() {
} }
......
...@@ -48,7 +48,6 @@ class FakeBaseTabStripController : public TabStripController { ...@@ -48,7 +48,6 @@ class FakeBaseTabStripController : public TabStripController {
virtual void CreateNewTab() OVERRIDE; virtual void CreateNewTab() OVERRIDE;
virtual bool IsIncognito() OVERRIDE; virtual bool IsIncognito() OVERRIDE;
virtual void LayoutTypeMaybeChanged() OVERRIDE; virtual void LayoutTypeMaybeChanged() OVERRIDE;
virtual bool IsTabShowingWebViewModalDialog(int index) OVERRIDE;
virtual void OnStartedDraggingTabs() OVERRIDE; virtual void OnStartedDraggingTabs() OVERRIDE;
virtual void OnStoppedDraggingTabs() OVERRIDE; virtual void OnStoppedDraggingTabs() OVERRIDE;
......
...@@ -1127,16 +1127,6 @@ void TabStrip::MaybeStartDrag( ...@@ -1127,16 +1127,6 @@ void TabStrip::MaybeStartDrag(
gfx::Screen::GetScreenFor(widget->GetNativeView())->GetNumDisplays() == 1) gfx::Screen::GetScreenFor(widget->GetNativeView())->GetNumDisplays() == 1)
detach_behavior = TabDragController::NOT_DETACHABLE; detach_behavior = TabDragController::NOT_DETACHABLE;
#if defined(OS_CHROMEOS)
// TODO(wittman): This is a temporary workaround to avoid crbug.com/275274 and
// crbug.com/274856 in M30 and should be reverted after merge, as we have a
// solution to these bugs in trunk.
//
// Don't allow detaching if the tab has a WebContentsModalDialogView opened.
if (controller()->IsTabShowingWebViewModalDialog(GetModelIndexOfTab(tab)))
detach_behavior = TabDragController::NOT_DETACHABLE;
#endif
#if defined(OS_WIN) #if defined(OS_WIN)
// It doesn't make sense to drag tabs out on Win8's single window Metro mode. // It doesn't make sense to drag tabs out on Win8's single window Metro mode.
if (win8::IsSingleWindowMetroMode()) if (win8::IsSingleWindowMetroMode())
......
...@@ -99,10 +99,6 @@ class TabStripController { ...@@ -99,10 +99,6 @@ class TabStripController {
// Invoked if the layout type might have changed. // Invoked if the layout type might have changed.
virtual void LayoutTypeMaybeChanged() = 0; virtual void LayoutTypeMaybeChanged() = 0;
// Returns true if the tab at the given index is showing a web view modal
// dialog.
virtual bool IsTabShowingWebViewModalDialog(int index) = 0;
// Notifies controller that the user started dragging this tabstrip's tabs. // Notifies controller that the user started dragging this tabstrip's tabs.
virtual void OnStartedDraggingTabs() = 0; virtual void OnStartedDraggingTabs() = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment