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

Side by Side Diff: services/ui/demo/mus_demo.h

Issue 2118083002: ShellClient -> Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mus2
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « services/tracing/tracing_app.cc ('k') | services/ui/demo/mus_demo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_UI_DEMO_MUS_DEMO_H_ 5 #ifndef SERVICES_UI_DEMO_MUS_DEMO_H_
6 #define SERVICES_UI_DEMO_MUS_DEMO_H_ 6 #define SERVICES_UI_DEMO_MUS_DEMO_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
16 #include "services/shell/public/cpp/shell_client.h" 16 #include "services/shell/public/cpp/service.h"
17 #include "services/ui/public/cpp/window_manager_delegate.h" 17 #include "services/ui/public/cpp/window_manager_delegate.h"
18 #include "services/ui/public/cpp/window_tree_client_delegate.h" 18 #include "services/ui/public/cpp/window_tree_client_delegate.h"
19 #include "third_party/skia/include/core/SkBitmap.h" 19 #include "third_party/skia/include/core/SkBitmap.h"
20 20
21 namespace bitmap_uploader { 21 namespace bitmap_uploader {
22 class BitmapUploader; 22 class BitmapUploader;
23 } 23 }
24 24
25 namespace mus_demo { 25 namespace mus_demo {
26 26
27 // A simple MUS Demo mojo app. This app connects to the mojo:ui, creates a new 27 // A simple MUS Demo mojo app. This app connects to the mojo:ui, creates a new
28 // window and draws a spinning square in the center of the window. Provides a 28 // window and draws a spinning square in the center of the window. Provides a
29 // simple way to demonstrate that the graphic stack works as intended. 29 // simple way to demonstrate that the graphic stack works as intended.
30 class MusDemo : public shell::ShellClient, 30 class MusDemo : public shell::Service,
31 public ui::WindowTreeClientDelegate, 31 public ui::WindowTreeClientDelegate,
32 public ui::WindowManagerDelegate { 32 public ui::WindowManagerDelegate {
33 public: 33 public:
34 MusDemo(); 34 MusDemo();
35 ~MusDemo() override; 35 ~MusDemo() override;
36 36
37 private: 37 private:
38 // shell::ShellClient: 38 // shell::Service:
39 void Initialize(shell::Connector* connector, 39 void OnStart(shell::Connector* connector,
40 const shell::Identity& identity, 40 const shell::Identity& identity,
41 uint32_t id) override; 41 uint32_t id) override;
42 bool AcceptConnection(shell::Connection* connection) override; 42 bool OnConnect(shell::Connection* connection) override;
43 43
44 // WindowTreeClientDelegate: 44 // WindowTreeClientDelegate:
45 void OnEmbed(ui::Window* root) override; 45 void OnEmbed(ui::Window* root) override;
46 void OnDidDestroyClient(ui::WindowTreeClient* client) override; 46 void OnDidDestroyClient(ui::WindowTreeClient* client) override;
47 void OnEventObserved(const ui::Event& event, ui::Window* target) override; 47 void OnEventObserved(const ui::Event& event, ui::Window* target) override;
48 48
49 // WindowManagerDelegate: 49 // WindowManagerDelegate:
50 void SetWindowManagerClient(ui::WindowManagerClient* client) override; 50 void SetWindowManagerClient(ui::WindowManagerClient* client) override;
51 bool OnWmSetBounds(ui::Window* window, gfx::Rect* bounds) override; 51 bool OnWmSetBounds(ui::Window* window, gfx::Rect* bounds) override;
52 bool OnWmSetProperty( 52 bool OnWmSetProperty(
(...skipping 30 matching lines...) Expand all
83 83
84 // Current rotation angle for drawing. 84 // Current rotation angle for drawing.
85 double angle_ = 0.0; 85 double angle_ = 0.0;
86 86
87 DISALLOW_COPY_AND_ASSIGN(MusDemo); 87 DISALLOW_COPY_AND_ASSIGN(MusDemo);
88 }; 88 };
89 89
90 } // namespace ui_demo 90 } // namespace ui_demo
91 91
92 #endif // SERVICES_UI_DEMO_MUS_DEMO_H_ 92 #endif // SERVICES_UI_DEMO_MUS_DEMO_H_
OLDNEW
« no previous file with comments | « services/tracing/tracing_app.cc ('k') | services/ui/demo/mus_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698