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

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: addressed comments 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
« no previous file with comments | « no previous file | ui/arc/notification/arc_notification_content_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2d9ef0ad1aeb1ca2d2da18d8e740eb01bd2e42a3 100644
--- a/ui/arc/notification/arc_notification_content_view.h
+++ b/ui/arc/notification/arc_notification_content_view.h
@@ -13,13 +13,10 @@
#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 {
@@ -39,11 +36,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 +59,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 +69,6 @@ class ArcNotificationContentView
void UpdateSnapshot();
void AttachSurface();
void ActivateToast();
- void StartControlButtonsColorAnimation();
- bool ShouldUpdateControlButtonsColor() const;
void UpdateAccessibleName();
// views::NativeViewHost
@@ -106,9 +84,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 +98,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,15 +122,12 @@ 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_ =
+ nullptr;
// Protects from call loops between Layout and OnWindowBoundsChanged.
bool in_layout_ = false;
- std::unique_ptr<gfx::LinearAnimation> control_button_color_animation_;
-
base::string16 accessible_name_;
DISALLOW_COPY_AND_ASSIGN(ArcNotificationContentView);
« no previous file with comments | « no previous file | ui/arc/notification/arc_notification_content_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698