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

Unified Diff: ash/aura/wm_window_aura.cc

Issue 2539363005: Converts ash to use aura-mus (Closed)
Patch Set: add overrides Created 4 years 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/aura/wm_window_aura.h ('k') | ash/autoclick/mus/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/aura/wm_window_aura.cc
diff --git a/ash/aura/wm_window_aura.cc b/ash/aura/wm_window_aura.cc
index ce8d0e5491dd3ec4a3c631a252a25e6a1d58907d..230077c79011f7ffe7797efb92a5645f60608b28 100644
--- a/ash/aura/wm_window_aura.cc
+++ b/ash/aura/wm_window_aura.cc
@@ -29,6 +29,7 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/client/window_parenting_client.h"
+#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
@@ -85,14 +86,6 @@ class BoundsSetter : public aura::LayoutManager {
} // namespace
-WmWindowAura::WmWindowAura(aura::Window* window)
- : window_(window),
- // Mirrors that of aura::Window.
- observers_(base::ObserverList<WmWindowObserver>::NOTIFY_EXISTING_ONLY) {
- window_->AddObserver(this);
- window_->SetProperty(kWmWindowKey, this);
-}
-
WmWindowAura::~WmWindowAura() {
if (added_transient_observer_)
::wm::TransientWindowManager::Get(window_)->RemoveObserver(this);
@@ -108,6 +101,7 @@ const WmWindow* WmWindowAura::Get(const aura::Window* window) {
const WmWindow* wm_window = window->GetProperty(kWmWindowKey);
if (wm_window)
return wm_window;
+ DCHECK_EQ(aura::Env::Mode::LOCAL, aura::Env::GetInstance()->mode());
// WmWindowAura is owned by the aura::Window.
// TODO(sky): fix constness.
return new WmWindowAura(const_cast<aura::Window*>(window));
@@ -838,6 +832,19 @@ void WmWindowAura::RemoveLimitedPreTargetHandler(ui::EventHandler* handler) {
window_->RemovePreTargetHandler(handler);
}
+WmWindowAura::WmWindowAura(aura::Window* window)
+ : window_(window),
+ // Mirrors that of aura::Window.
+ observers_(base::ObserverList<WmWindowObserver>::NOTIFY_EXISTING_ONLY) {
+ window_->AddObserver(this);
+ window_->SetProperty(kWmWindowKey, this);
+}
+
+// static
+bool WmWindowAura::HasInstance(const aura::Window* window) {
+ return window->GetProperty(kWmWindowKey) != nullptr;
+}
+
void WmWindowAura::OnWindowHierarchyChanging(
const HierarchyChangeParams& params) {
WmWindowObserver::TreeChangeParams wm_params;
« no previous file with comments | « ash/aura/wm_window_aura.h ('k') | ash/autoclick/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698