| 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 #ifndef UI_OZONE_PLATFORM_TEST_TEST_WINDOW_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_HEADLESS_HEADLESS_WINDOW_MANAGER_H_ |
| 6 #define UI_OZONE_PLATFORM_TEST_TEST_WINDOW_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_HEADLESS_HEADLESS_WINDOW_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/ozone/public/surface_factory_ozone.h" | 14 #include "ui/ozone/public/surface_factory_ozone.h" |
| 14 | 15 |
| 15 namespace ui { | 16 namespace ui { |
| 16 | 17 |
| 17 class TestWindow; | 18 class HeadlessWindow; |
| 18 | 19 |
| 19 class TestWindowManager { | 20 class HeadlessWindowManager { |
| 20 public: | 21 public: |
| 21 explicit TestWindowManager(const base::FilePath& dump_location); | 22 explicit HeadlessWindowManager(const base::FilePath& dump_location); |
| 22 ~TestWindowManager(); | 23 ~HeadlessWindowManager(); |
| 23 | 24 |
| 24 // Initialize (mainly check that we have a place to write output to). | 25 // Initialize (mainly check that we have a place to write output to). |
| 25 void Initialize(); | 26 void Initialize(); |
| 26 | 27 |
| 27 // Register a new window. Returns the window id. | 28 // Register a new window. Returns the window id. |
| 28 int32_t AddWindow(TestWindow* window); | 29 int32_t AddWindow(HeadlessWindow* window); |
| 29 | 30 |
| 30 // Remove a window. | 31 // Remove a window. |
| 31 void RemoveWindow(int32_t window_id, TestWindow* window); | 32 void RemoveWindow(int32_t window_id, HeadlessWindow* window); |
| 32 | 33 |
| 33 // Find a window object by id; | 34 // Find a window object by id; |
| 34 TestWindow* GetWindow(int32_t window_id); | 35 HeadlessWindow* GetWindow(int32_t window_id); |
| 35 | 36 |
| 36 // User-supplied path for images. | 37 // User-supplied path for images. |
| 37 base::FilePath base_path() const; | 38 base::FilePath base_path() const; |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 base::FilePath location_; | 41 base::FilePath location_; |
| 41 | 42 |
| 42 IDMap<TestWindow> windows_; | 43 IDMap<HeadlessWindow> windows_; |
| 43 base::ThreadChecker thread_checker_; | 44 base::ThreadChecker thread_checker_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(TestWindowManager); | 46 DISALLOW_COPY_AND_ASSIGN(HeadlessWindowManager); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace ui | 49 } // namespace ui |
| 49 | 50 |
| 50 #endif // UI_OZONE_PLATFORM_TEST_TEST_WINDOW_MANAGER_H_ | 51 #endif // UI_OZONE_PLATFORM_HEADLESS_HEADLESS_WINDOW_MANAGER_H_ |
| OLD | NEW |