| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
| 6 #define EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 6 #define EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/linked_ptr.h" | 14 #include "base/memory/linked_ptr.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Display; | 17 class Display; |
| 18 class Screen; | |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace extensions { | 20 namespace extensions { |
| 22 | 21 |
| 23 namespace api { | 22 namespace api { |
| 24 namespace system_display { | 23 namespace system_display { |
| 25 struct DisplayProperties; | 24 struct DisplayProperties; |
| 26 struct DisplayUnitInfo; | 25 struct DisplayUnitInfo; |
| 27 } | 26 } |
| 28 } | 27 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 42 // Using this in other tests (e.g. unit_tests) will result in DCHECK failure. | 41 // Using this in other tests (e.g. unit_tests) will result in DCHECK failure. |
| 43 static void InitializeForTesting(DisplayInfoProvider* display_info_provider); | 42 static void InitializeForTesting(DisplayInfoProvider* display_info_provider); |
| 44 | 43 |
| 45 // Updates the display with |display_id| according to |info|. Returns whether | 44 // Updates the display with |display_id| according to |info|. Returns whether |
| 46 // the display was successfully updated. On failure, no display parameters | 45 // the display was successfully updated. On failure, no display parameters |
| 47 // should be changed, and |error| should be set to the error string. | 46 // should be changed, and |error| should be set to the error string. |
| 48 virtual bool SetInfo(const std::string& display_id, | 47 virtual bool SetInfo(const std::string& display_id, |
| 49 const api::system_display::DisplayProperties& info, | 48 const api::system_display::DisplayProperties& info, |
| 50 std::string* error) = 0; | 49 std::string* error) = 0; |
| 51 | 50 |
| 52 // Get the screen that is always active, which will be used for monitoring | |
| 53 // display changes events. | |
| 54 virtual gfx::Screen* GetActiveScreen() = 0; | |
| 55 | |
| 56 // Enable the unified desktop feature. | 51 // Enable the unified desktop feature. |
| 57 virtual void EnableUnifiedDesktop(bool enable); | 52 virtual void EnableUnifiedDesktop(bool enable); |
| 58 | 53 |
| 59 // Get display information. | 54 // Get display information. |
| 60 virtual DisplayInfo GetAllDisplaysInfo(); | 55 virtual DisplayInfo GetAllDisplaysInfo(); |
| 61 | 56 |
| 62 protected: | 57 protected: |
| 63 DisplayInfoProvider(); | 58 DisplayInfoProvider(); |
| 64 | 59 |
| 65 // Create a DisplayUnitInfo from a gfx::Display for implementations of | 60 // Create a DisplayUnitInfo from a gfx::Display for implementations of |
| (...skipping 10 matching lines...) Expand all Loading... |
| 76 virtual void UpdateDisplayUnitInfoForPlatform( | 71 virtual void UpdateDisplayUnitInfoForPlatform( |
| 77 const gfx::Display& display, | 72 const gfx::Display& display, |
| 78 api::system_display::DisplayUnitInfo* unit) = 0; | 73 api::system_display::DisplayUnitInfo* unit) = 0; |
| 79 | 74 |
| 80 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); | 75 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); |
| 81 }; | 76 }; |
| 82 | 77 |
| 83 } // namespace extensions | 78 } // namespace extensions |
| 84 | 79 |
| 85 #endif // EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 80 #endif // EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
| OLD | NEW |