Chromium Code Reviews| 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..511ab949bcbce3f16b1991f8249cc3be8aea381d |
| --- /dev/null |
| +++ b/components/exo/notification_surface.h |
| @@ -0,0 +1,40 @@ |
| +// 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 <string> |
| + |
| +#include "base/macros.h" |
| +#include "components/exo/surface_observer.h" |
| +#include "ui/gfx/geometry/size.h" |
| + |
| +namespace exo { |
| +class Surface; |
| + |
| +// Handles notification surface role of a given surface. |
| +class NotificationSurface : public SurfaceObserver { |
|
reveman
2016/06/16 03:35:20
I think this should be a SurfaceDelegate so we can
xiyuan
2016/06/20 22:40:28
Done. Made it a SurfaceDelegate and create its own
|
| + public: |
| + NotificationSurface(Surface* surface, const std::string& notification_id); |
| + ~NotificationSurface() override; |
| + |
| + gfx::Size GetSize() const; |
| + |
| + Surface* surface() { return surface_; } |
|
reveman
2016/06/16 03:35:20
Do we need to expose the Surface? What part of it
xiyuan
2016/06/20 22:40:29
Right now, the surface is handled via NativeViewHo
|
| + const std::string& notification_id() const { return notification_id_; } |
| + |
| + private: |
| + // SurfaceObserver |
|
reveman
2016/06/16 03:35:20
nit: "Overridden from SurfaceObserver:"
xiyuan
2016/06/20 22:40:28
Done.
|
| + void OnSurfaceDestroying(Surface* surface) override; |
| + |
| + Surface* surface_; // Not owned. |
| + const std::string notification_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NotificationSurface); |
| +}; |
| + |
| +} // namespace exo |
| + |
| +#endif // COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ |