| OLD | NEW |
| 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 UI_DISPLAY_MANAGER_DISPLAY_LAYOUT_H_ | 5 #ifndef UI_DISPLAY_MANAGER_DISPLAY_LAYOUT_H_ |
| 6 #define UI_DISPLAY_MANAGER_DISPLAY_LAYOUT_H_ | 6 #define UI_DISPLAY_MANAGER_DISPLAY_LAYOUT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
| 16 #include "ui/display/display_export.h" | 16 #include "ui/display/display_export.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class Value; | 19 class Value; |
| 20 template <typename T> class JSONValueConverter; | 20 template <typename T> class JSONValueConverter; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace gfx { | 23 namespace gfx { |
| 24 class Display; | 24 class Display; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // True if displays are mirrored. | 94 // True if displays are mirrored. |
| 95 bool mirrored; | 95 bool mirrored; |
| 96 | 96 |
| 97 // True if multi displays should default to unified mode. | 97 // True if multi displays should default to unified mode. |
| 98 bool default_unified; | 98 bool default_unified; |
| 99 | 99 |
| 100 // The id of the display used as a primary display. | 100 // The id of the display used as a primary display. |
| 101 int64_t primary_id; | 101 int64_t primary_id; |
| 102 | 102 |
| 103 scoped_ptr<DisplayLayout> Copy() const; | 103 std::unique_ptr<DisplayLayout> Copy() const; |
| 104 | 104 |
| 105 // Test if the |layout| has the same placement list. Other fields such | 105 // Test if the |layout| has the same placement list. Other fields such |
| 106 // as mirrored, primary_id are ignored. | 106 // as mirrored, primary_id are ignored. |
| 107 bool HasSamePlacementList(const DisplayLayout& layout) const; | 107 bool HasSamePlacementList(const DisplayLayout& layout) const; |
| 108 | 108 |
| 109 // Returns string representation of the layout for debugging/testing. | 109 // Returns string representation of the layout for debugging/testing. |
| 110 std::string ToString() const; | 110 std::string ToString() const; |
| 111 | 111 |
| 112 // Returns the DisplayPlacement entry matching |display_id| if it exists, | 112 // Returns the DisplayPlacement entry matching |display_id| if it exists, |
| 113 // otherwise returns a DisplayPlacement with an invalid display id. | 113 // otherwise returns a DisplayPlacement with an invalid display id. |
| 114 DisplayPlacement FindPlacementById(int64_t display_id) const; | 114 DisplayPlacement FindPlacementById(int64_t display_id) const; |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 // Apply the display placement to |display_list|. | 117 // Apply the display placement to |display_list|. |
| 118 // Returns true if the display bounds were updated. | 118 // Returns true if the display bounds were updated. |
| 119 static bool ApplyDisplayPlacement(const DisplayPlacement& placement, | 119 static bool ApplyDisplayPlacement(const DisplayPlacement& placement, |
| 120 DisplayList* display_list, | 120 DisplayList* display_list, |
| 121 int minimum_offset_overlap); | 121 int minimum_offset_overlap); |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(DisplayLayout); | 123 DISALLOW_COPY_AND_ASSIGN(DisplayLayout); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace display | 126 } // namespace display |
| 127 | 127 |
| 128 #endif // UI_DISPLAY_MANAGER_DISPLAY_LAYOUT_H_ | 128 #endif // UI_DISPLAY_MANAGER_DISPLAY_LAYOUT_H_ |
| OLD | NEW |