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

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

Issue 2670493002: [arc notifications] Inspect pinned flag directly for IsPinned(). (Closed)
Patch Set: Created 3 years, 10 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return owner_->floating_close_button_->HasFocus(); 162 return owner_->floating_close_button_->HasFocus();
163 } 163 }
164 164
165 void RequestFocusOnCloseButton() override { 165 void RequestFocusOnCloseButton() override {
166 if (owner_->floating_close_button_) 166 if (owner_->floating_close_button_)
167 owner_->floating_close_button_->RequestFocus(); 167 owner_->floating_close_button_->RequestFocus();
168 owner_->UpdateCloseButtonVisiblity(); 168 owner_->UpdateCloseButtonVisiblity();
169 } 169 }
170 170
171 bool IsPinned() const override { 171 bool IsPinned() const override {
172 return owner_->floating_close_button_ == nullptr; 172 return owner_->item_->pinned();
173 } 173 }
174 174
175 private: 175 private:
176 ArcCustomNotificationView* const owner_; 176 ArcCustomNotificationView* const owner_;
177 177
178 DISALLOW_COPY_AND_ASSIGN(ContentViewDelegate); 178 DISALLOW_COPY_AND_ASSIGN(ContentViewDelegate);
179 }; 179 };
180 180
181 class ArcCustomNotificationView::CloseButton : public views::ImageButton { 181 class ArcCustomNotificationView::CloseButton : public views::ImageButton {
182 public: 182 public:
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 547
548 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( 548 void ArcCustomNotificationView::OnNotificationSurfaceRemoved(
549 exo::NotificationSurface* surface) { 549 exo::NotificationSurface* surface) {
550 if (surface->notification_id() != notification_key_) 550 if (surface->notification_id() != notification_key_)
551 return; 551 return;
552 552
553 SetSurface(nullptr); 553 SetSurface(nullptr);
554 } 554 }
555 555
556 } // namespace arc 556 } // 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