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

Unified Diff: components/mus/ws/window_server_test_impl.cc

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 | « components/mus/ws/window_server_test_impl.h ('k') | components/mus/ws/window_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_server_test_impl.cc
diff --git a/components/mus/ws/window_server_test_impl.cc b/components/mus/ws/window_server_test_impl.cc
deleted file mode 100644
index a61eb2d2bc97e17a65205e043bda6508f79b3834..0000000000000000000000000000000000000000
--- a/components/mus/ws/window_server_test_impl.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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 "components/mus/ws/window_server_test_impl.h"
-
-#include "components/mus/public/interfaces/window_tree.mojom.h"
-#include "components/mus/ws/server_window.h"
-#include "components/mus/ws/server_window_surface_manager.h"
-#include "components/mus/ws/window_server.h"
-#include "components/mus/ws/window_tree.h"
-
-namespace mus {
-namespace ws {
-
-namespace {
-
-bool WindowHasValidFrame(const ServerWindow* window) {
- const ServerWindowSurfaceManager* manager = window->surface_manager();
- return manager &&
- !manager->GetDefaultSurface()->last_submitted_frame_size().IsEmpty();
-}
-
-} // namespace
-
-WindowServerTestImpl::WindowServerTestImpl(
- WindowServer* window_server,
- mojo::InterfaceRequest<WindowServerTest> request)
- : window_server_(window_server), binding_(this, std::move(request)) {}
-
-WindowServerTestImpl::~WindowServerTestImpl() {}
-
-void WindowServerTestImpl::OnWindowPaint(
- const std::string& name,
- const EnsureClientHasDrawnWindowCallback& cb,
- ServerWindow* window) {
- WindowTree* tree = window_server_->GetTreeWithClientName(name);
- if (!tree)
- return;
- if (tree->HasRoot(window) && WindowHasValidFrame(window)) {
- cb.Run(true);
- window_server_->SetPaintCallback(base::Callback<void(ServerWindow*)>());
- }
-}
-
-void WindowServerTestImpl::EnsureClientHasDrawnWindow(
- const mojo::String& client_name,
- const EnsureClientHasDrawnWindowCallback& callback) {
- std::string name = client_name.To<std::string>();
- WindowTree* tree = window_server_->GetTreeWithClientName(name);
- if (tree) {
- for (const ServerWindow* window : tree->roots()) {
- if (WindowHasValidFrame(window)) {
- callback.Run(true);
- return;
- }
- }
- }
-
- window_server_->SetPaintCallback(
- base::Bind(&WindowServerTestImpl::OnWindowPaint, base::Unretained(this),
- name, std::move(callback)));
-}
-
-} // namespace ws
-} // namespace mus
« no previous file with comments | « components/mus/ws/window_server_test_impl.h ('k') | components/mus/ws/window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698