| 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_
|
|
|