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

Unified Diff: chrome/browser/ui/views/frame/browser_frame_aura.cc

Issue 11085053: Improving window auto management between workspaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed a part of the change which slipped in through a branch switch and eclipse usage Created 8 years, 2 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
Index: chrome/browser/ui/views/frame/browser_frame_aura.cc
diff --git a/chrome/browser/ui/views/frame/browser_frame_aura.cc b/chrome/browser/ui/views/frame/browser_frame_aura.cc
index db9af3f4d66e3e56ac6692c5a81d6f570bd40337..afc7c0893debd586db9b281364e1871a6fd4b48c 100644
--- a/chrome/browser/ui/views/frame/browser_frame_aura.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_aura.cc
@@ -23,6 +23,7 @@
#if defined(USE_ASH)
#include "ash/wm/property_util.h"
+#include "ash/wm/window_util.h"
#endif
#if !defined(OS_CHROMEOS)
@@ -109,6 +110,11 @@ BrowserFrameAura::BrowserFrameAura(BrowserFrame* browser_frame,
GetNativeWindow(),
ash::WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_NO);
}
+ // Turn on auto window management if we don't need an explicit bounds.
+ // This way the requested bounds are honored.
+ if (!browser_view->browser()->bounds_overridden() &&
+ !browser_view->browser()->is_session_restore())
+ SetWindowAutoManaged();
#endif
}
@@ -160,8 +166,13 @@ void BrowserFrameAura::OnWindowTargetVisibilityChanged(bool visible) {
// RestoreFocus() when we become visible, which results in the web contents
// being asked to focus, which places focus either in the web contents or in
// the location bar as appropriate.
- if (visible)
+ if (visible) {
+ // Once the window has been shown we know the requested bounds
+ // (if provided) have been honored and we can switch on window management.
+ SetWindowAutoManaged();
+
browser_view_->RestoreFocus();
+ }
views::NativeWidgetAura::OnWindowTargetVisibilityChanged(visible);
}
@@ -219,3 +230,11 @@ NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame(
BrowserFrameAura::~BrowserFrameAura() {
}
+
+void BrowserFrameAura::SetWindowAutoManaged() {
+#if defined(USE_ASH)
+ if (browser_view_->browser()->type() != Browser::TYPE_POPUP ||
+ browser_view_->browser()->is_app())
+ ash::wm::SetWindowPositionManaged(GetNativeWindow(), true);
+#endif
+}
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_aura.h ('k') | chrome/browser/ui/views/tabs/tab_drag_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698