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

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

Issue 1456963002: Make browser windows override_redirect when dragging tabs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make browser windows override_redirect when dragging tabs. Created 4 years, 11 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/frame/browser_frame.cc ('k') | ui/aura/window_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index e604c7c47692ca25ace806a1355c3f0626e444db..b1b8a310541a2b509788fc972cbb6535acade6c6 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -29,6 +29,7 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_function_dispatcher.h"
+#include "ui/aura/window_tree_host.h"
#include "ui/events/event_constants.h"
#include "ui/events/gestures/gesture_recognizer.h"
#include "ui/gfx/geometry/point_conversions.h"
@@ -1499,6 +1500,13 @@ void TabDragController::CompleteDrag() {
DCHECK(started_drag_);
if (attached_tabstrip_) {
+ if (is_dragging_new_browser_) {
+ // Remap the window without override-redirect, so that the window manager
+ // will pick it up (we use an unmanaged window while dragging).
+ GetAttachedBrowserWidget()->GetNativeView()->GetHost()->
+ RemapAsNormalWindow();
+ }
+
if (is_dragging_new_browser_ || did_restore_window_) {
if (IsDockedOrSnapped(attached_tabstrip_)) {
was_source_maximized_ = false;
@@ -1750,6 +1758,7 @@ Browser* TabDragController::CreateBrowserForDrag(
profile,
host_desktop_type_);
create_params.initial_bounds = new_bounds;
+ create_params.is_being_dragged = true;
Browser* browser = new Browser(create_params);
is_dragging_new_browser_ = true;
SetWindowPositionManaged(browser->window()->GetNativeWindow(), false);
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame.cc ('k') | ui/aura/window_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698