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

Unified Diff: ui/arc/notification/arc_custom_notification_view.h

Issue 2734933006: Show the settings button on a pinned notification. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_custom_notification_view.h
diff --git a/ui/arc/notification/arc_custom_notification_view.h b/ui/arc/notification/arc_custom_notification_view.h
index c59a61e6b57d70d50530f109e8790457a37459fc..7495bb3313c81226c3c1fd6fc44b67b17f4ad7f9 100644
--- a/ui/arc/notification/arc_custom_notification_view.h
+++ b/ui/arc/notification/arc_custom_notification_view.h
@@ -13,6 +13,7 @@
#include "ui/arc/notification/arc_notification_surface_manager.h"
#include "ui/aura/window_observer.h"
#include "ui/message_center/views/custom_notification_content_view_delegate.h"
+#include "ui/message_center/views/padded_button.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/native/native_view_host.h"
@@ -42,11 +43,26 @@ class ArcCustomNotificationView
private:
class ContentViewDelegate;
- class ControlButton;
class EventForwarder;
class SettingsButton;
class SlideHelper;
+ // A image button class used for the settings button and the close button.
+ // We can't use forward declaration for thsi class due to std::unique_ptr<>
+ // requires size of this class.
+ class ControlButton : public message_center::PaddedButton {
+ public:
+ explicit ControlButton(ArcCustomNotificationView* owner);
+ void OnFocus() override;
+ void OnBlur() override;
+
+ private:
+ ArcCustomNotificationView* const owner_;
+
+ DISALLOW_COPY_AND_ASSIGN(ControlButton);
+ };
+
+ void CreateCloseButton();
void CreateFloatingControlButtons();
void SetSurface(exo::NotificationSurface* surface);
void UpdatePreferredSize();
@@ -109,7 +125,7 @@ class ArcCustomNotificationView
std::unique_ptr<views::Widget> floating_control_buttons_widget_;
views::View* control_buttons_view_ = nullptr;
- ControlButton* close_button_ = nullptr;
+ std::unique_ptr<ControlButton> close_button_ = nullptr;
yoshiki 2017/03/10 05:27:12 nit : "= nullptr" is not necessary.
yhanada 2017/03/10 05:44:12 Done.
ControlButton* settings_button_ = nullptr;
// Protects from call loops between Layout and OnWindowBoundsChanged.
« no previous file with comments | « no previous file | ui/arc/notification/arc_custom_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698