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

Unified Diff: ash/wm/window_state_aura.cc

Issue 1943603002: Makes ash/wm/common a library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 7 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/drag_window_resizer.h ('k') | chrome/browser/ui/ash/window_positioner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_state_aura.cc
diff --git a/ash/wm/window_state_aura.cc b/ash/wm/window_state_aura.cc
index 9bd2b3a993cd4a9538541dd85d9cdf696480c091..2dfeb49a08017e4e31f47f79081c4bfb451a5cdc 100644
--- a/ash/wm/window_state_aura.cc
+++ b/ash/wm/window_state_aura.cc
@@ -12,6 +12,21 @@
namespace ash {
namespace wm {
+namespace {
+
+// This classes is used so that the WindowState constructor can be made
+// protected. GetWindowState() is the only place that should be creating
+// WindowState.
+class WindowStateAura : public wm::WindowState {
+ public:
+ explicit WindowStateAura(WmWindow* window) : wm::WindowState(window) {}
+ ~WindowStateAura() override {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WindowStateAura);
+};
+
+} // namespace
WindowState* GetActiveWindowState() {
aura::Window* active = GetActiveWindow();
@@ -23,7 +38,7 @@ WindowState* GetWindowState(aura::Window* window) {
return nullptr;
WindowState* settings = window->GetProperty(kWindowStateKey);
if (!settings) {
- settings = new WindowState(WmWindowAura::Get(window));
+ settings = new WindowStateAura(WmWindowAura::Get(window));
window->SetProperty(kWindowStateKey, settings);
}
return settings;
« no previous file with comments | « ash/wm/drag_window_resizer.h ('k') | chrome/browser/ui/ash/window_positioner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698