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

Side by Side Diff: ash/wm/workspace/maximized_workspace.cc

Issue 11201002: Removes worskpace 1 code. Will rename next. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove more code 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/wm/workspace/maximized_workspace.h"
6
7 #include "ash/screen_ash.h"
8 #include "ash/wm/property_util.h"
9 #include "ash/wm/window_util.h"
10 #include "ash/wm/workspace/workspace_manager.h"
11 #include "base/logging.h"
12 #include "ui/aura/client/aura_constants.h"
13 #include "ui/aura/root_window.h"
14 #include "ui/aura/window.h"
15 #include "ui/base/ui_base_types.h"
16 #include "ui/gfx/screen.h"
17
18 namespace ash {
19 namespace internal {
20
21 MaximizedWorkspace::MaximizedWorkspace(WorkspaceManager* manager)
22 : Workspace(manager, TYPE_MAXIMIZED) {
23 }
24
25 MaximizedWorkspace::~MaximizedWorkspace() {
26 }
27
28 bool MaximizedWorkspace::CanAdd(aura::Window* window) const {
29 return is_empty() && (wm::IsWindowFullscreen(window) ||
30 wm::IsWindowMaximized(window));
31 }
32
33 void MaximizedWorkspace::OnWindowAddedAfter(aura::Window* window,
34 aura::Window* after) {
35 ResetWindowBounds(window);
36 }
37
38 void MaximizedWorkspace::OnWindowRemoved(aura::Window* window) {
39 }
40
41 void MaximizedWorkspace::ResetWindowBounds(aura::Window* window) {
42 if (wm::IsWindowFullscreen(window)) {
43 SetWindowBounds(window,
44 ScreenAsh::GetDisplayBoundsInParent(window));
45 } else {
46 SetWindowBounds(window,
47 ScreenAsh::GetMaximizedWindowBoundsInParent(window));
48 }
49 }
50
51 } // namespace internal
52 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698