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

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

Issue 2750853005: Fix crash when removing all notifications by "Clear all" button. (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
« no previous file with comments | « no previous file | ui/message_center/message_center_impl.cc » ('j') | 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return owner_->close_button_->HasFocus(); 162 return owner_->close_button_->HasFocus();
163 } 163 }
164 164
165 void RequestFocusOnCloseButton() override { 165 void RequestFocusOnCloseButton() override {
166 if (owner_->close_button_) 166 if (owner_->close_button_)
167 owner_->close_button_->RequestFocus(); 167 owner_->close_button_->RequestFocus();
168 owner_->UpdateControlButtonsVisibility(); 168 owner_->UpdateControlButtonsVisibility();
169 } 169 }
170 170
171 bool IsPinned() const override { 171 bool IsPinned() const override {
172 if (!owner_->item_)
173 return false;
172 return owner_->item_->pinned(); 174 return owner_->item_->pinned();
173 } 175 }
174 176
175 void UpdateControlButtonsVisibility() override { 177 void UpdateControlButtonsVisibility() override {
176 owner_->UpdateControlButtonsVisibility(); 178 owner_->UpdateControlButtonsVisibility();
177 } 179 }
178 180
179 private: 181 private:
180 ArcCustomNotificationView* const owner_; 182 ArcCustomNotificationView* const owner_;
181 183
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 589
588 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( 590 void ArcCustomNotificationView::OnNotificationSurfaceRemoved(
589 exo::NotificationSurface* surface) { 591 exo::NotificationSurface* surface) {
590 if (surface->notification_id() != notification_key_) 592 if (surface->notification_id() != notification_key_)
591 return; 593 return;
592 594
593 SetSurface(nullptr); 595 SetSurface(nullptr);
594 } 596 }
595 597
596 } // namespace arc 598 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/message_center_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698