Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1041)

Unified Diff: ui/aura/window_port_for_shutdown.h

Issue 2897663002: chromeos: makes it possible for windows to outlive WindowTreeClient (Closed)
Patch Set: cleanup Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_port_for_shutdown.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_port_for_shutdown.h
diff --git a/ui/aura/window_port_for_shutdown.h b/ui/aura/window_port_for_shutdown.h
new file mode 100644
index 0000000000000000000000000000000000000000..894e2c7259f74b830da181b31bd3515cd10a1863
--- /dev/null
+++ b/ui/aura/window_port_for_shutdown.h
@@ -0,0 +1,47 @@
+// Copyright 2017 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_AURA_WINDOW_PORT_FOR_SHUTDOWN_H_
+#define UI_AURA_WINDOW_PORT_FOR_SHUTDOWN_H_
+
+#include "ui/aura/window_port.h"
+
+namespace aura {
+
+// When WindowTreeClient is destroyed any existing windows get a
+// WindowPortForShutdown assigned to them. This allows for the Window to keep
+// working without a WindowTreeClient. This class is *only* used inside aura.
+class WindowPortForShutdown : public WindowPort {
+ public:
+ WindowPortForShutdown();
+ ~WindowPortForShutdown() override;
+
+ static void Install(aura::Window* window);
+
+ // WindowPort:
+ void OnPreInit(Window* window) override;
+ void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ void OnWillAddChild(Window* child) override;
+ void OnWillRemoveChild(Window* child) override;
+ void OnWillMoveChild(size_t current_index, size_t dest_index) override;
+ void OnVisibilityChanged(bool visible) override;
+ void OnDidChangeBounds(const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) override;
+ std::unique_ptr<ui::PropertyData> OnWillChangeProperty(
+ const void* key) override;
+ void OnPropertyChanged(const void* key,
+ int64_t old_value,
+ std::unique_ptr<ui::PropertyData> data) override;
+ std::unique_ptr<cc::CompositorFrameSink> CreateCompositorFrameSink() override;
+ cc::SurfaceId GetSurfaceId() const override;
+ void OnWindowAddedToRootWindow() override;
+ void OnWillRemoveWindowFromRootWindow() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WindowPortForShutdown);
+};
+
+} // namespace aura
+
+#endif // UI_AURA_WINDOW_PORT_FOR_SHUTDOWN_H_
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_port_for_shutdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698