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

Side by Side Diff: services/ui/demo/mus_demo_internal.cc

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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "services/ui/demo/mus_demo_internal.h"
6
7 #include "services/service_manager/public/cpp/service_context.h"
8 #include "services/ui/demo/window_tree_data.h"
9 #include "ui/aura/mus/window_tree_client.h"
10 #include "ui/aura/mus/window_tree_host_mus.h"
11
12 namespace ui {
13 namespace demo {
14
15 namespace {
16
17 // Size of square in pixels to draw.
18 const int kSquareSize = 300;
fwang 2017/02/15 17:10:02 per Antonio's comment, I'll change this to unsigne
fwang 2017/02/16 07:48:31 So finally I better not: https://codereview.chromi
19 }
20
21 MusDemoInternal::MusDemoInternal() {}
22
23 MusDemoInternal::~MusDemoInternal() {}
24
25 void MusDemoInternal::OnStartImpl(
26 std::unique_ptr<aura::WindowTreeClient>& window_tree_client,
27 std::unique_ptr<WindowTreeData>& window_tree_data) {
28 window_tree_client = base::MakeUnique<aura::WindowTreeClient>(
29 context()->connector(), this, this);
30 window_tree_client->ConnectAsWindowManager();
31 window_tree_data = base::MakeUnique<WindowTreeData>(kSquareSize);
32 }
33
34 void MusDemoInternal::SetWindowManagerClient(
35 aura::WindowManagerClient* client) {}
36
37 bool MusDemoInternal::OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) {
38 return true;
39 }
40
41 bool MusDemoInternal::OnWmSetProperty(
42 aura::Window* window,
43 const std::string& name,
44 std::unique_ptr<std::vector<uint8_t>>* new_data) {
45 return true;
46 }
47
48 void MusDemoInternal::OnWmSetCanFocus(aura::Window* window, bool can_focus) {}
49
50 aura::Window* MusDemoInternal::OnWmCreateTopLevelWindow(
51 mojom::WindowType window_type,
52 std::map<std::string, std::vector<uint8_t>>* properties) {
53 NOTREACHED();
54 return nullptr;
55 }
56
57 void MusDemoInternal::OnWmClientJankinessChanged(
58 const std::set<aura::Window*>& client_windows,
59 bool janky) {
60 // Don't care
61 }
62
63 void MusDemoInternal::OnWmWillCreateDisplay(const display::Display& display) {
64 AddPrimaryDisplay(display);
65 }
66
67 void MusDemoInternal::OnWmNewDisplay(
68 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
69 const display::Display& display) {
70 InitWindowTreeData(std::move(window_tree_host));
71 }
72
73 void MusDemoInternal::OnWmDisplayRemoved(
74 aura::WindowTreeHostMus* window_tree_host) {
75 CleanupWindowTreeData();
76 }
77
78 void MusDemoInternal::OnWmDisplayModified(const display::Display& display) {}
79
80 mojom::EventResult MusDemoInternal::OnAccelerator(uint32_t id,
81 const Event& event) {
82 return mojom::EventResult::UNHANDLED;
83 }
84
85 void MusDemoInternal::OnWmPerformMoveLoop(
86 aura::Window* window,
87 mojom::MoveLoopSource source,
88 const gfx::Point& cursor_location,
89 const base::Callback<void(bool)>& on_done) {
90 // Don't care
91 }
92
93 void MusDemoInternal::OnWmCancelMoveLoop(aura::Window* window) {}
94
95 void MusDemoInternal::OnWmSetClientArea(
96 aura::Window* window,
97 const gfx::Insets& insets,
98 const std::vector<gfx::Rect>& additional_client_areas) {}
99
100 bool MusDemoInternal::IsWindowActive(aura::Window* window) {
101 return false;
102 }
103
104 void MusDemoInternal::OnWmDeactivateWindow(aura::Window* window) {}
105
106 } // namespace demo
107 } // namespace aura
OLDNEW
« services/ui/demo/mus_demo.h ('K') | « services/ui/demo/mus_demo_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698