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/display/display_util.h

Issue 2270553002: Move ash::DisplayInfo to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build 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 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 ASH_DISPLAY_DISPLAY_UTIL_H_ 5 #ifndef ASH_DISPLAY_DISPLAY_UTIL_H_
6 #define ASH_DISPLAY_DISPLAY_UTIL_H_ 6 #define ASH_DISPLAY_DISPLAY_UTIL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/ash_export.h" 14 #include "ash/ash_export.h"
15 #include "ash/common/display/display_info.h"
16 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
17 #include "ui/display/manager/display_layout.h" 16 #include "ui/display/manager/display_layout.h"
17 #include "ui/display/manager/managed_display_info.h"
18 18
19 namespace gfx { 19 namespace gfx {
20 class Point; 20 class Point;
21 class Rect; 21 class Rect;
22 class Size; 22 class Size;
23 } 23 }
24 24
25 namespace ui {
26 class ManagedDisplayInfo;
27 }
28
25 namespace ash { 29 namespace ash {
26 class AshWindowTreeHost; 30 class AshWindowTreeHost;
27 class ManagedDisplayMode; 31 class ManagedDisplayMode;
28 class DisplayInfo;
29 32
30 // Creates the display mode list for internal display 33 // Creates the display mode list for internal display
31 // based on |native_mode|. 34 // based on |native_mode|.
32 ASH_EXPORT DisplayInfo::ManagedDisplayModeList 35 ASH_EXPORT ui::ManagedDisplayInfo::ManagedDisplayModeList
33 CreateInternalManagedDisplayModeList( 36 CreateInternalManagedDisplayModeList(
34 const scoped_refptr<ManagedDisplayMode>& native_mode); 37 const scoped_refptr<ui::ManagedDisplayMode>& native_mode);
35 38
36 // Creates the display mode list for unified display 39 // Creates the display mode list for unified display
37 // based on |native_mode| and |scales|. 40 // based on |native_mode| and |scales|.
38 ASH_EXPORT DisplayInfo::ManagedDisplayModeList 41 ASH_EXPORT ui::ManagedDisplayInfo::ManagedDisplayModeList
39 CreateUnifiedManagedDisplayModeList( 42 CreateUnifiedManagedDisplayModeList(
40 const scoped_refptr<ManagedDisplayMode>& native_mode, 43 const scoped_refptr<ui::ManagedDisplayMode>& native_mode,
41 const std::set<std::pair<float, float>>& dsf_scale_list); 44 const std::set<std::pair<float, float>>& dsf_scale_list);
42 45
43 // Gets the display mode for |resolution|. Returns false if no display 46 // Gets the display mode for |resolution|. Returns false if no display
44 // mode matches the resolution, or the display is an internal display. 47 // mode matches the resolution, or the display is an internal display.
45 ASH_EXPORT scoped_refptr<ManagedDisplayMode> GetDisplayModeForResolution( 48 ASH_EXPORT scoped_refptr<ui::ManagedDisplayMode> GetDisplayModeForResolution(
46 const DisplayInfo& info, 49 const ui::ManagedDisplayInfo& info,
47 const gfx::Size& resolution); 50 const gfx::Size& resolution);
48 51
49 // Gets the display mode for the next valid UI scale. Returns false 52 // Gets the display mode for the next valid UI scale. Returns false
50 // if the display is not an internal display. 53 // if the display is not an internal display.
51 ASH_EXPORT scoped_refptr<ManagedDisplayMode> GetDisplayModeForNextUIScale( 54 ASH_EXPORT scoped_refptr<ui::ManagedDisplayMode> GetDisplayModeForNextUIScale(
52 const DisplayInfo& info, 55 const ui::ManagedDisplayInfo& info,
53 bool up); 56 bool up);
54 57
55 // Gets the display mode for the next valid resolution. Returns false 58 // Gets the display mode for the next valid resolution. Returns false
56 // if the display is an internal display. 59 // if the display is an internal display.
57 ASH_EXPORT scoped_refptr<ManagedDisplayMode> GetDisplayModeForNextResolution( 60 ASH_EXPORT scoped_refptr<ui::ManagedDisplayMode>
58 const DisplayInfo& info, 61 GetDisplayModeForNextResolution(const ui::ManagedDisplayInfo& info, bool up);
59 bool up);
60 62
61 // Sets the UI scale for the |display_id|. Returns false if the 63 // Sets the UI scale for the |display_id|. Returns false if the
62 // display_id is not an internal display. 64 // display_id is not an internal display.
63 ASH_EXPORT bool SetDisplayUIScale(int64_t display_id, float scale); 65 ASH_EXPORT bool SetDisplayUIScale(int64_t display_id, float scale);
64 66
65 // Tests if the |info| has display mode that matches |ui_scale|. 67 // Tests if the |info| has display mode that matches |ui_scale|.
66 bool HasDisplayModeForUIScale(const DisplayInfo& info, float ui_scale); 68 bool HasDisplayModeForUIScale(const ui::ManagedDisplayInfo& info,
69 float ui_scale);
67 70
68 // Computes the bounds that defines the bounds between two displays. 71 // Computes the bounds that defines the bounds between two displays.
69 // Returns false if two displays do not intersect. 72 // Returns false if two displays do not intersect.
70 bool ComputeBoundary(const display::Display& primary_display, 73 bool ComputeBoundary(const display::Display& primary_display,
71 const display::Display& secondary_display, 74 const display::Display& secondary_display,
72 gfx::Rect* primary_edge_in_screen, 75 gfx::Rect* primary_edge_in_screen,
73 gfx::Rect* secondary_edge_in_screen); 76 gfx::Rect* secondary_edge_in_screen);
74 77
75 // Creates edge bounds from |bounds_in_screen| that fits the edge 78 // Creates edge bounds from |bounds_in_screen| that fits the edge
76 // of the native window for |ash_host|. 79 // of the native window for |ash_host|.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 #if defined(OS_CHROMEOS) 133 #if defined(OS_CHROMEOS)
131 // Shows the notification message for display related issues. 134 // Shows the notification message for display related issues.
132 void ShowDisplayErrorNotification(int message_id); 135 void ShowDisplayErrorNotification(int message_id);
133 #endif 136 #endif
134 137
135 ASH_EXPORT base::string16 GetDisplayErrorNotificationMessageForTest(); 138 ASH_EXPORT base::string16 GetDisplayErrorNotificationMessageForTest();
136 139
137 } // namespace ash 140 } // namespace ash
138 141
139 #endif // ASH_DISPLAY_DISPLAY_UTIL_H_ 142 #endif // ASH_DISPLAY_DISPLAY_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698