| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
| 6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 struct ASH_EXPORT DisplayLayout { | 39 struct ASH_EXPORT DisplayLayout { |
| 40 // Layout options where the secondary display should be positioned. | 40 // Layout options where the secondary display should be positioned. |
| 41 enum Position { | 41 enum Position { |
| 42 TOP, | 42 TOP, |
| 43 RIGHT, | 43 RIGHT, |
| 44 BOTTOM, | 44 BOTTOM, |
| 45 LEFT | 45 LEFT |
| 46 }; | 46 }; |
| 47 // Factory method to create DisplayLayout from int values. | 47 // Factory method to create DisplayLayout from int values. |
| 48 // Used for persistence and webui. | 48 // Used for persistence and webui. |
| 49 static DisplayLayout FromInts(int position, int offsets); | 49 static DisplayLayout FromInts(int position, int offsets, bool mirror); |
| 50 | 50 |
| 51 DisplayLayout(); | 51 DisplayLayout(); |
| 52 DisplayLayout(Position position, int offset); | 52 DisplayLayout(Position position, int offset, bool mirrored); |
| 53 | 53 |
| 54 // Returns an inverted display layout. | 54 // Returns an inverted display layout. |
| 55 DisplayLayout Invert() const WARN_UNUSED_RESULT; | 55 DisplayLayout Invert() const WARN_UNUSED_RESULT; |
| 56 | 56 |
| 57 // Converter functions to/from base::Value. | 57 // Converter functions to/from base::Value. |
| 58 static bool ConvertFromValue(const base::Value& value, DisplayLayout* layout); | 58 static bool ConvertFromValue(const base::Value& value, DisplayLayout* layout); |
| 59 static bool ConvertToValue(const DisplayLayout& layout, base::Value* value); | 59 static bool ConvertToValue(const DisplayLayout& layout, base::Value* value); |
| 60 | 60 |
| 61 // This method is used by base::JSONValueConverter, you don't need to call | 61 // This method is used by base::JSONValueConverter, you don't need to call |
| 62 // this directly. Instead consider using converter functions above. | 62 // this directly. Instead consider using converter functions above. |
| 63 static void RegisterJSONConverter( | 63 static void RegisterJSONConverter( |
| 64 base::JSONValueConverter<DisplayLayout>* converter); | 64 base::JSONValueConverter<DisplayLayout>* converter); |
| 65 | 65 |
| 66 Position position; | 66 Position position; |
| 67 | 67 |
| 68 // The offset of the position of the secondary display. The offset is | 68 // The offset of the position of the secondary display. The offset is |
| 69 // based on the top/left edge of the primary display. | 69 // based on the top/left edge of the primary display. |
| 70 int offset; | 70 int offset; |
| 71 | 71 |
| 72 bool mirrored; |
| 73 |
| 72 // Returns string representation of the layout for debugging/testing. | 74 // Returns string representation of the layout for debugging/testing. |
| 73 std::string ToString() const; | 75 std::string ToString() const; |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 // DisplayController owns and maintains RootWindows for each attached | 78 // DisplayController owns and maintains RootWindows for each attached |
| 77 // display, keeping them in sync with display configuration changes. | 79 // display, keeping them in sync with display configuration changes. |
| 78 class ASH_EXPORT DisplayController : public gfx::DisplayObserver { | 80 class ASH_EXPORT DisplayController : public gfx::DisplayObserver { |
| 79 public: | 81 public: |
| 80 class ASH_EXPORT Observer { | 82 class ASH_EXPORT Observer { |
| 81 public: | 83 public: |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // Store the primary root window temporarily while replacing | 256 // Store the primary root window temporarily while replacing |
| 255 // display. | 257 // display. |
| 256 aura::RootWindow* primary_root_window_for_replace_; | 258 aura::RootWindow* primary_root_window_for_replace_; |
| 257 | 259 |
| 258 DISALLOW_COPY_AND_ASSIGN(DisplayController); | 260 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
| 259 }; | 261 }; |
| 260 | 262 |
| 261 } // namespace ash | 263 } // namespace ash |
| 262 | 264 |
| 263 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 265 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
| OLD | NEW |