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

Unified Diff: mash/wm/wm.h

Issue 2511233002: Add the beginning of a simple window manager that we'll support on Windows. (Closed)
Patch Set: . Created 4 years, 1 month 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/wm/manifest.json ('k') | mash/wm/wm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/wm.h
diff --git a/mash/wm/wm.h b/mash/wm/wm.h
new file mode 100644
index 0000000000000000000000000000000000000000..fea8fd323bb003656219eadb9b0202c52ee40c0f
--- /dev/null
+++ b/mash/wm/wm.h
@@ -0,0 +1,70 @@
+// 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_WM_WM_H_
+#define MASH_WM_WM_H_
+
+#include <memory>
+
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/service_manager/public/cpp/service.h"
+#include "services/ui/public/cpp/window_manager_delegate.h"
+#include "services/ui/public/cpp/window_tree_client_delegate.h"
+#include "ui/display/display.h"
+
+namespace mash {
+namespace wm {
+
+class WM : public service_manager::Service,
sky 2016/11/17 20:41:58 Could I convince you to go with a more specific na
+ public ui::WindowTreeClientDelegate,
+ public ui::WindowManagerDelegate {
+ public:
+ WM();
+ ~WM() override;
+
+ private:
+ // service_manager::Service:
+ void OnStart() override;
+ bool OnConnect(const service_manager::ServiceInfo& remote_info,
+ service_manager::InterfaceRegistry* registry) override;
+
+ // ui::WindowTreeClientDelegate:
+ void OnEmbed(ui::Window* root) override;
+ void OnLostConnection(ui::WindowTreeClient* client) override;
+ void OnEmbedRootDestroyed(ui::Window* root) override;
+ void OnPointerEventObserved(const ui::PointerEvent& event,
+ ui::Window* target) override;
+
+ // ui::WindowManagerDelegate:
+ void SetWindowManagerClient(ui::WindowManagerClient* client) override;
+ bool OnWmSetBounds(ui::Window* window, gfx::Rect* bounds) override;
+ bool OnWmSetProperty(
+ ui::Window* window,
+ const std::string& name,
+ std::unique_ptr<std::vector<uint8_t>>* new_data) override;
+ ui::Window* OnWmCreateTopLevelWindow(
+ std::map<std::string, std::vector<uint8_t>>* properties) override;
+ void OnWmClientJankinessChanged(const std::set<ui::Window*>& client_windows,
+ bool janky) override;
+ void OnWmNewDisplay(ui::Window* window,
+ const display::Display& display) override;
+ void OnWmDisplayRemoved(ui::Window* window) override;
+ void OnWmDisplayModified(const display::Display& display) override;
+ void OnWmPerformMoveLoop(ui::Window* window,
+ ui::mojom::MoveLoopSource source,
+ const gfx::Point& cursor_location,
+ const base::Callback<void(bool)>& on_done) override;
+ void OnWmCancelMoveLoop(ui::Window* window) override;
+
+ ui::Window* root_ = nullptr;
+ ui::WindowManagerClient* window_manager_client_ = nullptr;
+ std::unique_ptr<ui::WindowTreeClient> window_tree_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(WM);
+};
+
+} // namespace wm
+} // namespace mash
+
+#endif // MASH_WM_WM_H_
« no previous file with comments | « mash/wm/manifest.json ('k') | mash/wm/wm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698