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

Unified Diff: components/exo/notification_surface_impl.h

Issue 2723143002: Add unittests of ArcCustomNotificationView (Closed)
Patch Set: wip 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 | « chrome/browser/chrome_browser_main_extra_parts_exo.cc ('k') | components/exo/notification_surface_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/notification_surface_impl.h
diff --git a/components/exo/notification_surface_impl.h b/components/exo/notification_surface_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..1aee0287bae0f01db1436739f3b0b5dcac28310d
--- /dev/null
+++ b/components/exo/notification_surface_impl.h
@@ -0,0 +1,61 @@
+// 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 COMPONENTS_EXO_NOTIFICATION_SURFACE_IMPL_H_
+#define COMPONENTS_EXO_NOTIFICATION_SURFACE_IMPL_H_
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "components/exo/notification_surface.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 NotificationSurfaceManager;
+class Surface;
+
+// Handles notification surface role of a given surface.
+class NotificationSurfaceImpl : public NotificationSurface,
+ public SurfaceDelegate,
+ public SurfaceObserver {
+ public:
+ NotificationSurfaceImpl(NotificationSurfaceManager* manager,
+ Surface* surface,
+ const std::string& notification_id);
+ ~NotificationSurfaceImpl() override;
+
+ gfx::Size GetSize() const override;
+ void AttachWindow(views::NativeViewHost* nvh) override;
+
+ aura::Window* GetWindow() const override;
+ const std::string& GetNotificationId() const override;
+
+ // Overridden from SurfaceDelegate:
+ void OnSurfaceCommit() override;
+ bool IsSurfaceSynchronized() const override;
+
+ // Overridden from SurfaceObserver:
+ void OnSurfaceDestroying(Surface* surface) override;
+
+ private:
+ NotificationSurfaceManager* const manager_; // Not owned.
+ Surface* surface_; // Not owned.
+ const std::string notification_id_;
+
+ std::unique_ptr<aura::Window> window_;
+ bool added_to_manager_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(NotificationSurfaceImpl);
+};
+
+} // namespace exo
+
+#endif // COMPONENTS_EXO_NOTIFICATION_SURFACE_IMPL_H_
« no previous file with comments | « chrome/browser/chrome_browser_main_extra_parts_exo.cc ('k') | components/exo/notification_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698