Chromium Code Reviews| OLD | NEW |
|---|---|
| 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> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 arc_notification_surface_manager_ = | 124 arc_notification_surface_manager_ = |
| 125 base::MakeUnique<arc::ArcNotificationSurfaceManager>(); | 125 base::MakeUnique<arc::ArcNotificationSurfaceManager>(); |
| 126 if (chrome::IsRunningInMash()) | 126 if (chrome::IsRunningInMash()) |
| 127 wm_helper_ = base::MakeUnique<exo::WMHelperMus>(); | 127 wm_helper_ = base::MakeUnique<exo::WMHelperMus>(); |
| 128 else | 128 else |
| 129 wm_helper_ = base::MakeUnique<exo::WMHelperAsh>(); | 129 wm_helper_ = base::MakeUnique<exo::WMHelperAsh>(); |
| 130 exo::WMHelper::SetInstance(wm_helper_.get()); | 130 exo::WMHelper::SetInstance(wm_helper_.get()); |
| 131 display_ = | 131 display_ = |
| 132 base::MakeUnique<exo::Display>(arc_notification_surface_manager_.get()); | 132 base::MakeUnique<exo::Display>(arc_notification_surface_manager_.get()); |
| 133 wayland_server_ = exo::wayland::Server::Create(display_.get()); | 133 wayland_server_ = exo::wayland::Server::Create(display_.get()); |
| 134 wayland_watcher_ = base::MakeUnique<WaylandWatcher>(wayland_server_.get()); | 134 if (wayland_server_) |
|
sky
2016/12/12 02:18:38
Maybe add a comment as to why the null check?
reveman
2016/12/12 11:37:36
Done: https://codereview.chromium.org/2562363002
| |
| 135 wayland_watcher_ = base::MakeUnique<WaylandWatcher>(wayland_server_.get()); | |
| 135 } | 136 } |
| 136 | 137 |
| 137 void ChromeBrowserMainExtraPartsExo::PostMainMessageLoopRun() { | 138 void ChromeBrowserMainExtraPartsExo::PostMainMessageLoopRun() { |
| 138 wayland_watcher_.reset(); | 139 wayland_watcher_.reset(); |
| 139 wayland_server_.reset(); | 140 wayland_server_.reset(); |
| 140 if (wm_helper_) { | 141 if (wm_helper_) { |
| 141 exo::WMHelper::SetInstance(nullptr); | 142 exo::WMHelper::SetInstance(nullptr); |
| 142 wm_helper_.reset(); | 143 wm_helper_.reset(); |
| 143 } | 144 } |
| 144 } | 145 } |
| OLD | NEW |