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

Side by Side Diff: ui/message_center/views/notification_control_buttons_view.h

Issue 2967133002: Fix memory leak in NotificationControlButtonsView (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « no previous file | ui/message_center/views/notification_control_buttons_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 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 #include "base/macros.h" 5 #include "base/macros.h"
6 #include "third_party/skia/include/core/SkColor.h" 6 #include "third_party/skia/include/core/SkColor.h"
7 #include "ui/gfx/animation/animation_delegate.h" 7 #include "ui/gfx/animation/animation_delegate.h"
8 #include "ui/message_center/message_center_export.h" 8 #include "ui/message_center/message_center_export.h"
9 #include "ui/views/controls/button/button.h" 9 #include "ui/views/controls/button/button.h"
10 #include "ui/views/view.h" 10 #include "ui/views/view.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // Request the focus on the close button. 44 // Request the focus on the close button.
45 void RequestFocusOnCloseButton(); 45 void RequestFocusOnCloseButton();
46 46
47 // Return the focus status of the close button. True if the focus is on the 47 // Return the focus status of the close button. True if the focus is on the
48 // close button, false otherwise. 48 // close button, false otherwise.
49 bool IsCloseButtonFocused() const; 49 bool IsCloseButtonFocused() const;
50 // Return the focus status of the settings button. True if the focus is on the 50 // Return the focus status of the settings button. True if the focus is on the
51 // close button, false otherwise. 51 // close button, false otherwise.
52 bool IsSettingsButtonFocused() const; 52 bool IsSettingsButtonFocused() const;
53 53
54 message_center::PaddedButton* close_button_for_testing() const { 54 // Methods for testing.
55 return close_button_; 55 message_center::PaddedButton* close_button_for_testing() const;
56 } 56 message_center::PaddedButton* settings_button_for_testing() const;
57 message_center::PaddedButton* settings_button_for_testing() const {
58 return settings_button_;
59 }
60 57
61 // views::View 58 // views::View
62 const char* GetClassName() const override; 59 const char* GetClassName() const override;
63 60
64 // views::ButtonListener 61 // views::ButtonListener
65 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 62 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
66 63
67 // gfx::AnimationDelegate 64 // gfx::AnimationDelegate
68 void AnimationEnded(const gfx::Animation* animation) override; 65 void AnimationEnded(const gfx::Animation* animation) override;
69 void AnimationProgressed(const gfx::Animation* animation) override; 66 void AnimationProgressed(const gfx::Animation* animation) override;
70 void AnimationCanceled(const gfx::Animation* animation) override; 67 void AnimationCanceled(const gfx::Animation* animation) override;
71 68
72 private: 69 private:
73 MessageView* message_view_; 70 MessageView* message_view_;
74 71
75 message_center::PaddedButton* close_button_ = nullptr; 72 std::unique_ptr<message_center::PaddedButton> close_button_;
76 message_center::PaddedButton* settings_button_ = nullptr; 73 std::unique_ptr<message_center::PaddedButton> settings_button_;
77 74
78 std::unique_ptr<gfx::LinearAnimation> bgcolor_animation_; 75 std::unique_ptr<gfx::LinearAnimation> bgcolor_animation_;
79 SkColor bgcolor_origin_; 76 SkColor bgcolor_origin_;
80 SkColor bgcolor_target_; 77 SkColor bgcolor_target_;
81 78
82 DISALLOW_COPY_AND_ASSIGN(NotificationControlButtonsView); 79 DISALLOW_COPY_AND_ASSIGN(NotificationControlButtonsView);
83 }; 80 };
84 81
85 } // namespace message_center 82 } // namespace message_center
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/views/notification_control_buttons_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698