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

Unified Diff: ui/arc/notification/arc_notification_content_view.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
Index: ui/arc/notification/arc_notification_content_view.h
diff --git a/ui/arc/notification/arc_notification_content_view.h b/ui/arc/notification/arc_notification_content_view.h
index d51adddffeab1d68e3afb9bad5446a9c3180ab59..b918e1c15d2d3ab6e10fe606fecdfc4fb78f2750 100644
--- a/ui/arc/notification/arc_notification_content_view.h
+++ b/ui/arc/notification/arc_notification_content_view.h
@@ -18,10 +18,6 @@
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/native/native_view_host.h"
-namespace exo {
-class NotificationSurface;
-}
-
namespace gfx {
class LinearAnimation;
}
@@ -37,6 +33,8 @@ class Widget;
namespace arc {
+class ArcNotificationSurface;
+
// ArcNotificationContentView is a view to host NotificationSurface and show the
// content in itself. This is implemented as a child of ArcNotificationView.
class ArcNotificationContentView
@@ -47,13 +45,22 @@ class ArcNotificationContentView
public ArcNotificationSurfaceManager::Observer,
public gfx::AnimationDelegate {
public:
+ static const char kViewClassName[];
+
explicit ArcNotificationContentView(ArcNotificationItem* item);
~ArcNotificationContentView() override;
+ // views::View overrides:
+ const char* GetClassName() const override;
+
std::unique_ptr<ArcNotificationContentViewDelegate>
CreateContentViewDelegate();
private:
+ friend class ArcNotificationContentViewTest;
+
+ static ArcNotificationSurfaceManager* surface_manager_for_testing_;
+
class ContentViewDelegate;
class EventForwarder;
class SettingsButton;
@@ -74,10 +81,11 @@ class ArcNotificationContentView
DISALLOW_COPY_AND_ASSIGN(ControlButton);
};
+ ArcNotificationSurfaceManager* GetSurfaceManager() const;
void CreateCloseButton();
void CreateSettingsButton();
void MaybeCreateFloatingControlButtons();
- void SetSurface(exo::NotificationSurface* surface);
+ void SetSurface(ArcNotificationSurface* surface);
void UpdatePreferredSize();
void UpdateControlButtonsVisibility();
void UpdatePinnedState();
@@ -115,8 +123,8 @@ class ArcNotificationContentView
void OnItemUpdated() override;
// ArcNotificationSurfaceManager::Observer:
- void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override;
- void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override;
+ void OnNotificationSurfaceAdded(ArcNotificationSurface* surface) override;
+ void OnNotificationSurfaceRemoved(ArcNotificationSurface* surface) override;
// AnimationDelegate
void AnimationEnded(const gfx::Animation* animation) override;
@@ -125,7 +133,7 @@ class ArcNotificationContentView
// If |item_| is null, we may be about to be destroyed. In this case,
// we have to be careful about what we do.
ArcNotificationItem* item_ = nullptr;
- exo::NotificationSurface* surface_ = nullptr;
+ ArcNotificationSurface* surface_ = nullptr;
const std::string notification_key_;
« no previous file with comments | « ui/arc/notification/arc_custom_notification_view_unittest.cc ('k') | ui/arc/notification/arc_notification_content_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698