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

Side by Side Diff: chrome/browser/chrome_browser_main_extra_parts_exo.cc

Issue 2066853002: arc: Show custom notification via notification surface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notification-exo
Patch Set: add comment for use_custom_notification 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/chrome_browser_main_extra_parts_exo.h" 5 #include "chrome/browser/chrome_browser_main_extra_parts_exo.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 8
9 #if defined(USE_GLIB) 9 #if defined(USE_GLIB)
10 #include <glib.h> 10 #include <glib.h>
11 #endif 11 #endif
12 12
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "chrome/browser/ui/ash/ash_util.h" 16 #include "chrome/browser/ui/ash/ash_util.h"
17 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
18 #include "components/exo/display.h" 18 #include "components/exo/display.h"
19 #include "components/exo/wayland/server.h" 19 #include "components/exo/wayland/server.h"
20 #include "content/public/browser/browser_thread.h" 20 #include "content/public/browser/browser_thread.h"
21 #include "ui/arc/notification/arc_custom_notification_item.h"
21 22
22 #if defined(USE_GLIB) 23 #if defined(USE_GLIB)
23 namespace { 24 namespace {
24 25
25 struct GLibWaylandSource : public GSource { 26 struct GLibWaylandSource : public GSource {
26 // Note: The GLibWaylandSource is created and destroyed by GLib. So its 27 // Note: The GLibWaylandSource is created and destroyed by GLib. So its
27 // constructor/destructor may or may not get called. 28 // constructor/destructor may or may not get called.
28 exo::wayland::Server* server; 29 exo::wayland::Server* server;
29 GPollFD* poll_fd; 30 GPollFD* poll_fd;
30 }; 31 };
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 117
117 void ChromeBrowserMainExtraPartsExo::PreProfileInit() { 118 void ChromeBrowserMainExtraPartsExo::PreProfileInit() {
118 if (!chrome::ShouldOpenAshOnStartup()) 119 if (!chrome::ShouldOpenAshOnStartup())
119 return; 120 return;
120 121
121 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 122 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
122 switches::kEnableWaylandServer)) { 123 switches::kEnableWaylandServer)) {
123 wayland_server_ = exo::wayland::Server::Create(display_.get()); 124 wayland_server_ = exo::wayland::Server::Create(display_.get());
124 wayland_watcher_ = 125 wayland_watcher_ =
125 base::WrapUnique(new WaylandWatcher(wayland_server_.get())); 126 base::WrapUnique(new WaylandWatcher(wayland_server_.get()));
127
128 arc::ArcCustomNotificationItem::SetNotificationSurfaceRegistry(
129 display_->notification_surface_registry());
Nico 2016/06/21 18:00:29 Does this do any interesting work? This runs very
xiyuan 2016/06/21 18:03:57 Nope. It just passes down the registry pointer to
126 } 130 }
127 } 131 }
128 132
129 void ChromeBrowserMainExtraPartsExo::PostMainMessageLoopRun() { 133 void ChromeBrowserMainExtraPartsExo::PostMainMessageLoopRun() {
134 arc::ArcCustomNotificationItem::SetNotificationSurfaceRegistry(nullptr);
135
130 wayland_watcher_.reset(); 136 wayland_watcher_.reset();
131 wayland_server_.reset(); 137 wayland_server_.reset();
132 } 138 }
OLDNEW
« no previous file with comments | « no previous file | components/arc/common/notifications.mojom » ('j') | ui/arc/notification/arc_custom_notification_view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698