| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 private: | 83 private: |
| 84 void OnDisplaysAquired(const std::vector<ui::DisplaySnapshot*>& displays); | 84 void OnDisplaysAquired(const std::vector<ui::DisplaySnapshot*>& displays); |
| 85 void OnDisplayConfigured(const gfx::Rect& bounds, bool success); | 85 void OnDisplayConfigured(const gfx::Rect& bounds, bool success); |
| 86 | 86 |
| 87 // ui::NativeDisplayDelegate: | 87 // ui::NativeDisplayDelegate: |
| 88 void OnConfigurationChanged() override; | 88 void OnConfigurationChanged() override; |
| 89 | 89 |
| 90 scoped_ptr<ui::NativeDisplayDelegate> delegate_; | 90 scoped_ptr<ui::NativeDisplayDelegate> delegate_; |
| 91 base::Closure quit_closure_; | 91 base::Closure quit_closure_; |
| 92 RendererFactory renderer_factory_; | 92 RendererFactory renderer_factory_; |
| 93 ScopedVector<DemoWindow> windows_; | 93 std::vector<scoped_ptr<DemoWindow>> windows_; |
| 94 | 94 |
| 95 // Flags used to keep track of the current state of display configuration. | 95 // Flags used to keep track of the current state of display configuration. |
| 96 // | 96 // |
| 97 // True if configuring the displays. In this case a new display configuration | 97 // True if configuring the displays. In this case a new display configuration |
| 98 // isn't started. | 98 // isn't started. |
| 99 bool is_configuring_ = false; | 99 bool is_configuring_ = false; |
| 100 | 100 |
| 101 // If |is_configuring_| is true and another display configuration event | 101 // If |is_configuring_| is true and another display configuration event |
| 102 // happens, the event is deferred. This is set to true and a display | 102 // happens, the event is deferred. This is set to true and a display |
| 103 // configuration will be scheduled after the current one finishes. | 103 // configuration will be scheduled after the current one finishes. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 ->SetCurrentLayoutByName("us"); | 334 ->SetCurrentLayoutByName("us"); |
| 335 | 335 |
| 336 base::RunLoop run_loop; | 336 base::RunLoop run_loop; |
| 337 | 337 |
| 338 WindowManager window_manager(run_loop.QuitClosure()); | 338 WindowManager window_manager(run_loop.QuitClosure()); |
| 339 | 339 |
| 340 run_loop.Run(); | 340 run_loop.Run(); |
| 341 | 341 |
| 342 return 0; | 342 return 0; |
| 343 } | 343 } |
| OLD | NEW |