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

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

Issue 2751353002: Not Remove Non-Closable Arc Popup When Close Button is Pressed (Closed)
Patch Set: Created 3 years, 9 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 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 void ArcCustomNotificationView::OnMouseEntered(const ui::MouseEvent&) { 497 void ArcCustomNotificationView::OnMouseEntered(const ui::MouseEvent&) {
498 UpdateControlButtonsVisibility(); 498 UpdateControlButtonsVisibility();
499 } 499 }
500 500
501 void ArcCustomNotificationView::OnMouseExited(const ui::MouseEvent&) { 501 void ArcCustomNotificationView::OnMouseExited(const ui::MouseEvent&) {
502 UpdateControlButtonsVisibility(); 502 UpdateControlButtonsVisibility();
503 } 503 }
504 504
505 void ArcCustomNotificationView::OnFocus() { 505 void ArcCustomNotificationView::OnFocus() {
506 CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
507 parent()->GetClassName());
508
506 NativeViewHost::OnFocus(); 509 NativeViewHost::OnFocus();
507 static_cast<message_center::CustomNotificationView*>(parent()) 510 static_cast<message_center::CustomNotificationView*>(parent())
508 ->OnContentFocused(); 511 ->OnContentFocused();
509 } 512 }
510 513
511 void ArcCustomNotificationView::OnBlur() { 514 void ArcCustomNotificationView::OnBlur() {
515 CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
516 parent()->GetClassName());
517
512 NativeViewHost::OnBlur(); 518 NativeViewHost::OnBlur();
513 static_cast<message_center::CustomNotificationView*>(parent()) 519 static_cast<message_center::CustomNotificationView*>(parent())
514 ->OnContentBlured(); 520 ->OnContentBlured();
515 } 521 }
516 522
517 void ArcCustomNotificationView::ActivateToast() { 523 void ArcCustomNotificationView::ActivateToast() {
518 if (message_center::ToastContentsView::kViewClassName == 524 if (message_center::ToastContentsView::kViewClassName ==
519 parent()->parent()->GetClassName()) { 525 parent()->parent()->GetClassName()) {
520 static_cast<message_center::ToastContentsView*>(parent()->parent()) 526 static_cast<message_center::ToastContentsView*>(parent()->parent())
521 ->ActivateToast(); 527 ->ActivateToast();
522 } 528 }
523 } 529 }
524 530
525 views::FocusTraversable* ArcCustomNotificationView::GetFocusTraversable() { 531 views::FocusTraversable* ArcCustomNotificationView::GetFocusTraversable() {
526 if (floating_control_buttons_widget_) 532 if (floating_control_buttons_widget_)
527 return static_cast<views::internal::RootView*>( 533 return static_cast<views::internal::RootView*>(
528 floating_control_buttons_widget_->GetRootView()); 534 floating_control_buttons_widget_->GetRootView());
529 return nullptr; 535 return nullptr;
530 } 536 }
531 537
532 void ArcCustomNotificationView::ButtonPressed(views::Button* sender, 538 void ArcCustomNotificationView::ButtonPressed(views::Button* sender,
533 const ui::Event& event) { 539 const ui::Event& event) {
534 if (item_ && !item_->pinned() && sender == close_button_) { 540 if (item_ && !item_->pinned() && sender == close_button_) {
535 item_->CloseFromCloseButton(); 541 CHECK_EQ(message_center::CustomNotificationView::kViewClassName,
542 parent()->GetClassName());
543 static_cast<message_center::CustomNotificationView*>(parent())
544 ->OnCloseButtonPressed();
536 } 545 }
537 if (item_ && settings_button_ && sender == settings_button_) { 546 if (item_ && settings_button_ && sender == settings_button_) {
538 settings_button_->HideInkDrop(); 547 settings_button_->HideInkDrop();
539 item_->OpenSettings(); 548 item_->OpenSettings();
540 } 549 }
541 } 550 }
542 551
543 void ArcCustomNotificationView::OnWindowBoundsChanged( 552 void ArcCustomNotificationView::OnWindowBoundsChanged(
544 aura::Window* window, 553 aura::Window* window,
545 const gfx::Rect& old_bounds, 554 const gfx::Rect& old_bounds,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 588
580 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( 589 void ArcCustomNotificationView::OnNotificationSurfaceRemoved(
581 exo::NotificationSurface* surface) { 590 exo::NotificationSurface* surface) {
582 if (surface->notification_id() != notification_key_) 591 if (surface->notification_id() != notification_key_)
583 return; 592 return;
584 593
585 SetSurface(nullptr); 594 SetSurface(nullptr);
586 } 595 }
587 596
588 } // namespace arc 597 } // namespace arc
OLDNEW
« no previous file with comments | « ui/arc/notification/arc_custom_notification_item.cc ('k') | ui/message_center/views/custom_notification_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698