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

Side by Side Diff: components/mus/ws/operation.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 | « components/mus/ws/mus_ws_unittests_app_manifest.json ('k') | components/mus/ws/operation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 #ifndef COMPONENTS_MUS_WS_OPERATION_H_
6 #define COMPONENTS_MUS_WS_OPERATION_H_
7
8 #include <set>
9
10 #include "base/macros.h"
11 #include "components/mus/common/types.h"
12
13 namespace mus {
14 namespace ws {
15
16 class WindowServer;
17 class WindowTree;
18
19 enum class OperationType {
20 NONE,
21 ADD_TRANSIENT_WINDOW,
22 ADD_WINDOW,
23 DELETE_WINDOW,
24 EMBED,
25 RELEASE_CAPTURE,
26 REMOVE_TRANSIENT_WINDOW_FROM_PARENT,
27 REMOVE_WINDOW_FROM_PARENT,
28 REORDER_WINDOW,
29 SET_CAPTURE,
30 SET_FOCUS,
31 SET_WINDOW_BOUNDS,
32 SET_WINDOW_OPACITY,
33 SET_WINDOW_PREDEFINED_CURSOR,
34 SET_WINDOW_PROPERTY,
35 SET_WINDOW_VISIBILITY,
36 };
37
38 // This class tracks the currently pending client-initiated operation.
39 // This is typically used to suppress superfluous notifications generated
40 // by suboperations in the window server.
41 class Operation {
42 public:
43 Operation(WindowTree* tree,
44 WindowServer* window_server,
45 OperationType operation_type);
46 ~Operation();
47
48 ClientSpecificId source_tree_id() const { return source_tree_id_; }
49
50 const OperationType& type() const { return operation_type_; }
51
52 // Marks the tree with the specified id as having been sent a message
53 // during the course of |this| operation.
54 void MarkTreeAsMessaged(ClientSpecificId tree_id) {
55 message_ids_.insert(tree_id);
56 }
57
58 // Returns true if MarkTreeAsMessaged(tree_id) was invoked.
59 bool DidMessageTree(ClientSpecificId tree_id) const {
60 return message_ids_.count(tree_id) > 0;
61 }
62
63 private:
64 WindowServer* const window_server_;
65 const ClientSpecificId source_tree_id_;
66 const OperationType operation_type_;
67
68 // See description of MarkTreeAsMessaged/DidMessageTree.
69 std::set<ClientSpecificId> message_ids_;
70
71 DISALLOW_COPY_AND_ASSIGN(Operation);
72 };
73
74 } // namespace ws
75 } // namespace mus
76
77 #endif // COMPONENTS_MUS_WS_OPERATION_H_
OLDNEW
« no previous file with comments | « components/mus/ws/mus_ws_unittests_app_manifest.json ('k') | components/mus/ws/operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698