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

Unified Diff: ash/wm/window_util.cc

Issue 24108003: [Cleanup] Rename WindowSettings to WindowState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase fix Created 7 years, 3 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/window_util.h ('k') | ash/wm/workspace/auto_window_management.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_util.cc
diff --git a/ash/wm/window_util.cc b/ash/wm/window_util.cc
index 19028b848dd352686a07f6ca991eeb037a3391ad..6d85c833dd4d6df3cfeb806c026d91fa4bf5ded7 100644
--- a/ash/wm/window_util.cc
+++ b/ash/wm/window_util.cc
@@ -7,16 +7,12 @@
#include <vector>
#include "ash/ash_constants.h"
-#include "ash/root_window_controller.h"
#include "ash/shell.h"
-#include "ash/shell_window_ids.h"
#include "ash/wm/window_properties.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
-#include "ui/aura/window_delegate.h"
-#include "ui/compositor/layer.h"
#include "ui/gfx/display.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/screen.h"
@@ -53,79 +49,11 @@ bool CanActivateWindow(aura::Window* window) {
return views::corewm::CanActivateWindow(window);
}
-bool CanMaximizeWindow(const aura::Window* window) {
- return window->GetProperty(aura::client::kCanMaximizeKey);
-}
-
-bool CanMinimizeWindow(const aura::Window* window) {
- internal::RootWindowController* controller =
- internal::RootWindowController::ForWindow(window);
- if (!controller)
- return false;
- aura::Window* lockscreen = controller->GetContainer(
- internal::kShellWindowId_LockScreenContainersContainer);
- if (lockscreen->Contains(window))
- return false;
-
- return true;
-}
-
-bool CanResizeWindow(const aura::Window* window) {
- return window->GetProperty(aura::client::kCanResizeKey);
-}
-
-bool CanSnapWindow(aura::Window* window) {
- if (!CanResizeWindow(window))
- return false;
- if (window->type() == aura::client::WINDOW_TYPE_PANEL)
- return false;
- // If a window has a maximum size defined, snapping may make it too big.
- return window->delegate() ? window->delegate()->GetMaximumSize().IsEmpty() :
- true;
-}
-
-bool IsWindowNormal(const aura::Window* window) {
- return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey));
-}
-
-bool IsWindowStateNormal(ui::WindowShowState state) {
- return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT;
-}
-
-bool IsWindowMaximized(const aura::Window* window) {
- return window->GetProperty(aura::client::kShowStateKey) ==
- ui::SHOW_STATE_MAXIMIZED;
-}
-
-bool IsWindowMinimized(const aura::Window* window) {
+bool IsWindowMinimized(aura::Window* window) {
return window->GetProperty(aura::client::kShowStateKey) ==
ui::SHOW_STATE_MINIMIZED;
}
-bool IsWindowFullscreen(const aura::Window* window) {
- return window->GetProperty(aura::client::kShowStateKey) ==
- ui::SHOW_STATE_FULLSCREEN;
-}
-
-void MaximizeWindow(aura::Window* window) {
- window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
-}
-
-void MinimizeWindow(aura::Window* window) {
- window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
-}
-
-void RestoreWindow(aura::Window* window) {
- window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL);
-}
-
-void ToggleMaximizedWindow(aura::Window* window) {
- if (ash::wm::IsWindowMaximized(window))
- ash::wm::RestoreWindow(window);
- else if (ash::wm::CanMaximizeWindow(window))
- ash::wm::MaximizeWindow(window);
-}
-
void CenterWindow(aura::Window* window) {
const gfx::Display display =
Shell::GetScreen()->GetDisplayNearestWindow(window);
@@ -138,16 +66,6 @@ void SetAnimateToFullscreen(aura::Window* window, bool animate) {
window->SetProperty(ash::internal::kAnimateToFullscreenKey, animate);
}
-const gfx::Rect* GetPreAutoManageWindowBounds(const aura::Window* window) {
- return window->GetProperty(ash::internal::kPreAutoManagedWindowBoundsKey);
-}
-
-void SetPreAutoManageWindowBounds(aura::Window* window,
- const gfx::Rect& bounds) {
- window->SetProperty(ash::internal::kPreAutoManagedWindowBoundsKey,
- new gfx::Rect(bounds));
-}
-
void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area,
gfx::Rect* bounds) {
AdjustBoundsToEnsureWindowVisibility(
« no previous file with comments | « ash/wm/window_util.h ('k') | ash/wm/workspace/auto_window_management.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698