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..62dc34ac6e1a176fb967a565c5358f3f14867513 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" |
@@ -108,6 +109,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 +840,11 @@ void WmWindowAura::RemoveLimitedPreTargetHandler(ui::EventHandler* handler) { |
window_->RemovePreTargetHandler(handler); |
} |
+// static |
+bool WmWindowAura::HasInstance(const aura::Window* window) { |
+ return window->GetProperty(kWmWindowKey) != nullptr; |
+} |
+ |
void WmWindowAura::OnWindowHierarchyChanging( |
const HierarchyChangeParams& params) { |
WmWindowObserver::TreeChangeParams wm_params; |