Replace DISALLOW_COPY_AND_ASSIGN in remoting/

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: Ibbae02ba444d7308489dfb03c31be23dcfb3c2cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3174302
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@{#923948}
diff --git a/remoting/host/basic_desktop_environment.h b/remoting/host/basic_desktop_environment.h
index 413aa63..7b8fa56 100644
--- a/remoting/host/basic_desktop_environment.h
+++ b/remoting/host/basic_desktop_environment.h
@@ -30,6 +30,9 @@
 // the local console.
 class BasicDesktopEnvironment : public DesktopEnvironment {
  public:
+  BasicDesktopEnvironment(const BasicDesktopEnvironment&) = delete;
+  BasicDesktopEnvironment& operator=(const BasicDesktopEnvironment&) = delete;
+
   ~BasicDesktopEnvironment() override;
 
   // DesktopEnvironment implementation.
@@ -110,8 +113,6 @@
   base::WeakPtr<ClientSessionControl> client_session_control_;
 
   DesktopEnvironmentOptions options_;
-
-  DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironment);
 };
 
 // Used to create |BasicDesktopEnvironment| instances.
@@ -122,6 +123,12 @@
       scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner,
       scoped_refptr<base::SingleThreadTaskRunner> input_task_runner,
       scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
+
+  BasicDesktopEnvironmentFactory(const BasicDesktopEnvironmentFactory&) =
+      delete;
+  BasicDesktopEnvironmentFactory& operator=(
+      const BasicDesktopEnvironmentFactory&) = delete;
+
   ~BasicDesktopEnvironmentFactory() override;
 
   // DesktopEnvironmentFactory implementation.
@@ -158,8 +165,6 @@
 
   // Used to run UI code.
   scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
-
-  DISALLOW_COPY_AND_ASSIGN(BasicDesktopEnvironmentFactory);
 };
 
 }  // namespace remoting