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

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

Issue 2383263002: Generalize layer mirroring for phantom windows (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "components/exo/notification_surface.h" 8 #include "components/exo/notification_surface.h"
9 #include "components/exo/surface.h" 9 #include "components/exo/surface.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 if (sliding_) 106 if (sliding_)
107 OnSlideStart(); 107 OnSlideStart();
108 else 108 else
109 OnSlideEnd(); 109 OnSlideEnd();
110 } 110 }
111 111
112 private: 112 private:
113 void OnSlideStart() { 113 void OnSlideStart() {
114 if (!owner_->surface_ || !owner_->surface_->window()) 114 if (!owner_->surface_ || !owner_->surface_->window())
115 return; 115 return;
116 surface_copy_ = ::wm::RecreateLayers(owner_->surface_->window(), nullptr); 116 surface_copy_ = ::wm::RecreateLayers(owner_->surface_->window());
117 // |surface_copy_| is at (0, 0) in owner_->layer(). 117 // |surface_copy_| is at (0, 0) in owner_->layer().
118 surface_copy_->root()->SetBounds(gfx::Rect(surface_copy_->root()->size())); 118 surface_copy_->root()->SetBounds(gfx::Rect(surface_copy_->root()->size()));
119 owner_->layer()->Add(surface_copy_->root()); 119 owner_->layer()->Add(surface_copy_->root());
120 owner_->surface_->window()->layer()->SetOpacity(0.0f); 120 owner_->surface_->window()->layer()->SetOpacity(0.0f);
121 } 121 }
122 122
123 void OnSlideEnd() { 123 void OnSlideEnd() {
124 if (!owner_->surface_ || !owner_->surface_->window()) 124 if (!owner_->surface_ || !owner_->surface_->window())
125 return; 125 return;
126 owner_->surface_->window()->layer()->SetOpacity(1.0f); 126 owner_->surface_->window()->layer()->SetOpacity(1.0f);
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 void ArcCustomNotificationView::OnNotificationSurfaceRemoved( 444 void ArcCustomNotificationView::OnNotificationSurfaceRemoved(
445 exo::NotificationSurface* surface) { 445 exo::NotificationSurface* surface) {
446 if (surface->notification_id() != notification_key_) 446 if (surface->notification_id() != notification_key_)
447 return; 447 return;
448 448
449 SetSurface(nullptr); 449 SetSurface(nullptr);
450 } 450 }
451 451
452 } // namespace arc 452 } // namespace arc
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | ui/aura/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698