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

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

Issue 2960333003: Extract the view of control buttons on notification into a separated class (Closed)
Patch Set: Created 3 years, 6 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 324f5d4c88401115f8e7185ce7372c06829c0ae1..5cdd24763c377c80215f0e0ccc2fb897a4293183 100644
--- a/ui/arc/notification/arc_notification_content_view.h
+++ b/ui/arc/notification/arc_notification_content_view.h
@@ -13,15 +13,16 @@
#include "ui/arc/notification/arc_notification_item.h"
#include "ui/arc/notification/arc_notification_surface_manager.h"
#include "ui/aura/window_observer.h"
-#include "ui/gfx/animation/animation_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"
namespace gfx {
class LinearAnimation;
}
+namespace message_center {
+class NotificationControlButtonsView;
+}
+
namespace ui {
struct AXActionData;
}
@@ -39,11 +40,9 @@ class ArcNotificationSurface;
// content in itself. This is implemented as a child of ArcNotificationView.
class ArcNotificationContentView
: public views::NativeViewHost,
- public views::ButtonListener,
public aura::WindowObserver,
public ArcNotificationItem::Observer,
- public ArcNotificationSurfaceManager::Observer,
- public gfx::AnimationDelegate {
+ public ArcNotificationSurfaceManager::Observer {
public:
static const char kViewClassName[];
@@ -64,21 +63,6 @@ class ArcNotificationContentView
class SettingsButton;
class SlideHelper;
- // A image button class used for the settings button and the close button.
- // We can't use forward declaration for this class due to std::unique_ptr<>
- // requires size of this class.
- class ControlButton : public message_center::PaddedButton {
- public:
- explicit ControlButton(ArcNotificationContentView* owner);
- void OnFocus() override;
- void OnBlur() override;
-
- private:
- ArcNotificationContentView* const owner_;
-
- DISALLOW_COPY_AND_ASSIGN(ControlButton);
- };
-
void CreateCloseButton();
void CreateSettingsButton();
void MaybeCreateFloatingControlButtons();
@@ -89,8 +73,6 @@ class ArcNotificationContentView
void UpdateSnapshot();
void AttachSurface();
void ActivateToast();
- void StartControlButtonsColorAnimation();
- bool ShouldUpdateControlButtonsColor() const;
void UpdateAccessibleName();
// views::NativeViewHost
@@ -106,9 +88,6 @@ class ArcNotificationContentView
bool HandleAccessibleAction(const ui::AXActionData& action) override;
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
- // views::ButtonListener
- void ButtonPressed(views::Button* sender, const ui::Event& event) override;
-
// aura::WindowObserver
void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
@@ -123,10 +102,6 @@ class ArcNotificationContentView
void OnNotificationSurfaceAdded(ArcNotificationSurface* surface) override;
void OnNotificationSurfaceRemoved(ArcNotificationSurface* surface) override;
- // AnimationDelegate
- void AnimationEnded(const gfx::Animation* animation) override;
- void AnimationProgressed(const gfx::Animation* animation) override;
-
// 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;
@@ -151,9 +126,8 @@ class ArcNotificationContentView
// it.
std::unique_ptr<views::Widget> floating_control_buttons_widget_;
- views::View* control_buttons_view_ = nullptr;
- std::unique_ptr<ControlButton> close_button_;
- ControlButton* settings_button_ = nullptr;
+ message_center::NotificationControlButtonsView* control_buttons_view_ =
yhanada 2017/06/29 04:14:47 too long line?
yoshiki 2017/06/29 06:29:41 No, it has only 73 chars.
+ nullptr;
// Protects from call loops between Layout and OnWindowBoundsChanged.
bool in_layout_ = false;

Powered by Google App Engine
This is Rietveld 408576698