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

Unified Diff: ash/wm/workspace/workspace_layout_manager.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 | « ash/wm/workspace/workspace_layout_manager.h ('k') | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_layout_manager.cc
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index 0ac362cda8f2b5183630dee9406a5538fcb0d973..b1f8f6605cf12258670411d0b39e58b76098b21c 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -8,6 +8,7 @@
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/workspace.h"
#include "ash/wm/workspace/workspace_manager.h"
+#include "ash/wm/workspace/workspace_window_resizer.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
@@ -29,13 +30,19 @@ WorkspaceLayoutManager::WorkspaceLayoutManager(
: workspace_manager_(workspace_manager) {
}
-WorkspaceLayoutManager::~WorkspaceLayoutManager() {}
+WorkspaceLayoutManager::~WorkspaceLayoutManager() {
+ const aura::Window::Windows& windows(
+ workspace_manager_->contents_view()->children());
+ for (size_t i = 0; i < windows.size(); ++i)
+ windows[i]->RemoveObserver(this);
+}
void WorkspaceLayoutManager::OnWindowResized() {
// Workspace is updated via RootWindowObserver::OnRootWindowResized.
}
void WorkspaceLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
+ child->AddObserver(this);
if (!workspace_manager_->IsManagedWindow(child))
return;
@@ -56,6 +63,7 @@ void WorkspaceLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(
aura::Window* child) {
+ child->RemoveObserver(this);
ClearRestoreBounds(child);
workspace_manager_->RemoveWindow(child);
}
@@ -75,16 +83,29 @@ void WorkspaceLayoutManager::SetChildBounds(
aura::Window* child,
const gfx::Rect& requested_bounds) {
gfx::Rect child_bounds(requested_bounds);
- if (wm::IsWindowMaximized(child)) {
- child_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow(child);
- } else if (wm::IsWindowFullscreen(child)) {
- child_bounds = gfx::Screen::GetMonitorAreaNearestWindow(child);
- } else {
- child_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow(child).
- AdjustToFit(requested_bounds);
+ if (GetTrackedByWorkspace(child)) {
+ if (wm::IsWindowMaximized(child)) {
+ child_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow(child);
+ } else if (wm::IsWindowFullscreen(child)) {
+ child_bounds = gfx::Screen::GetMonitorAreaNearestWindow(child);
+ } else {
+ child_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow(child).
+ AdjustToFit(requested_bounds);
+ }
}
SetChildBoundsDirect(child, child_bounds);
}
+void WorkspaceLayoutManager::OnWindowPropertyChanged(aura::Window* window,
+ const void* key,
+ intptr_t old) {
+ if (key == ash::kWindowTrackedByWorkspaceSplitPropKey &&
+ ash::GetTrackedByWorkspace(window)) {
+ // We currently don't need to support transitioning from true to false, so
+ // we ignore it.
+ workspace_manager_->AddWindow(window);
+ }
+}
+
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.h ('k') | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698