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

Side by Side Diff: ui/arc/notification/arc_custom_notification_view.cc

Issue 2799573002: Fix the check to distinguish accessibility events. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/arc/notification/arc_custom_notification_view.h" 5 #include "ui/arc/notification/arc_custom_notification_view.h"
6 6
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/exo/notification_surface.h" 10 #include "components/exo/notification_surface.h"
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 } 548 }
549 549
550 bool ArcCustomNotificationView::OnMousePressed(const ui::MouseEvent& event) { 550 bool ArcCustomNotificationView::OnMousePressed(const ui::MouseEvent& event) {
551 // TODO(yhanada): Remove this hack as soon as possible after letting 551 // TODO(yhanada): Remove this hack as soon as possible after letting
552 // accessible actions be delivered to this view. 552 // accessible actions be delivered to this view.
553 // All mouse clicks or touches should be sent to corresponding Android view 553 // All mouse clicks or touches should be sent to corresponding Android view
554 // because the surface is on this view, so receiving a mouse pressed event 554 // because the surface is on this view, so receiving a mouse pressed event
555 // means the event is generated by automation API. 555 // means the event is generated by automation API.
556 if (event.IsOnlyLeftMouseButton() && 556 if (event.IsOnlyLeftMouseButton() &&
557 item_->expand_state() != mojom::ArcNotificationExpandState::FIXED_SIZE && 557 item_->expand_state() != mojom::ArcNotificationExpandState::FIXED_SIZE &&
558 event.target() != surface_->window()) { 558 event.target() == nullptr) {
yoshiki 2017/04/05 08:55:51 Could you update the comment above and mention abo
559 item_->ToggleExpansion(); 559 item_->ToggleExpansion();
560 return true; 560 return true;
561 } 561 }
562 return false; 562 return false;
563 } 563 }
564 564
565 void ArcCustomNotificationView::ButtonPressed(views::Button* sender, 565 void ArcCustomNotificationView::ButtonPressed(views::Button* sender,
566 const ui::Event& event) { 566 const ui::Event& event) {
567 if (item_ && !item_->pinned() && sender == close_button_.get()) { 567 if (item_ && !item_->pinned() && sender == close_button_.get()) {
568 CHECK_EQ(message_center::CustomNotificationView::kViewClassName, 568 CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 614
615 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( 615 void ArcCustomNotificationView::OnNotificationSurfaceRemoved(
616 exo::NotificationSurface* surface) { 616 exo::NotificationSurface* surface) {
617 if (surface->notification_id() != notification_key_) 617 if (surface->notification_id() != notification_key_)
618 return; 618 return;
619 619
620 SetSurface(nullptr); 620 SetSurface(nullptr);
621 } 621 }
622 622
623 } // namespace arc 623 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698