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

Side by Side Diff: components/exo/notification_surface.cc

Issue 2065133002: exo: Implement notification surface support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification-wayland-protocol
Patch Set: add NotificationServiceRegistry to track notification surface Created 4 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/exo/notification_surface.h"
6
7 #include "components/exo/notification_surface_registry.h"
8 #include "components/exo/surface.h"
9
10 namespace exo {
11
12 NotificationSurface::NotificationSurface(Surface* surface,
13 const std::string& notification_id)
14 : surface_(surface), notification_id_(notification_id) {
15 surface_->AddSurfaceObserver(this);
16 NotificationSurfaceRegistry::Get()->AddSurface(this);
17 }
18
19 NotificationSurface::~NotificationSurface() {
20 if (surface_)
21 surface_->RemoveSurfaceObserver(this);
22 NotificationSurfaceRegistry::Get()->RemoveSurface(this);
23 }
24
25 gfx::Size NotificationSurface::GetSize() const {
26 return surface_->GetHitTestBounds().size();
reveman 2016/06/16 03:35:20 Why hit test bounds and not the contents size?
xiyuan 2016/06/20 22:40:28 Did not notice we added a content_size(). Use it n
27 }
28
29 void NotificationSurface::OnSurfaceDestroying(Surface* surface) {
30 surface->RemoveSurfaceObserver(this);
31 surface_ = nullptr;
32 }
33
34 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698