OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ |
| 6 #define COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "components/exo/surface_delegate.h" |
| 13 #include "components/exo/surface_observer.h" |
| 14 #include "ui/gfx/geometry/size.h" |
| 15 |
| 16 namespace aura { |
| 17 class Window; |
| 18 } |
| 19 |
| 20 namespace exo { |
| 21 class NotificationSurfaceManager; |
| 22 class Surface; |
| 23 |
| 24 // Handles notification surface role of a given surface. |
| 25 class NotificationSurface : public SurfaceDelegate, public SurfaceObserver { |
| 26 public: |
| 27 NotificationSurface(NotificationSurfaceManager* manager, |
| 28 Surface* surface, |
| 29 const std::string& notification_id); |
| 30 ~NotificationSurface() override; |
| 31 |
| 32 gfx::Size GetSize() const; |
| 33 |
| 34 aura::Window* window() { return window_.get(); } |
| 35 const std::string& notification_id() const { return notification_id_; } |
| 36 |
| 37 private: |
| 38 // Overridden from SurfaceDelegate: |
| 39 void OnSurfaceCommit() override; |
| 40 bool IsSurfaceSynchronized() const override; |
| 41 |
| 42 // Overridden from SurfaceObserver: |
| 43 void OnSurfaceDestroying(Surface* surface) override; |
| 44 |
| 45 NotificationSurfaceManager* const manager_; // Not owned. |
| 46 Surface* surface_; // Not owned. |
| 47 const std::string notification_id_; |
| 48 |
| 49 std::unique_ptr<aura::Window> window_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(NotificationSurface); |
| 52 }; |
| 53 |
| 54 } // namespace exo |
| 55 |
| 56 #endif // COMPONENTS_EXO_NOTIFICATION_SURFACE_H_ |
OLD | NEW |