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

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

Issue 9566014: Attempt 2: Allows tab dragging when maximized on aura. To fix it I made it so (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Created 8 years, 10 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 | « chrome/browser/ui/views/tabs/tab_drag_controller2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_drag_controller2.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller2.cc b/chrome/browser/ui/views/tabs/tab_drag_controller2.cc
index af419d6734f26236170a61c7209d5d65cef5b2f4..a66bd36a068b7bf9dc6ac99d23827843275f24e5 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller2.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller2.cc
@@ -40,6 +40,10 @@
#include "ui/views/widget/root_view.h"
#include "ui/views/widget/widget.h"
+#if defined(USE_AURA)
+#include "ash/wm/property_util.h"
+#endif
+
using content::UserMetricsAction;
using content::WebContents;
@@ -322,8 +326,11 @@ TabDragController2::~TabDragController2() {
if (destroyed_)
*destroyed_ = true;
- if (move_loop_browser_view_)
+ if (move_loop_browser_view_) {
move_loop_browser_view_->set_move_observer(NULL);
+ SetTrackedByWorkspace(
+ move_loop_browser_view_->GetWidget()->GetNativeView(), true);
+ }
if (source_tabstrip_)
GetModel(source_tabstrip_)->RemoveObserver(this);
@@ -1096,6 +1103,11 @@ void TabDragController2::EndDragImpl(EndDragType type) {
bring_to_front_timer_.Stop();
if (is_dragging_window_) {
+ if (type == NORMAL || (type == TAB_DESTROYED && drag_data_.size() > 1)) {
+ SetTrackedByWorkspace(
+ GetAttachedBrowserView()->GetWidget()->GetNativeView(), true);
+ }
+
// End the nested drag loop.
GetAttachedBrowserView()->GetWidget()->EndMoveLoop();
waiting_for_run_loop_to_exit_ = true;
@@ -1391,6 +1403,14 @@ Browser* TabDragController2::CreateBrowserForDrag(
break; // Nothing to do for DETACH_ABOVE_OR_BELOW.
}
+ SetTrackedByWorkspace(browser->window()->GetNativeHandle(), false);
browser->window()->SetBounds(new_bounds);
return browser;
}
+
+void TabDragController2::SetTrackedByWorkspace(gfx::NativeWindow window,
+ bool value) {
+#if defined(USE_AURA)
+ ash::SetTrackedByWorkspace(window, value);
+#endif
+}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698