Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SERVICES_NATIVE_VIEWPORT_DISPLAY_MANAGER_H_ | |
| 6 #define SERVICES_NATIVE_VIEWPORT_DISPLAY_MANAGER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 #include "ui/display/types/native_display_delegate.h" | |
| 10 #include "ui/display/types/native_display_observer.h" | |
| 11 #include "ui/gfx/geometry/rect.h" | |
| 12 | |
| 13 namespace native_viewport { | |
| 14 | |
| 15 class DisplayManager : public ui::NativeDisplayObserver { | |
| 16 public: | |
| 17 DisplayManager(); | |
| 18 ~DisplayManager() override; | |
| 19 | |
| 20 private: | |
| 21 void OnDisplaysAquired(const std::vector<ui::DisplaySnapshot*>& displays); | |
| 22 void OnDisplayConfigured(const gfx::Rect& bounds, bool success); | |
| 23 | |
| 24 // ui::NativeDisplayObserver | |
| 25 void OnConfigurationChanged() override; | |
| 26 | |
| 27 scoped_ptr<ui::NativeDisplayDelegate> delegate_; | |
| 28 | |
| 29 // Flags used to keep track of the current state of display configuration. | |
| 30 // | |
| 31 // True if configuring the displays. In this case a new display configuration | |
| 32 // isn't started. | |
| 33 bool is_configuring_ = false; | |
|
jamesr
2015/08/25 00:30:28
guideline for member initialization like this is t
cdotstout
2015/08/27 19:10:21
Done.
| |
| 34 | |
| 35 // If |is_configuring_| is true and another display configuration event | |
| 36 // happens, the event is deferred. This is set to true and a display | |
| 37 // configuration will be scheduled after the current one finishes. | |
| 38 bool should_configure_ = false; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | |
| 41 }; | |
| 42 | |
| 43 } // namespace | |
|
jamesr
2015/08/25 00:30:28
} // namespace native_viewport
cdotstout
2015/08/27 19:10:21
Done.
| |
| 44 | |
| 45 #endif | |
| OLD | NEW |