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

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

Issue 1899923002: Basic display management for mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactored differently Created 4 years, 7 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 2016 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_PLATFORM_SCREEN_IMPL_OZONE_H_
6 #define COMPONENTS_MUS_WS_PLATFORM_SCREEN_IMPL_OZONE_H_
7
8 #include <stdint.h>
9
10 #include <vector>
11
12 #include "base/callback.h"
13 #include "base/memory/weak_ptr.h"
14 #include "components/mus/ws/platform_screen.h"
15 #include "ui/display/types/native_display_observer.h"
16 #include "ui/gfx/geometry/rect.h"
17
18 namespace gfx {
19 class Rect;
20 }
21
22 namespace ui {
23 class NativeDisplayDelegate;
24 class DisplaySnapshot;
25 }
26
27 namespace mus {
28 namespace ws {
29
30 // PlatformScreenImplOzone provides the necessary functionality to configure all
31 // attached physical displays on the ozone platform.
32 class PlatformScreenImplOzone : public PlatformScreen,
33 public ui::NativeDisplayObserver {
34 public:
35 PlatformScreenImplOzone();
36 ~PlatformScreenImplOzone() override;
37
38 private:
39 // PlatformScreen
40 void Init() override; // Must not be called until after the ozone platform is
41 // initialized.
42 void ConfigurePhysicalDisplay(
43 const ConfiguredDisplayCallback& callback) override;
44
45 // TODO(rjkroege): NativeDisplayObserver is misnamed as it tracks changes in
46 // the physical "Screen". Consider renaming it to NativeScreenObserver.
47 // ui::NativeDisplayObserver:
48 void OnConfigurationChanged() override;
49
50 // Display management callback.
51 void OnDisplaysAquired(const ConfiguredDisplayCallback& callback,
52 const std::vector<ui::DisplaySnapshot*>& displays);
53
54 std::unique_ptr<ui::NativeDisplayDelegate> native_display_delegate_;
55
56 base::WeakPtrFactory<PlatformScreenImplOzone> weak_ptr_factory_;
57
58 DISALLOW_COPY_AND_ASSIGN(PlatformScreenImplOzone);
59 };
60
61 } // namespace ws
62 } // namespace mus
63
64 #endif // COMPONENTS_MUS_WS_PLATFORM_SCREEN_IMPL_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698