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

Unified Diff: ui/message_center/views/message_view.cc

Issue 14198004: Scrolls to the notification when focus moves to its buttons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/message_center/views/notification_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/message_view.cc
diff --git a/ui/message_center/views/message_view.cc b/ui/message_center/views/message_view.cc
index 07f87b1e60fd21222b97a7a3ee18104351497c1f..06be75b411912d357cbfccbf92f223f3ff7cf56b 100644
--- a/ui/message_center/views/message_view.cc
+++ b/ui/message_center/views/message_view.cc
@@ -54,6 +54,7 @@ class ControlButton : public views::ImageButton {
// Overridden from views::ImageButton:
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ virtual void OnFocus() OVERRIDE;
// The SetPadding() method also sets the button's image alignment (positive
// values yield left/top alignments, negative values yield right/bottom ones,
@@ -129,6 +130,10 @@ void ControlButton::OnPaint(gfx::Canvas* canvas) {
OnPaintFocusBorder(canvas);
}
+void ControlButton::OnFocus() {
+ ScrollRectToVisible(GetLocalBounds());
+}
+
gfx::Point ControlButton::ComputePaddedImagePaintPosition(
const gfx::ImageSkia& image) {
gfx::Vector2d offset;
« no previous file with comments | « no previous file | ui/message_center/views/notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698