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

Unified Diff: ash/wm/show_state_controller.cc

Issue 9113045: Reworks the workspace code. Here's the new heuristics: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged and all that good stuff. Created 8 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 | « ash/wm/show_state_controller.h ('k') | ash/wm/window_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/show_state_controller.cc
diff --git a/ash/wm/show_state_controller.cc b/ash/wm/show_state_controller.cc
deleted file mode 100644
index 9b670c784f2cc1f44621d6745a8d312377a5ce9f..0000000000000000000000000000000000000000
--- a/ash/wm/show_state_controller.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/wm/show_state_controller.h"
-
-#include "ash/wm/property_util.h"
-#include "ash/wm/workspace/workspace.h"
-#include "ash/wm/workspace/workspace_manager.h"
-#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/window.h"
-#include "ui/base/ui_base_types.h"
-
-namespace ash {
-namespace internal {
-
-ShowStateController::ShowStateController(
- WorkspaceManager* workspace_manager)
- : workspace_manager_(workspace_manager) {
-}
-
-ShowStateController::~ShowStateController() {
-}
-
-void ShowStateController::OnWindowPropertyChanged(aura::Window* window,
- const char* name,
- void* old) {
- if (name != aura::client::kShowStateKey)
- return;
- if (window->GetIntProperty(name) == ui::SHOW_STATE_NORMAL) {
- // Restore the size of window first, then let Workspace layout the window.
- const gfx::Rect* restore = GetRestoreBounds(window);
- window->SetProperty(aura::client::kRestoreBoundsKey, NULL);
- if (restore)
- window->SetBounds(*restore);
- delete restore;
- } else if (old == reinterpret_cast<void*>(ui::SHOW_STATE_NORMAL)) {
- // Store the restore bounds only if previous state is normal.
- DCHECK(window->GetProperty(aura::client::kRestoreBoundsKey) == NULL);
- SetRestoreBounds(window, window->GetTargetBounds());
- }
-
- workspace_manager_->FindBy(window)->Layout(window);
-}
-
-} // namespace internal
-} // namespace ash
« no previous file with comments | « ash/wm/show_state_controller.h ('k') | ash/wm/window_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698