| 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 UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ | 5 #ifndef UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| 6 #define UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ | 6 #define UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "ui/display/display.h" | 21 #include "ui/display/display.h" |
| 22 #include "ui/display/display_export.h" | 22 #include "ui/display/display_export.h" |
| 23 #include "ui/display/display_observer.h" | 23 #include "ui/display/display_observer.h" |
| 24 #include "ui/display/manager/display_layout.h" | 24 #include "ui/display/manager/display_layout.h" |
| 25 #include "ui/display/manager/display_string_provider.h" |
| 25 #include "ui/display/manager/managed_display_info.h" | 26 #include "ui/display/manager/managed_display_info.h" |
| 26 #include "ui/display/types/display_constants.h" | 27 #include "ui/display/types/display_constants.h" |
| 27 | 28 |
| 28 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 29 #include "ui/display/chromeos/display_configurator.h" | 30 #include "ui/display/chromeos/display_configurator.h" |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 namespace gfx { | 33 namespace gfx { |
| 33 class Insets; | 34 class Insets; |
| 34 class Rect; | 35 class Rect; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Called before and after the display configuration changes. When | 68 // Called before and after the display configuration changes. When |
| 68 // |clear_focus| is true, the implementation should deactivate the active | 69 // |clear_focus| is true, the implementation should deactivate the active |
| 69 // window and set the focus window to NULL. | 70 // window and set the focus window to NULL. |
| 70 virtual void PreDisplayConfigurationChange(bool clear_focus) = 0; | 71 virtual void PreDisplayConfigurationChange(bool clear_focus) = 0; |
| 71 virtual void PostDisplayConfigurationChange(bool must_clear_window) = 0; | 72 virtual void PostDisplayConfigurationChange(bool must_clear_window) = 0; |
| 72 | 73 |
| 73 #if defined(OS_CHROMEOS) | 74 #if defined(OS_CHROMEOS) |
| 74 // Get the ui::DisplayConfigurator. | 75 // Get the ui::DisplayConfigurator. |
| 75 virtual ui::DisplayConfigurator* display_configurator() = 0; | 76 virtual ui::DisplayConfigurator* display_configurator() = 0; |
| 76 #endif | 77 #endif |
| 77 | |
| 78 virtual std::string GetInternalDisplayNameString() = 0; | |
| 79 virtual std::string GetUnknownDisplayNameString() = 0; | |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 // How the second display will be used. | 80 // How the second display will be used. |
| 83 // 1) EXTENDED mode extends the desktop to the second dislpay. | 81 // 1) EXTENDED mode extends the desktop to the second dislpay. |
| 84 // 2) MIRRORING mode copies the content of the primary display to | 82 // 2) MIRRORING mode copies the content of the primary display to |
| 85 // the 2nd display. (Software Mirroring). | 83 // the 2nd display. (Software Mirroring). |
| 86 // 3) UNIFIED mode creates single desktop across multiple displays. | 84 // 3) UNIFIED mode creates single desktop across multiple displays. |
| 87 enum MultiDisplayMode { | 85 enum MultiDisplayMode { |
| 88 EXTENDED = 0, | 86 EXTENDED = 0, |
| 89 MIRRORING, | 87 MIRRORING, |
| 90 UNIFIED, | 88 UNIFIED, |
| 91 }; | 89 }; |
| 92 | 90 |
| 93 // The display ID for a virtual display assigned to a unified desktop. | 91 // The display ID for a virtual display assigned to a unified desktop. |
| 94 static int64_t kUnifiedDisplayId; | 92 static int64_t kUnifiedDisplayId; |
| 95 | 93 |
| 96 explicit DisplayManager(std::unique_ptr<Screen> screen); | 94 DisplayManager(std::unique_ptr<Screen> screen, |
| 95 std::unique_ptr<DisplayStringProvider> string_provider); |
| 97 #if defined(OS_CHROMEOS) | 96 #if defined(OS_CHROMEOS) |
| 98 ~DisplayManager() override; | 97 ~DisplayManager() override; |
| 99 #else | 98 #else |
| 100 virtual ~DisplayManager(); | 99 virtual ~DisplayManager(); |
| 101 #endif | 100 #endif |
| 102 | 101 |
| 103 DisplayLayoutStore* layout_store() { return layout_store_.get(); } | 102 DisplayLayoutStore* layout_store() { return layout_store_.get(); } |
| 104 | 103 |
| 105 void set_delegate(Delegate* delegate) { delegate_ = delegate; } | 104 void set_delegate(Delegate* delegate) { delegate_ = delegate; } |
| 106 | 105 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 400 |
| 402 // Applies the |layout| and updates the bounds of displays in |display_list|. | 401 // Applies the |layout| and updates the bounds of displays in |display_list|. |
| 403 // |updated_ids| contains the ids for displays whose bounds have changed. | 402 // |updated_ids| contains the ids for displays whose bounds have changed. |
| 404 void ApplyDisplayLayout(const DisplayLayout& layout, | 403 void ApplyDisplayLayout(const DisplayLayout& layout, |
| 405 Displays* display_list, | 404 Displays* display_list, |
| 406 std::vector<int64_t>* updated_ids); | 405 std::vector<int64_t>* updated_ids); |
| 407 | 406 |
| 408 Delegate* delegate_ = nullptr; // not owned. | 407 Delegate* delegate_ = nullptr; // not owned. |
| 409 | 408 |
| 410 std::unique_ptr<Screen> screen_; | 409 std::unique_ptr<Screen> screen_; |
| 411 | 410 std::unique_ptr<DisplayStringProvider> string_provider_; |
| 412 std::unique_ptr<DisplayLayoutStore> layout_store_; | 411 std::unique_ptr<DisplayLayoutStore> layout_store_; |
| 413 | 412 |
| 414 int64_t first_display_id_ = kInvalidDisplayId; | 413 int64_t first_display_id_ = kInvalidDisplayId; |
| 415 | 414 |
| 416 // List of current active displays. | 415 // List of current active displays. |
| 417 Displays active_display_list_; | 416 Displays active_display_list_; |
| 418 // This list does not include the displays that will be removed if | 417 // This list does not include the displays that will be removed if |
| 419 // |UpdateDisplaysWith| is under execution. | 418 // |UpdateDisplaysWith| is under execution. |
| 420 // See https://crbug.com/632755 | 419 // See https://crbug.com/632755 |
| 421 Displays active_only_display_list_; | 420 Displays active_only_display_list_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 base::ObserverList<DisplayObserver> observers_; | 457 base::ObserverList<DisplayObserver> observers_; |
| 459 | 458 |
| 460 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; | 459 base::WeakPtrFactory<DisplayManager> weak_ptr_factory_; |
| 461 | 460 |
| 462 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 461 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
| 463 }; | 462 }; |
| 464 | 463 |
| 465 } // namespace display | 464 } // namespace display |
| 466 | 465 |
| 467 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ | 466 #endif // UI_DISPLAY_MANAGER_DISPLAY_MANAGER_H_ |
| OLD | NEW |