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

Unified Diff: ash/wm/aura/wm_globals_aura.cc

Issue 1900443002: Removes aura dependencies from WindowPositioner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke GetWorkAreaForWindowInParent and fix windows Created 4 years, 8 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/aura/wm_globals_aura.h ('k') | ash/wm/aura/wm_root_window_controller_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/aura/wm_globals_aura.cc
diff --git a/ash/wm/aura/wm_globals_aura.cc b/ash/wm/aura/wm_globals_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..daa7082bdc251fe6b78ba03dfb8c01a596d4e0c7
--- /dev/null
+++ b/ash/wm/aura/wm_globals_aura.cc
@@ -0,0 +1,75 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/wm/aura/wm_globals_aura.h"
+
+#include "ash/session/session_state_delegate.h"
+#include "ash/shell.h"
+#include "ash/shell_delegate.h"
+#include "ash/wm/aura/wm_window_aura.h"
+#include "ash/wm/mru_window_tracker.h"
+#include "ash/wm/window_util.h"
+#include "ui/wm/public/activation_client.h"
+
+namespace ash {
+namespace wm {
+namespace {
+
+WmGlobalsAura* instance_ = nullptr;
+
+} // namespace
+
+// static
+WmGlobals* WmGlobals::Get() {
+ return instance_;
+}
+
+WmGlobalsAura::WmGlobalsAura() {
+ DCHECK(!instance_);
+ instance_ = this;
+}
+
+WmGlobalsAura::~WmGlobalsAura() {
+ instance_ = nullptr;
+}
+
+// static
+WmGlobalsAura* WmGlobalsAura::Get() {
+ if (!instance_)
+ new WmGlobalsAura;
+ return instance_;
+}
+
+WmWindow* WmGlobalsAura::GetActiveWindow() {
+ return WmWindowAura::Get(wm::GetActiveWindow());
+}
+
+WmWindow* WmGlobalsAura::GetRootWindowForNewWindows() {
+ return WmWindowAura::Get(Shell::GetTargetRootWindow());
+}
+
+std::vector<WmWindow*> WmGlobalsAura::GetMruWindowListIgnoreModals() {
+ const std::vector<aura::Window*> windows = ash::Shell::GetInstance()
+ ->mru_window_tracker()
+ ->BuildWindowListIgnoreModal();
+ std::vector<WmWindow*> wm_windows(windows.size());
+ for (size_t i = 0; i < windows.size(); ++i)
+ wm_windows[i] = WmWindowAura::Get(windows[i]);
+ return wm_windows;
+}
+
+bool WmGlobalsAura::IsForceMaximizeOnFirstRun() {
+ return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun();
+}
+
+std::vector<WmWindow*> WmGlobalsAura::GetAllRootWindows() {
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
+ std::vector<WmWindow*> wm_windows(root_windows.size());
+ for (size_t i = 0; i < root_windows.size(); ++i)
+ wm_windows[i] = WmWindowAura::Get(root_windows[i]);
+ return wm_windows;
+}
+
+} // namespace wm
+} // namespace ash
« no previous file with comments | « ash/wm/aura/wm_globals_aura.h ('k') | ash/wm/aura/wm_root_window_controller_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698