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

Unified Diff: services/ui/demo/mus_demo_internal.h

Issue 2693923004: Mus Demo: Extract code specific to internal mode into a separate class (Closed)
Patch Set: Address review comments and more refactoring Created 3 years, 10 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
Index: services/ui/demo/mus_demo_internal.h
diff --git a/services/ui/demo/mus_demo_internal.h b/services/ui/demo/mus_demo_internal.h
new file mode 100644
index 0000000000000000000000000000000000000000..3c7777469a793c1970c4cb13732fcc38cd402067
--- /dev/null
+++ b/services/ui/demo/mus_demo_internal.h
@@ -0,0 +1,66 @@
+// Copyright 2017 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 SERVICES_UI_DEMO_MUS_DEMO_INTERNAL_H_
+#define SERVICES_UI_DEMO_MUS_DEMO_INTERNAL_H_
+
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "services/ui/demo/mus_demo.h"
+#include "ui/aura/mus/window_manager_delegate.h"
+
+namespace ui {
+namespace demo {
+
+class MusDemoInternal : public MusDemo, public aura::WindowManagerDelegate {
+ public:
+ MusDemoInternal();
+ ~MusDemoInternal() final;
+
+ private:
+ void OnStartImpl(std::unique_ptr<aura::WindowTreeClient>& window_tree_client,
+ std::unique_ptr<WindowTreeData>& window_tree_data) final;
+
+ // aura::WindowManagerDelegate:
+ void SetWindowManagerClient(aura::WindowManagerClient* client) final;
+ bool OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) final;
+ bool OnWmSetProperty(aura::Window* window,
+ const std::string& name,
+ std::unique_ptr<std::vector<uint8_t>>* new_data) final;
+ void OnWmSetCanFocus(aura::Window* window, bool can_focus) final;
+ aura::Window* OnWmCreateTopLevelWindow(
+ ui::mojom::WindowType window_type,
+ std::map<std::string, std::vector<uint8_t>>* properties) final;
+ void OnWmClientJankinessChanged(const std::set<aura::Window*>& client_windows,
+ bool janky) final;
+ void OnWmWillCreateDisplay(const display::Display& display) final;
+ void OnWmNewDisplay(std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
+ const display::Display& display) final;
+ void OnWmDisplayRemoved(aura::WindowTreeHostMus* window_tree_host) final;
+ void OnWmDisplayModified(const display::Display& display) final;
+ ui::mojom::EventResult OnAccelerator(uint32_t id,
+ const ui::Event& event) final;
+ void OnWmPerformMoveLoop(aura::Window* window,
+ ui::mojom::MoveLoopSource source,
+ const gfx::Point& cursor_location,
+ const base::Callback<void(bool)>& on_done) final;
+ void OnWmCancelMoveLoop(aura::Window* window) final;
+ void OnWmSetClientArea(
+ aura::Window* window,
+ const gfx::Insets& insets,
+ const std::vector<gfx::Rect>& additional_client_areas) final;
+ bool IsWindowActive(aura::Window* window) final;
+ void OnWmDeactivateWindow(aura::Window* window) final;
+
+ DISALLOW_COPY_AND_ASSIGN(MusDemoInternal);
+};
+
+} // namespace demo
+} // namespace aura
+
+#endif // SERVICES_UI_DEMO_MUS_DEMO_INTERNAL_H_

Powered by Google App Engine
This is Rietveld 408576698