Skip to content

Commit

Permalink
Move FakeDisplay* from display/manager to their own component
Browse files Browse the repository at this point in the history
Ozone platforms should not depend on ui/display/manager
since that is a high level build target that ultimately
can depend on ozone again, creating a dependency cycle.

This is a followup to previous "fix one instance" that fixes
all the instances, which I hope will be enough to break
the cycle blocking
https://chromium-review.googlesource.com/c/chromium/src/+/1538507

For path changes in ash:
TBR=jamescook@chromium.org

Change-Id: Ice1d8b21e9bc1709c07bd37943857b07c6093798
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553424
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#650472}
  • Loading branch information
bratell-at-opera authored and Commit Bot committed Apr 12, 2019
1 parent c875d63 commit 249416b
Show file tree
Hide file tree
Showing 30 changed files with 109 additions and 44 deletions.
2 changes: 2 additions & 0 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,8 @@ test("ash_unittests") {
"//ui/compositor_extra:compositor_extra",
"//ui/display",
"//ui/display:test_support",
"//ui/display/fake",
"//ui/display/manager",
"//ui/display/types",
"//ui/events",
"//ui/events:gesture_detection",
Expand Down
2 changes: 1 addition & 1 deletion ash/display/display_color_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "components/quirks/quirks_manager.h"
#include "net/url_request/url_request_context_getter.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/test/action_logger_util.h"
#include "ui/display/manager/test/test_native_display_delegate.h"

Expand Down
2 changes: 1 addition & 1 deletion ash/display/display_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
#include "ui/display/display_layout_builder.h"
#include "ui/display/display_observer.h"
#include "ui/display/display_switches.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/display_change_observer.h"
#include "ui/display/manager/display_layout_store.h"
#include "ui/display/manager/display_manager_utilities.h"
#include "ui/display/manager/display_util.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/manager/managed_display_info.h"
#include "ui/display/manager/test/touch_device_manager_test_api.h"
#include "ui/display/screen.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/display/projecting_observer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "chromeos/dbus/power/fake_power_manager_client.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/fake/fake_display_snapshot.h"

namespace ash {

Expand Down
2 changes: 1 addition & 1 deletion ash/system/night_light/night_light_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "base/strings/pattern.h"
#include "components/prefs/pref_service.h"
#include "ui/compositor/layer.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/display_change_observer.h"
#include "ui/display/manager/display_manager.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/manager/test/action_logger_util.h"
#include "ui/display/manager/test/test_native_display_delegate.h"

Expand Down
2 changes: 1 addition & 1 deletion ash/wm/lock_state_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "base/run_loop.h"
#include "base/time/time.h"
#include "chromeos/dbus/power/fake_power_manager_client.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/display_configurator.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/types/display_constants.h"
#include "ui/gfx/geometry/size.h"

Expand Down
3 changes: 2 additions & 1 deletion ui/display/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ test("display_unittests") {
"display_layout_unittest.cc",
"display_list_unittest.cc",
"display_unittest.cc",
"fake/fake_display_snapshot_unittest.cc",
"manager/display_manager_utilities_unittest.cc",
"manager/fake_display_snapshot_unittest.cc",
"manager/json_converter_unittest.cc",
"manager/managed_display_info_unittest.cc",
"mojo/display_struct_traits_unittest.cc",
Expand Down Expand Up @@ -200,6 +200,7 @@ test("display_unittests") {
"//mojo/core/test:run_all_unittests",
"//testing/gmock",
"//testing/gtest",
"//ui/display/fake",
"//ui/display/manager",
"//ui/display/mojo:interfaces",
"//ui/display/types",
Expand Down
32 changes: 32 additions & 0 deletions ui/display/fake/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2019 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.

import("//build/config/jumbo.gni")
import("//build/config/ui.gni")

# This target contains dummy or fake classes that can be used as
# placeholders when lacking something better, or for testing.
jumbo_component("fake") {
sources = [
"fake_display_delegate.cc",
"fake_display_delegate.h",
"fake_display_export.h",
"fake_display_snapshot.cc",
"fake_display_snapshot.h",
]

configs += [ "//build/config/compiler:wexit_time_destructors" ]

defines = [ "FAKE_DISPLAY_IMPLEMENTATION" ]

deps = [
"//base",
"//skia",
"//third_party/re2",
"//ui/display",
"//ui/display/types",
"//ui/display/util",
"//ui/gfx/geometry",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/display/manager/fake_display_delegate.h"
#include "ui/display/fake/fake_display_delegate.h"

#include <string>
#include <utility>
Expand All @@ -16,6 +16,7 @@
#include "base/time/time.h"
#include "ui/display/display.h"
#include "ui/display/display_switches.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/types/display_constants.h"
#include "ui/display/types/native_display_observer.h"
#include "ui/display/util/display_util.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_DISPLAY_MANAGER_FAKE_DISPLAY_DELEGATE_H_
#define UI_DISPLAY_MANAGER_FAKE_DISPLAY_DELEGATE_H_
#ifndef UI_DISPLAY_FAKE_FAKE_DISPLAY_DELEGATE_H_
#define UI_DISPLAY_FAKE_FAKE_DISPLAY_DELEGATE_H_

#include <memory>
#include <string>
Expand All @@ -14,8 +14,8 @@
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/timer/timer.h"
#include "ui/display/manager/display_manager_export.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/fake/fake_display_delegate.h"
#include "ui/display/fake/fake_display_export.h"
#include "ui/display/types/fake_display_controller.h"
#include "ui/display/types/native_display_delegate.h"

Expand Down Expand Up @@ -68,9 +68,8 @@ namespace display {
//
// FakeDisplayDelegate also implements FakeDisplayController which provides a
// way to change the display state at runtime.
class DISPLAY_MANAGER_EXPORT FakeDisplayDelegate
: public NativeDisplayDelegate,
public FakeDisplayController {
class FAKE_DISPLAY_EXPORT FakeDisplayDelegate : public NativeDisplayDelegate,
public FakeDisplayController {
public:
FakeDisplayDelegate();
~FakeDisplayDelegate() override;
Expand Down Expand Up @@ -133,4 +132,4 @@ class DISPLAY_MANAGER_EXPORT FakeDisplayDelegate
};

} // namespace display
#endif // UI_DISPLAY_MANAGER_FAKE_DISPLAY_DELEGATE_H_
#endif // UI_DISPLAY_FAKE_FAKE_DISPLAY_DELEGATE_H_
37 changes: 37 additions & 0 deletions ui/display/fake/fake_display_export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2019 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 UI_DISPLAY_FAKE_FAKE_DISPLAY_EXPORT_H_
#define UI_DISPLAY_FAKE_FAKE_DISPLAY_EXPORT_H_

// Defines FAKE_DISPLAY_EXPORT so that functionality implemented by
// the ui/display/fake module can be exported to consumers.

#if defined(COMPONENT_BUILD)

#if defined(WIN32)

#if defined(FAKE_DISPLAY_IMPLEMENTATION)
#define FAKE_DISPLAY_EXPORT __declspec(dllexport)
#else
#define FAKE_DISPLAY_EXPORT __declspec(dllimport)
#endif

#else // !defined(WIN32)

#if defined(FAKE_DISPLAY_IMPLEMENTATION)
#define FAKE_DISPLAY_EXPORT __attribute__((visibility("default")))
#else
#define FAKE_DISPLAY_EXPORT
#endif

#endif

#else // !defined(COMPONENT_BUILD)

#define FAKE_DISPLAY_EXPORT

#endif

#endif // UI_DISPLAY_FAKE_FAKE_DISPLAY_EXPORT_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/fake/fake_display_snapshot.h"

#include <inttypes.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_DISPLAY_MANAGER_FAKE_DISPLAY_SNAPSHOT_H_
#define UI_DISPLAY_MANAGER_FAKE_DISPLAY_SNAPSHOT_H_
#ifndef UI_DISPLAY_FAKE_FAKE_DISPLAY_SNAPSHOT_H_
#define UI_DISPLAY_FAKE_FAKE_DISPLAY_SNAPSHOT_H_

#include <stdint.h>

Expand All @@ -12,7 +12,7 @@
#include <vector>

#include "base/macros.h"
#include "ui/display/manager/display_manager_export.h"
#include "ui/display/fake/fake_display_export.h"
#include "ui/display/types/display_constants.h"
#include "ui/display/types/display_mode.h"
#include "ui/display/types/display_snapshot.h"
Expand All @@ -23,7 +23,7 @@ namespace display {

// A display snapshot that doesn't correspond to a physical display, used when
// running off device.
class DISPLAY_MANAGER_EXPORT FakeDisplaySnapshot : public DisplaySnapshot {
class FAKE_DISPLAY_EXPORT FakeDisplaySnapshot : public DisplaySnapshot {
public:
class Builder {
public:
Expand Down Expand Up @@ -125,4 +125,4 @@ class DISPLAY_MANAGER_EXPORT FakeDisplaySnapshot : public DisplaySnapshot {

} // namespace display

#endif // UI_DISPLAY_MANAGER_FAKE_DISPLAY_SNAPSHOT_H_
#endif // UI_DISPLAY_FAKE_FAKE_DISPLAY_SNAPSHOT_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/fake/fake_display_snapshot.h"

#include <memory>

Expand Down
5 changes: 0 additions & 5 deletions ui/display/manager/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jumbo_component("manager") {
"display_manager_export.h",
"display_manager_utilities.cc",
"display_manager_utilities.h",
"fake_display_delegate.cc",
"fake_display_delegate.h",
"fake_display_snapshot.cc",
"fake_display_snapshot.h",
"json_converter.cc",
"json_converter.h",
"managed_display_info.cc",
Expand Down Expand Up @@ -60,7 +56,6 @@ jumbo_component("manager") {

deps = [
"//base",
"//third_party/re2",
"//ui/base",
"//ui/display/mojo:interfaces",
"//ui/display/util",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "base/bind.h"
#include "base/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/display_layout_manager.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/manager/test/action_logger_util.h"
#include "ui/display/manager/test/test_display_layout_manager.h"
#include "ui/display/manager/test/test_native_display_delegate.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/display/manager/configure_displays_task_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/configure_displays_task.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/manager/test/action_logger_util.h"
#include "ui/display/manager/test/test_native_display_delegate.h"

Expand Down
2 changes: 1 addition & 1 deletion ui/display/manager/display_change_observer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/display_features.h"
#include "ui/display/display_switches.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/display_configurator.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/manager/managed_display_info.h"
#include "ui/display/types/display_mode.h"
#include "ui/gfx/geometry/rect.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/display/manager/display_configurator_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "base/stl_util.h"
#include "chromeos/constants/chromeos_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/test/action_logger_util.h"
#include "ui/display/manager/test/test_native_display_delegate.h"
#include "ui/display/util/display_util.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "base/macros.h"
#include "base/optional.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/display_layout_manager.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/manager/test/action_logger_util.h"
#include "ui/display/manager/test/test_display_layout_manager.h"
#include "ui/display/manager/test/test_native_display_delegate.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/fake/fake_display_snapshot.h"
#include "ui/display/manager/display_layout_manager.h"
#include "ui/display/manager/fake_display_snapshot.h"
#include "ui/display/manager/test/action_logger_util.h"
#include "ui/display/manager/test/test_native_display_delegate.h"

Expand Down
4 changes: 1 addition & 3 deletions ui/display/util/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ jumbo_component("util") {
if (is_chromeos) {
deps += [ "//ui/display/types" ]
} else if (is_mac) {
libs = [
"IOSurface.framework",
]
libs = [ "IOSurface.framework" ]
}
}

Expand Down
2 changes: 1 addition & 1 deletion ui/ozone/platform/magma/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source_set("magma") {
"//base",
"//skia",
"//ui/base",
"//ui/display/manager",
"//ui/display/fake",
"//ui/events",
"//ui/events/ozone:events_ozone_layout",
"//ui/events/platform",
Expand Down
2 changes: 1 addition & 1 deletion ui/ozone/platform/magma/ozone_platform_magma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
#include "ui/display/manager/fake_display_delegate.h"
#include "ui/display/fake/fake_display_delegate.h"
#include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
#include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
#include "ui/events/platform/platform_event_source.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/ozone/platform/scenic/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ source_set("scenic") {
"//third_party/fuchsia-sdk/sdk:ui_gfx",
"//third_party/fuchsia-sdk/sdk:ui_scenic",
"//ui/base",
"//ui/display/manager",
"//ui/display/fake",
"//ui/events:dom_keycode_converter",
"//ui/events/ozone:events_ozone_layout",
"//ui/gfx/geometry",
Expand Down
2 changes: 1 addition & 1 deletion ui/ozone/platform/scenic/ozone_platform_scenic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop_current.h"
#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
#include "ui/display/manager/fake_display_delegate.h"
#include "ui/display/fake/fake_display_delegate.h"
#include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
#include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
#include "ui/events/platform/platform_event_source.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/ozone/platform/windows/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source_set("windows") {
"//base",
"//skia",
"//ui/base",
"//ui/display/manager",
"//ui/display/fake",
"//ui/events",
"//ui/events/ozone:events_ozone_layout",
"//ui/events/platform",
Expand Down
Loading

0 comments on commit 249416b

Please sign in to comment.