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

Side by Side Diff: services/ui/display/platform_screen_ozone.h

Issue 2310133002: Add mojom::DisplayController. (Closed)
Patch Set: Remove acclerator. Created 4 years, 3 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
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_DISPLAY_PLATFORM_SCREEN_OZONE_H_ 5 #ifndef SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_
6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ 6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
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 "services/ui/display/platform_screen.h" 15 #include "services/ui/display/platform_screen.h"
16 #include "services/ui/public/interfaces/display/display_controller.mojom.h"
16 #include "ui/display/chromeos/display_configurator.h" 17 #include "ui/display/chromeos/display_configurator.h"
17 #include "ui/display/display.h" 18 #include "ui/display/display.h"
18 19
19 namespace display { 20 namespace display {
20 21
21 // PlatformScreenOzone provides the necessary functionality to configure all 22 // PlatformScreenOzone provides the necessary functionality to configure all
22 // attached physical displays on the ozone platform. 23 // attached physical displays on the ozone platform.
23 class PlatformScreenOzone : public PlatformScreen, 24 class PlatformScreenOzone : public PlatformScreen,
24 public ui::DisplayConfigurator::Observer { 25 public ui::DisplayConfigurator::Observer,
26 public mojom::DisplayController {
25 public: 27 public:
26 PlatformScreenOzone(); 28 PlatformScreenOzone();
27 ~PlatformScreenOzone() override; 29 ~PlatformScreenOzone() override;
28 30
29 // PlatformScreen: 31 // PlatformScreen:
30 void Init(PlatformScreenDelegate* delegate) override; 32 void Init(PlatformScreenDelegate* delegate) override;
31 int64_t GetPrimaryDisplayId() const override; 33 int64_t GetPrimaryDisplayId() const override;
32 34
35 // mojom::DisplayController:
36 void ToggleVirtualDisplay(
37 const ToggleVirtualDisplayCallback& callback) override;
38 void IncreaseResolution(int64_t display_id) override;
39 void DecreaseResolution(int64_t display_id) override;
40 void UseDefaultResolution(int64_t display_id) override;
41
33 private: 42 private:
34 // TODO(kylechar): This struct is just temporary until we migrate 43 // TODO(kylechar): This struct is just temporary until we migrate
35 // DisplayManager code out of ash so it can be used here. 44 // DisplayManager code out of ash so it can be used here.
36 struct DisplayInfo { 45 struct DisplayInfo {
37 DisplayInfo(int64_t new_id, const gfx::Rect& new_bounds) 46 DisplayInfo(int64_t new_id, const gfx::Rect& new_bounds)
38 : id(new_id), bounds(new_bounds) {} 47 : id(new_id), bounds(new_bounds) {}
39 48
40 int64_t id; 49 int64_t id;
41 // The display bounds. 50 // The display bounds.
42 gfx::Rect bounds; 51 gfx::Rect bounds;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 int64_t primary_display_id_ = display::Display::kInvalidDisplayID; 100 int64_t primary_display_id_ = display::Display::kInvalidDisplayID;
92 std::vector<DisplayInfo> cached_displays_; 101 std::vector<DisplayInfo> cached_displays_;
93 gfx::Point next_display_origin_; 102 gfx::Point next_display_origin_;
94 103
95 DISALLOW_COPY_AND_ASSIGN(PlatformScreenOzone); 104 DISALLOW_COPY_AND_ASSIGN(PlatformScreenOzone);
96 }; 105 };
97 106
98 } // namespace display 107 } // namespace display
99 108
100 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_ 109 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698