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

Side by Side Diff: components/exo/notification_surface_impl.h

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

Powered by Google App Engine
This is Rietveld 408576698