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

Unified Diff: ash/mus/screen_mus.cc

Issue 2539363005: Converts ash to use aura-mus (Closed)
Patch Set: merge 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
Index: ash/mus/screen_mus.cc
diff --git a/ash/mus/screen_mus.cc b/ash/mus/screen_mus.cc
new file mode 100644
index 0000000000000000000000000000000000000000..312eb9d6505ed29473565263396008d7b88e35f9
--- /dev/null
+++ b/ash/mus/screen_mus.cc
@@ -0,0 +1,26 @@
+// 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/mus/screen_mus.h"
+
+#include "ui/aura/mus/window_tree_host_mus.h"
+#include "ui/aura/window.h"
+
+namespace ash {
+
+ScreenMus::ScreenMus() = default;
+
+ScreenMus::~ScreenMus() = default;
+
+display::Display ScreenMus::GetDisplayNearestWindow(
+ aura::Window* window) const {
+ const aura::WindowTreeHost* host = window->GetHost();
+ if (!host)
+ return GetPrimaryDisplay();
+ auto iter = display_list().FindDisplayById(
+ static_cast<const aura::WindowTreeHostMus*>(host)->display_id());
+ return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter;
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698