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

Side by Side Diff: ui/message_center/views/notification_view_md.cc

Issue 2966673002: Add ripple effect to action in expand button. (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
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 "ui/message_center/views/notification_view_md.h" 5 #include "ui/message_center/views/notification_view_md.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "ui/base/cursor/cursor.h" 10 #include "ui/base/cursor/cursor.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 } 482 }
483 483
484 if (header_row_->IsSettingsButtonEnabled() && 484 if (header_row_->IsSettingsButtonEnabled() &&
485 sender == header_row_->settings_button()) { 485 sender == header_row_->settings_button()) {
486 controller()->ClickOnSettingsButton(id); 486 controller()->ClickOnSettingsButton(id);
487 return; 487 return;
488 } 488 }
489 489
490 // Tapping anywhere on |header_row_| can expand the notification, though only 490 // Tapping anywhere on |header_row_| can expand the notification, though only
491 // |expand_button| can be focused by TAB. 491 // |expand_button| can be focused by TAB.
492 if (IsExpandable() && 492 if (IsExpandable() && sender == header_row_) {
493 (sender == header_row_ || sender == header_row_->expand_button())) {
494 ToggleExpanded(); 493 ToggleExpanded();
495 Layout(); 494 Layout();
496 SchedulePaint(); 495 SchedulePaint();
497 return; 496 return;
498 } 497 }
499 498
500 // See if the button pressed was an action button. 499 // See if the button pressed was an action button.
501 for (size_t i = 0; i < action_buttons_.size(); ++i) { 500 for (size_t i = 0; i < action_buttons_.size(); ++i) {
502 if (sender == action_buttons_[i]) { 501 if (sender == action_buttons_[i]) {
503 controller()->ClickOnNotificationButton(id, i); 502 controller()->ClickOnNotificationButton(id, i);
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 header_row_->expand_button()->HasFocus()) || 825 header_row_->expand_button()->HasFocus()) ||
827 (header_row_->IsCloseButtonEnabled() && 826 (header_row_->IsCloseButtonEnabled() &&
828 header_row_->close_button()->HasFocus()) || 827 header_row_->close_button()->HasFocus()) ||
829 (header_row_->IsSettingsButtonEnabled() && 828 (header_row_->IsSettingsButtonEnabled() &&
830 header_row_->settings_button()->HasFocus()); 829 header_row_->settings_button()->HasFocus());
831 830
832 header_row_->SetControlButtonsVisible(target_visibility); 831 header_row_->SetControlButtonsVisible(target_visibility);
833 } 832 }
834 833
835 } // namespace message_center 834 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698