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

Side by Side Diff: services/ui/public/cpp/window.h

Issue 2189893002: services/ui: Create a proper component for the client-lib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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/ui/public/cpp/ui_export.h ('k') | services/ui/public/cpp/window_manager_delegate.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_PUBLIC_CPP_WINDOW_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_H_
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_ 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "mojo/public/cpp/bindings/array.h" 14 #include "mojo/public/cpp/bindings/array.h"
15 #include "services/shell/public/interfaces/interface_provider.mojom.h" 15 #include "services/shell/public/interfaces/interface_provider.mojom.h"
16 #include "services/ui/common/types.h" 16 #include "services/ui/common/types.h"
17 #include "services/ui/public/cpp/ui_export.h"
17 #include "services/ui/public/interfaces/mus_constants.mojom.h" 18 #include "services/ui/public/interfaces/mus_constants.mojom.h"
18 #include "services/ui/public/interfaces/window_tree.mojom.h" 19 #include "services/ui/public/interfaces/window_tree.mojom.h"
19 #include "ui/gfx/geometry/insets.h" 20 #include "ui/gfx/geometry/insets.h"
20 #include "ui/gfx/geometry/rect.h" 21 #include "ui/gfx/geometry/rect.h"
21 22
22 namespace gfx { 23 namespace gfx {
23 class Size; 24 class Size;
24 } 25 }
25 26
26 namespace ui { 27 namespace ui {
(...skipping 13 matching lines...) Expand all
40 // Defined in window_property.h (which we do not include) 41 // Defined in window_property.h (which we do not include)
41 template <typename T> 42 template <typename T>
42 struct WindowProperty; 43 struct WindowProperty;
43 44
44 // Windows are owned by the WindowTreeClient. See WindowTreeClientDelegate for 45 // Windows are owned by the WindowTreeClient. See WindowTreeClientDelegate for
45 // details on ownership. 46 // details on ownership.
46 // 47 //
47 // TODO(beng): Right now, you'll have to implement a WindowObserver to track 48 // TODO(beng): Right now, you'll have to implement a WindowObserver to track
48 // destruction and NULL any pointers you have. 49 // destruction and NULL any pointers you have.
49 // Investigate some kind of smart pointer or weak pointer for these. 50 // Investigate some kind of smart pointer or weak pointer for these.
50 class Window { 51 class UI_EXPORT Window {
51 public: 52 public:
52 using Children = std::vector<Window*>; 53 using Children = std::vector<Window*>;
53 using EmbedCallback = base::Callback<void(bool)>; 54 using EmbedCallback = base::Callback<void(bool)>;
54 using PropertyDeallocator = void (*)(int64_t value); 55 using PropertyDeallocator = void (*)(int64_t value);
55 using SharedProperties = std::map<std::string, std::vector<uint8_t>>; 56 using SharedProperties = std::map<std::string, std::vector<uint8_t>>;
56 57
57 // Destroys this window and all its children. Destruction is allowed for 58 // Destroys this window and all its children. Destruction is allowed for
58 // windows that were created by this connection, or the roots. For windows 59 // windows that were created by this connection, or the roots. For windows
59 // from other connections (except the roots), Destroy() does nothing. If the 60 // from other connections (except the roots), Destroy() does nothing. If the
60 // destruction is allowed observers are notified and the Window is 61 // destruction is allowed observers are notified and the Window is
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 }; 365 };
365 366
366 std::map<const void*, Value> prop_map_; 367 std::map<const void*, Value> prop_map_;
367 368
368 DISALLOW_COPY_AND_ASSIGN(Window); 369 DISALLOW_COPY_AND_ASSIGN(Window);
369 }; 370 };
370 371
371 } // namespace ui 372 } // namespace ui
372 373
373 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ 374 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_
OLDNEW
« no previous file with comments | « services/ui/public/cpp/ui_export.h ('k') | services/ui/public/cpp/window_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698