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

Side by Side Diff: ash/wm/window_util.cc

Issue 10803037: [WIP] ash/extensions: Add experimental extension support for window-management in ash. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-152100 Created 8 years, 4 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
« no previous file with comments | « ash/wm/window_util.h ('k') | chrome/browser/extensions/api/wm/wm_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/window_util.h" 5 #include "ash/wm/window_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/activation_controller.h" 10 #include "ash/wm/activation_controller.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 bool CanActivateWindow(aura::Window* window) { 56 bool CanActivateWindow(aura::Window* window) {
57 DCHECK(window); 57 DCHECK(window);
58 if (!window->GetRootWindow()) 58 if (!window->GetRootWindow())
59 return false; 59 return false;
60 aura::client::ActivationClient* client = 60 aura::client::ActivationClient* client =
61 aura::client::GetActivationClient(window->GetRootWindow()); 61 aura::client::GetActivationClient(window->GetRootWindow());
62 return client && client->CanActivateWindow(window); 62 return client && client->CanActivateWindow(window);
63 } 63 }
64 64
65 bool IsWindowNormal(aura::Window* window) { 65 bool IsWindowNormal(const aura::Window* window) {
66 return window->GetProperty(aura::client::kShowStateKey) == 66 return window->GetProperty(aura::client::kShowStateKey) ==
67 ui::SHOW_STATE_NORMAL || 67 ui::SHOW_STATE_NORMAL ||
68 window->GetProperty(aura::client::kShowStateKey) == 68 window->GetProperty(aura::client::kShowStateKey) ==
69 ui::SHOW_STATE_DEFAULT; 69 ui::SHOW_STATE_DEFAULT;
70 } 70 }
71 71
72 bool IsWindowMaximized(aura::Window* window) { 72 bool IsWindowMaximized(const aura::Window* window) {
73 return window->GetProperty(aura::client::kShowStateKey) == 73 return window->GetProperty(aura::client::kShowStateKey) ==
74 ui::SHOW_STATE_MAXIMIZED; 74 ui::SHOW_STATE_MAXIMIZED;
75 } 75 }
76 76
77 bool IsWindowMinimized(aura::Window* window) { 77 bool IsWindowMinimized(const aura::Window* window) {
78 return window->GetProperty(aura::client::kShowStateKey) == 78 return window->GetProperty(aura::client::kShowStateKey) ==
79 ui::SHOW_STATE_MINIMIZED; 79 ui::SHOW_STATE_MINIMIZED;
80 } 80 }
81 81
82 bool IsWindowFullscreen(aura::Window* window) { 82 bool IsWindowFullscreen(const aura::Window* window) {
83 return window->GetProperty(aura::client::kShowStateKey) == 83 return window->GetProperty(aura::client::kShowStateKey) ==
84 ui::SHOW_STATE_FULLSCREEN; 84 ui::SHOW_STATE_FULLSCREEN;
85 } 85 }
86 86
87 void MaximizeWindow(aura::Window* window) { 87 void MaximizeWindow(aura::Window* window) {
88 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); 88 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
89 } 89 }
90 90
91 void MinimizeWindow(aura::Window* window) { 91 void MinimizeWindow(aura::Window* window) {
92 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); 92 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 it != children.end(); 127 it != children.end();
128 ++it) { 128 ++it) {
129 ui::Layer* child = *it; 129 ui::Layer* child = *it;
130 DeepDeleteLayers(child); 130 DeepDeleteLayers(child);
131 } 131 }
132 delete layer; 132 delete layer;
133 } 133 }
134 134
135 } // namespace wm 135 } // namespace wm
136 } // namespace ash 136 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_util.h ('k') | chrome/browser/extensions/api/wm/wm_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698