1// Copyright (c) 2013 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 "chrome/browser/browser_process_platform_part_mac.h"
6
7#include "chrome/browser/chrome_browser_application_mac.h"
8
9BrowserProcessPlatformPart::BrowserProcessPlatformPart() {
10}
11
12BrowserProcessPlatformPart::~BrowserProcessPlatformPart() {
13}
14
15void BrowserProcessPlatformPart::StartTearDown() {
16  app_shim_host_manager_ = NULL;
17}
18
19void BrowserProcessPlatformPart::AttemptExit() {
20  // On the Mac, the application continues to run once all windows are closed.
21  // Terminate will result in a CloseAllBrowsers() call, and once (and if)
22  // that is done, will cause the application to exit cleanly.
23  chrome_browser_application_mac::Terminate();
24}
25
26void BrowserProcessPlatformPart::PreMainMessageLoopRun() {
27  // AppShimHostManager can not simply be reset, otherwise destroying the old
28  // domain socket will cause the just-created socket to be unlinked.
29  DCHECK(!app_shim_host_manager_.get());
30  app_shim_host_manager_ = new AppShimHostManager;
31}
32
33AppShimHostManager* BrowserProcessPlatformPart::app_shim_host_manager() {
34  return app_shim_host_manager_.get();
35}
36