Chromium Code Reviews| Index: services/native_viewport/ozone/display_manager.h | 
| diff --git a/services/native_viewport/ozone/display_manager.h b/services/native_viewport/ozone/display_manager.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..816841fc63ddbed76d6516c1f6e95480448e24f6 | 
| --- /dev/null | 
| +++ b/services/native_viewport/ozone/display_manager.h | 
| @@ -0,0 +1,45 @@ | 
| +// Copyright 2015 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef SERVICES_NATIVE_VIEWPORT_DISPLAY_MANAGER_H_ | 
| +#define SERVICES_NATIVE_VIEWPORT_DISPLAY_MANAGER_H_ | 
| + | 
| +#include <vector> | 
| +#include "ui/display/types/native_display_delegate.h" | 
| +#include "ui/display/types/native_display_observer.h" | 
| +#include "ui/gfx/geometry/rect.h" | 
| + | 
| +namespace native_viewport { | 
| + | 
| +class DisplayManager : public ui::NativeDisplayObserver { | 
| + public: | 
| + DisplayManager(); | 
| + ~DisplayManager() override; | 
| + | 
| + private: | 
| + void OnDisplaysAquired(const std::vector<ui::DisplaySnapshot*>& displays); | 
| + void OnDisplayConfigured(const gfx::Rect& bounds, bool success); | 
| + | 
| + // ui::NativeDisplayObserver | 
| + void OnConfigurationChanged() override; | 
| + | 
| + scoped_ptr<ui::NativeDisplayDelegate> delegate_; | 
| + | 
| + // Flags used to keep track of the current state of display configuration. | 
| + // | 
| + // True if configuring the displays. In this case a new display configuration | 
| + // isn't started. | 
| + 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.
 
 | 
| + | 
| + // If |is_configuring_| is true and another display configuration event | 
| + // happens, the event is deferred. This is set to true and a display | 
| + // configuration will be scheduled after the current one finishes. | 
| + bool should_configure_ = false; | 
| + | 
| + DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 
| +}; | 
| + | 
| +} // namespace | 
| 
 
jamesr
2015/08/25 00:30:28
}  // namespace native_viewport
 
cdotstout
2015/08/27 19:10:21
Done.
 
 | 
| + | 
| +#endif |