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

Unified Diff: mash/simple_wm/simple_wm.h

Issue 2511233002: Add the beginning of a simple window manager that we'll support on Windows. (Closed)
Patch Set: . 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 | « mash/simple_wm/manifest.json ('k') | mash/simple_wm/simple_wm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/simple_wm/simple_wm.h
diff --git a/mash/simple_wm/simple_wm.h b/mash/simple_wm/simple_wm.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac7042ca889a137e6e57703ff13aa6e59d133fc9
--- /dev/null
+++ b/mash/simple_wm/simple_wm.h
@@ -0,0 +1,116 @@
+// 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.
+
+#ifndef MASH_SIMPLE_WM_SIMPLE_WM_H_
+#define MASH_SIMPLE_WM_SIMPLE_WM_H_
+
+#include <memory>
+#include <utility>
+
+#include "base/memory/ptr_util.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/service_manager/public/cpp/connector.h"
+#include "services/service_manager/public/cpp/service.h"
+#include "services/service_manager/public/cpp/service_context.h"
+#include "services/ui/public/cpp/gpu/gpu_service.h"
+#include "ui/aura/env.h"
+#include "ui/aura/mus/mus_context_factory.h"
+#include "ui/aura/mus/property_converter.h"
+#include "ui/aura/mus/property_utils.h"
+#include "ui/aura/mus/window_manager_delegate.h"
+#include "ui/aura/mus/window_tree_client.h"
+#include "ui/aura/mus/window_tree_client_delegate.h"
+#include "ui/aura/mus/window_tree_host_mus.h"
+#include "ui/aura/test/test_focus_client.h"
+#include "ui/aura/window.h"
+#include "ui/display/display.h"
+#include "ui/wm/core/capture_controller.h"
+#include "ui/wm/core/wm_state.h"
+
+namespace display {
+class ScreenBase;
+}
+
+namespace views {
+class AuraInit;
+}
+
+namespace simple_wm {
+
+class SimpleWM : public service_manager::Service,
+ public aura::WindowTreeClientDelegate,
+ public aura::WindowManagerDelegate {
+ public:
+ SimpleWM();
+ ~SimpleWM() override;
+
+ private:
+ class FrameView;
+
+ // service_manager::Service:
+ void OnStart() override;
+ bool OnConnect(const service_manager::ServiceInfo& remote_info,
+ service_manager::InterfaceRegistry* registry) override;
+
+ // aura::WindowTreeClientDelegate:
+ void OnEmbed(
+ std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) override;
+ void OnLostConnection(aura::WindowTreeClient* client) override;
+ void OnEmbedRootDestroyed(aura::Window* root) override;
+ void OnPointerEventObserved(const ui::PointerEvent& event,
+ aura::Window* target) override;
+ aura::client::CaptureClient* GetCaptureClient() override;
+ aura::PropertyConverter* GetPropertyConverter() override;
+
+ // aura::WindowManagerDelegate:
+ void SetWindowManagerClient(aura::WindowManagerClient* client) override;
+ bool OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) override;
+ bool OnWmSetProperty(
+ aura::Window* window,
+ const std::string& name,
+ std::unique_ptr<std::vector<uint8_t>>* new_data) override;
+ aura::Window* OnWmCreateTopLevelWindow(
+ ui::mojom::WindowType window_type,
+ std::map<std::string, std::vector<uint8_t>>* properties) override;
+ void OnWmClientJankinessChanged(const std::set<aura::Window*>& client_windows,
+ bool janky) override;
+ void OnWmWillCreateDisplay(const display::Display& display) override;
+ void OnWmNewDisplay(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
+ const display::Display& display) override;
+ void OnWmDisplayRemoved(aura::WindowTreeHostMus* window_tree_host) override;
+ void OnWmDisplayModified(const display::Display& display) override;
+ void OnWmPerformMoveLoop(aura::Window* window,
+ ui::mojom::MoveLoopSource source,
+ const gfx::Point& cursor_location,
+ const base::Callback<void(bool)>& on_done) override;
+ void OnWmCancelMoveLoop(aura::Window* window) override;
+ void OnWmSetClientArea(
+ aura::Window* window,
+ const gfx::Insets& insets,
+ const std::vector<gfx::Rect>& additional_client_areas) override;
+
+ FrameView* GetFrameViewForClientWindow(aura::Window* client_window);
+
+ std::unique_ptr<views::AuraInit> aura_init_;
+ ::wm::WMState wm_state_;
+ std::unique_ptr<display::ScreenBase> screen_;
+ aura::PropertyConverter property_converter_;
+ aura::test::TestFocusClient focus_client_;
+ std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_;
+ aura::Window* root_ = nullptr;
+ aura::WindowManagerClient* window_manager_client_ = nullptr;
+ std::unique_ptr<aura::WindowTreeClient> window_tree_client_;
+ std::unique_ptr<ui::GpuService> gpu_service_;
+ std::unique_ptr<aura::MusContextFactory> compositor_context_factory_;
+ std::map<aura::Window*, FrameView*> client_window_to_frame_view_;
+
+ bool started_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(SimpleWM);
+};
+
+} // namespace simple_wm
+
+#endif // MASH_SIMPLE_WM_SIMPLE_WM_H_
« no previous file with comments | « mash/simple_wm/manifest.json ('k') | mash/simple_wm/simple_wm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698