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

Unified Diff: ui/aura_shell/toplevel_layout_manager.cc

Issue 8895003: Aura: Add --aura-laptop-mode to fill the workspace with a single window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix unit test build Created 9 years 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 | « ui/aura_shell/toplevel_layout_manager.h ('k') | ui/aura_shell/toplevel_window_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/toplevel_layout_manager.cc
diff --git a/ui/aura_shell/toplevel_layout_manager.cc b/ui/aura_shell/toplevel_layout_manager.cc
index 05d5f474c23de0cebb1c12be25236c296ed5cd6d..32ccc56d8da9182c2f71299a0e887c02b1b89840 100644
--- a/ui/aura_shell/toplevel_layout_manager.cc
+++ b/ui/aura_shell/toplevel_layout_manager.cc
@@ -6,12 +6,9 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
-#include "ui/aura_shell/property_util.h"
#include "ui/aura_shell/shelf_layout_manager.h"
-#include "ui/aura_shell/workspace/workspace.h"
-#include "ui/aura_shell/workspace/workspace_manager.h"
+#include "ui/aura_shell/window_util.h"
#include "ui/base/ui_base_types.h"
-#include "ui/gfx/screen.h"
namespace aura_shell {
namespace internal {
@@ -30,8 +27,10 @@ void ToplevelLayoutManager::OnWindowResized() {
void ToplevelLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
windows_.insert(child);
child->AddObserver(this);
- if (child->GetProperty(aura::kShowStateKey))
- WindowStateChanged(child);
+ if (child->GetProperty(aura::kShowStateKey)) {
+ UpdateBoundsFromShowState(child);
+ UpdateShelfVisibility();
+ }
}
void ToplevelLayoutManager::OnWillRemoveWindowFromLayout(
@@ -54,36 +53,10 @@ void ToplevelLayoutManager::SetChildBounds(aura::Window* child,
void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window,
const char* name,
void* old) {
- if (name == aura::kShowStateKey)
- WindowStateChanged(window);
-}
-
-void ToplevelLayoutManager::WindowStateChanged(aura::Window* window) {
- switch (window->GetIntProperty(aura::kShowStateKey)) {
- case ui::SHOW_STATE_NORMAL: {
- const gfx::Rect* restore = GetRestoreBounds(window);
- window->SetProperty(aura::kRestoreBoundsKey, NULL);
- if (restore)
- window->SetBounds(*restore);
- delete restore;
- break;
- }
-
- case ui::SHOW_STATE_MAXIMIZED:
- SetRestoreBoundsIfNotSet(window);
- window->SetBounds(gfx::Screen::GetMonitorWorkAreaNearestWindow(window));
- break;
-
- case ui::SHOW_STATE_FULLSCREEN:
- SetRestoreBoundsIfNotSet(window);
- window->SetBounds(gfx::Screen::GetMonitorAreaNearestWindow(window));
- break;
-
- default:
- break;
+ if (name == aura::kShowStateKey) {
+ UpdateBoundsFromShowState(window);
+ UpdateShelfVisibility();
}
-
- UpdateShelfVisibility();
}
void ToplevelLayoutManager::UpdateShelfVisibility() {
« no previous file with comments | « ui/aura_shell/toplevel_layout_manager.h ('k') | ui/aura_shell/toplevel_window_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698