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

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: 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 #include "services/service_manager/public/cpp/service_context.h"
7 #include "ui/aura/mus/window_tree_client.h"
8 #include "ui/aura/mus/window_tree_host_mus.h"
9
10 namespace ui {
11 namespace demo {
12
13 // Size of square in pixels to draw.
14 const int kSquareSize = 300;
kylechar 2017/02/14 18:40:11 Put this in an anonymous namespace.
fwang 2017/02/15 13:49:26 Done.
15
16 MusDemoInternal::MusDemoInternal() {}
17
18 void MusDemoInternal::OnStartImpl() {
19 window_tree_client_ = base::MakeUnique<aura::WindowTreeClient>(
20 context()->connector(), this, this);
21 window_tree_client_->ConnectAsWindowManager();
22 }
23
24 void MusDemoInternal::SetWindowManagerClient(
25 aura::WindowManagerClient* client) {}
26
27 bool MusDemoInternal::OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) {
28 return true;
29 }
30
31 bool MusDemoInternal::OnWmSetProperty(
32 aura::Window* window,
33 const std::string& name,
34 std::unique_ptr<std::vector<uint8_t>>* new_data) {
35 return true;
36 }
37
38 void MusDemoInternal::OnWmSetCanFocus(aura::Window* window, bool can_focus) {}
39
40 aura::Window* MusDemoInternal::OnWmCreateTopLevelWindow(
41 mojom::WindowType window_type,
42 std::map<std::string, std::vector<uint8_t>>* properties) {
43 NOTREACHED();
44 return nullptr;
45 }
46
47 void MusDemoInternal::OnWmClientJankinessChanged(
48 const std::set<aura::Window*>& client_windows,
49 bool janky) {
50 // Don't care
51 }
52
53 void MusDemoInternal::OnWmWillCreateDisplay(const display::Display& display) {
54 screen_->display_list().AddDisplay(display,
55 display::DisplayList::Type::PRIMARY);
56 }
57
58 void MusDemoInternal::OnWmNewDisplay(
59 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
60 const display::Display& display) {
61 DCHECK(!window_tree_data_); // Only support one display.
62 window_tree_data_ = base::MakeUnique<WindowTreeData>(
63 std::move(window_tree_host), kSquareSize);
64 }
65
66 void MusDemoInternal::OnWmDisplayRemoved(
67 aura::WindowTreeHostMus* window_tree_host) {
68 window_tree_data_.reset();
69 }
70
71 void MusDemoInternal::OnWmDisplayModified(const display::Display& display) {}
72
73 mojom::EventResult MusDemoInternal::OnAccelerator(uint32_t id,
74 const Event& event) {
75 return mojom::EventResult::UNHANDLED;
76 }
77
78 void MusDemoInternal::OnWmPerformMoveLoop(
79 aura::Window* window,
80 mojom::MoveLoopSource source,
81 const gfx::Point& cursor_location,
82 const base::Callback<void(bool)>& on_done) {
83 // Don't care
84 }
85
86 void MusDemoInternal::OnWmCancelMoveLoop(aura::Window* window) {}
87
88 void MusDemoInternal::OnWmSetClientArea(
89 aura::Window* window,
90 const gfx::Insets& insets,
91 const std::vector<gfx::Rect>& additional_client_areas) {}
92
93 bool MusDemoInternal::IsWindowActive(aura::Window* window) {
94 return false;
95 }
96
97 void MusDemoInternal::OnWmDeactivateWindow(aura::Window* window) {}
98
99 } // namespace demo
100 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698