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

Unified Diff: components/mus/test_wm/test_wm.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/test_wm/manifest.json ('k') | components/mus/ws/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/test_wm/test_wm.cc
diff --git a/components/mus/test_wm/test_wm.cc b/components/mus/test_wm/test_wm.cc
deleted file mode 100644
index e48ccea0f152db0d3411d4c5f175fa241b2cf045..0000000000000000000000000000000000000000
--- a/components/mus/test_wm/test_wm.cc
+++ /dev/null
@@ -1,107 +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/public/cpp/window.h"
-#include "components/mus/public/cpp/window_manager_delegate.h"
-#include "components/mus/public/cpp/window_tree_client.h"
-#include "components/mus/public/cpp/window_tree_client_delegate.h"
-#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/bindings/binding.h"
-#include "services/shell/public/cpp/application_runner.h"
-#include "services/shell/public/cpp/connector.h"
-#include "services/shell/public/cpp/shell_client.h"
-#include "ui/display/display.h"
-#include "ui/display/mojo/display_type_converters.h"
-
-namespace mus {
-namespace test {
-
-class TestWM : public shell::ShellClient,
- public mus::WindowTreeClientDelegate,
- public mus::WindowManagerDelegate {
- public:
- TestWM() {}
- ~TestWM() override { delete window_tree_client_; }
-
- private:
- // shell::ShellClient:
- void Initialize(shell::Connector* connector,
- const shell::Identity& identity,
- uint32_t id) override {
- window_tree_client_ = new mus::WindowTreeClient(this, this, nullptr);
- window_tree_client_->ConnectAsWindowManager(connector);
- }
- bool AcceptConnection(shell::Connection* connection) override {
- return true;
- }
-
- // mus::WindowTreeClientDelegate:
- void OnEmbed(mus::Window* root) override {
- // WindowTreeClients configured as the window manager should never get
- // OnEmbed().
- NOTREACHED();
- }
- void OnDidDestroyClient(mus::WindowTreeClient* client) override {
- window_tree_client_ = nullptr;
- }
- void OnEventObserved(const ui::Event& event, mus::Window* target) override {
- // Don't care.
- }
-
- // mus::WindowManagerDelegate:
- void SetWindowManagerClient(mus::WindowManagerClient* client) override {
- window_manager_client_ = client;
- }
- bool OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) override {
- return true;
- }
- bool OnWmSetProperty(
- mus::Window* window,
- const std::string& name,
- std::unique_ptr<std::vector<uint8_t>>* new_data) override {
- return true;
- }
- mus::Window* OnWmCreateTopLevelWindow(
- std::map<std::string, std::vector<uint8_t>>* properties) override {
- mus::Window* window = root_->window_tree()->NewWindow(properties);
- window->SetBounds(gfx::Rect(10, 10, 500, 500));
- root_->AddChild(window);
- return window;
- }
- void OnWmClientJankinessChanged(const std::set<Window*>& client_windows,
- bool janky) override {
- // Don't care.
- }
- void OnWmNewDisplay(Window* window,
- const display::Display& display) override {
- // Only handles a single root.
- DCHECK(!root_);
- root_ = window;
- DCHECK(window_manager_client_);
- window_manager_client_->AddActivationParent(root_);
- mus::mojom::FrameDecorationValuesPtr frame_decoration_values =
- mus::mojom::FrameDecorationValues::New();
- frame_decoration_values->max_title_bar_button_width = 0;
- window_manager_client_->SetFrameDecorationValues(
- std::move(frame_decoration_values));
- }
- void OnAccelerator(uint32_t id, const ui::Event& event) override {
- // Don't care.
- }
-
- mus::Window* root_ = nullptr;
- mus::WindowManagerClient* window_manager_client_ = nullptr;
- // See WindowTreeClient for details on ownership.
- mus::WindowTreeClient* window_tree_client_ = nullptr;
-
- DISALLOW_COPY_AND_ASSIGN(TestWM);
-};
-
-} // namespace test
-} // namespace mus
-
-MojoResult MojoMain(MojoHandle shell_handle) {
- shell::ApplicationRunner runner(new mus::test::TestWM);
- return runner.Run(shell_handle);
-}
« no previous file with comments | « components/mus/test_wm/manifest.json ('k') | components/mus/ws/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698