Replace DISALLOW_COPY_AND_ASSIGN in ui/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).
This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: I0c6bdd9a2ecaf131aa84a41d7c5262041d275ed6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3171777
Auto-Submit: Peter Boström <[email protected]>
Commit-Queue: Daniel Cheng <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Owners-Override: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/main@{#923641}
diff --git a/ui/compositor_extra/shadow.h b/ui/compositor_extra/shadow.h
index cc920b88..9ae1727 100644
--- a/ui/compositor_extra/shadow.h
+++ b/ui/compositor_extra/shadow.h
@@ -23,6 +23,10 @@
class Shadow : public ui::ImplicitAnimationObserver, public ui::LayerOwner {
public:
Shadow();
+
+ Shadow(const Shadow&) = delete;
+ Shadow& operator=(const Shadow&) = delete;
+
~Shadow() override;
// Initialize for the the given shadow |elevation|. This is passed to
@@ -63,6 +67,10 @@
public:
explicit ShadowLayerOwner(Shadow* owner,
std::unique_ptr<Layer> layer = nullptr);
+
+ ShadowLayerOwner(const ShadowLayerOwner&) = delete;
+ ShadowLayerOwner& operator=(const ShadowLayerOwner&) = delete;
+
~ShadowLayerOwner() override;
// ui::LayerOwner:
@@ -70,8 +78,6 @@
private:
Shadow* const owner_shadow_;
-
- DISALLOW_COPY_AND_ASSIGN(ShadowLayerOwner);
};
// Updates the shadow layer and its image to reflect |desired_elevation_|.
@@ -107,8 +113,6 @@
// Bounds of the content that the shadow encloses.
gfx::Rect content_bounds_;
-
- DISALLOW_COPY_AND_ASSIGN(Shadow);
};
} // namespace ui