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

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: Rebased. 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 | « ui/message_center/views/notification_header_view.cc ('k') | no next file » | 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 "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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 427 }
428 428
429 if (header_row_->IsSettingsButtonEnabled() && 429 if (header_row_->IsSettingsButtonEnabled() &&
430 sender == header_row_->settings_button()) { 430 sender == header_row_->settings_button()) {
431 controller()->ClickOnSettingsButton(id); 431 controller()->ClickOnSettingsButton(id);
432 return; 432 return;
433 } 433 }
434 434
435 // Tapping anywhere on |header_row_| can expand the notification, though only 435 // Tapping anywhere on |header_row_| can expand the notification, though only
436 // |expand_button| can be focused by TAB. 436 // |expand_button| can be focused by TAB.
437 if (IsExpandable() && 437 if (IsExpandable() && sender == header_row_) {
438 (sender == header_row_ || sender == header_row_->expand_button())) {
439 ToggleExpanded(); 438 ToggleExpanded();
440 Layout(); 439 Layout();
441 SchedulePaint(); 440 SchedulePaint();
442 return; 441 return;
443 } 442 }
444 443
445 // See if the button pressed was an action button. 444 // See if the button pressed was an action button.
446 for (size_t i = 0; i < action_buttons_.size(); ++i) { 445 for (size_t i = 0; i < action_buttons_.size(); ++i) {
447 if (sender == action_buttons_[i]) { 446 if (sender == action_buttons_[i]) {
448 controller()->ClickOnNotificationButton(id, i); 447 controller()->ClickOnNotificationButton(id, i);
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 header_row_->expand_button()->HasFocus()) || 767 header_row_->expand_button()->HasFocus()) ||
769 (header_row_->IsCloseButtonEnabled() && 768 (header_row_->IsCloseButtonEnabled() &&
770 header_row_->close_button()->HasFocus()) || 769 header_row_->close_button()->HasFocus()) ||
771 (header_row_->IsSettingsButtonEnabled() && 770 (header_row_->IsSettingsButtonEnabled() &&
772 header_row_->settings_button()->HasFocus()); 771 header_row_->settings_button()->HasFocus());
773 772
774 header_row_->SetControlButtonsVisible(target_visibility); 773 header_row_->SetControlButtonsVisible(target_visibility);
775 } 774 }
776 775
777 } // namespace message_center 776 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/notification_header_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698