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

Side by Side Diff: ash/test/display_manager_test_api.h

Issue 2445583002: Relocate display_manager from ash to ui (Closed)
Patch Set: Created 4 years, 2 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 (c) 2012 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 ASH_TEST_DISPLAY_MANAGER_TEST_API_H_
6 #define ASH_TEST_DISPLAY_MANAGER_TEST_API_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11 #include <string>
12 #include <vector>
13
14 #include "base/macros.h"
15 #include "ui/display/manager/display_layout.h"
16 #include "ui/display/types/display_constants.h"
17
18 namespace display {
19 class ManagedDisplayInfo;
20 }
21
22 namespace gfx {
23 class Point;
24 class Size;
25 }
26
27 namespace ui {
28 namespace test {
29 class EventGenerator;
30 }
31 }
32
33 namespace ash {
34 class DisplayManager;
35
36 namespace test {
37
38 class DisplayManagerTestApi {
39 public:
40 explicit DisplayManagerTestApi(DisplayManager* display_manager);
41 virtual ~DisplayManagerTestApi();
42
43 // Update the display configuration as given in |display_specs|. The format of
44 // |display_spec| is a list of comma separated spec for each displays. Please
45 // refer to the comment in |ash::DisplayInfo::CreateFromSpec| for the format
46 // of the display spec.
47 void UpdateDisplay(const std::string& display_specs);
48
49 // Set the 1st display as an internal display and returns the display Id for
50 // the internal display.
51 int64_t SetFirstDisplayAsInternalDisplay();
52
53 // Don't update the display when the root window's size was changed.
54 void DisableChangeDisplayUponHostResize();
55
56 // Sets the available color profiles for |display_id|.
57 void SetAvailableColorProfiles(
58 int64_t display_id,
59 const std::vector<ui::ColorCalibrationProfile>& profiles);
60
61 // Gets the internal display::ManagedDisplayInfo for a specific display id.
62 const display::ManagedDisplayInfo& GetInternalManagedDisplayInfo(
63 int64_t display_id);
64
65 private:
66 friend class ScopedSetInternalDisplayId;
67 // Sets the display id for internal display and
68 // update the display mode list if necessary.
69 void SetInternalDisplayId(int64_t id);
70
71 DisplayManager* display_manager_; // not owned
72
73 DISALLOW_COPY_AND_ASSIGN(DisplayManagerTestApi);
74 };
75
76 class ScopedDisable125DSFForUIScaling {
77 public:
78 ScopedDisable125DSFForUIScaling();
79 ~ScopedDisable125DSFForUIScaling();
80
81 private:
82 DISALLOW_COPY_AND_ASSIGN(ScopedDisable125DSFForUIScaling);
83 };
84
85 class ScopedSetInternalDisplayId {
86 public:
87 ScopedSetInternalDisplayId(DisplayManager* test_api, int64_t id);
88 ~ScopedSetInternalDisplayId();
89
90 private:
91 DISALLOW_COPY_AND_ASSIGN(ScopedSetInternalDisplayId);
92 };
93
94 // Sets the display mode that matches the |resolution| for |display_id|.
95 bool SetDisplayResolution(DisplayManager* display_manager,
96 int64_t display_id,
97 const gfx::Size& resolution);
98
99 // Creates the dislpay layout from position and offset for the current
100 // display list. If you simply want to create a new layout that is
101 // independent of current displays, use DisplayLayoutBuilder or simply
102 // create a new DisplayLayout and set display id fields (primary, ids
103 // in placement) manually.
104 std::unique_ptr<display::DisplayLayout> CreateDisplayLayout(
105 DisplayManager* display_manager,
106 display::DisplayPlacement::Position position,
107 int offset);
108
109 // Creates the DisplayIdList from ints.
110 display::DisplayIdList CreateDisplayIdList2(int64_t id1, int64_t id2);
111 display::DisplayIdList CreateDisplayIdListN(size_t count, ...);
112
113 } // namespace test
114 } // namespace ash
115
116 #endif // ASH_TEST_DISPLAY_MANAGER_TEST_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698