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

Unified Diff: components/exo/notification_surface.h

Issue 2065133002: exo: Implement notification surface support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification-wayland-protocol
Patch Set: for comments in #2 Created 4 years, 6 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
Index: components/exo/notification_surface.h
diff --git a/components/exo/notification_surface.h b/components/exo/notification_surface.h
new file mode 100644
index 0000000000000000000000000000000000000000..4186aa12572e1737c55d8eb437f3639b350b5571
--- /dev/null
+++ b/components/exo/notification_surface.h
@@ -0,0 +1,56 @@
+// Copyright 2016 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 COMPONENTS_EXO_NOTIFICATION_SURFACE_H_
+#define COMPONENTS_EXO_NOTIFICATION_SURFACE_H_
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "components/exo/surface_delegate.h"
+#include "components/exo/surface_observer.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace aura {
+class Window;
+}
+
+namespace exo {
+class NotificationSurfaceRegistry;
+class Surface;
+
+// Handles notification surface role of a given surface.
+class NotificationSurface : public SurfaceDelegate, public SurfaceObserver {
+ public:
+ NotificationSurface(NotificationSurfaceRegistry* registry,
+ Surface* surface,
+ const std::string& notification_id);
+ ~NotificationSurface() override;
+
+ gfx::Size GetSize() const;
+
+ aura::Window* window() { return window_.get(); }
+ const std::string& notification_id() const { return notification_id_; }
+
+ private:
+ // Overridden from SurfaceDelegate:
+ void OnSurfaceCommit() override;
+ bool IsSurfaceSynchronized() const override;
+
+ // Overridden from SurfaceObserver:
+ void OnSurfaceDestroying(Surface* surface) override;
+
+ NotificationSurfaceRegistry* const registry_; // Not owned.
+ Surface* surface_; // Not owned.
+ const std::string notification_id_;
+
+ std::unique_ptr<aura::Window> window_;
+
+ DISALLOW_COPY_AND_ASSIGN(NotificationSurface);
+};
+
+} // namespace exo
+
+#endif // COMPONENTS_EXO_NOTIFICATION_SURFACE_H_

Powered by Google App Engine
This is Rietveld 408576698