blob: b91d3cdbcd59837ccce3a368ea7233bcf300b9cc [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "apps/browser_context_keyed_service_factories.h"
#include "apps/app_restore_service.h"
#include "apps/app_restore_service_factory.h"
#include "apps/saved_files_service.h"
#include "apps/saved_files_service_factory.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/app_window/app_window_geometry_cache.h"
namespace apps {
void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
apps::AppRestoreServiceFactory::GetInstance();
extensions::AppWindowGeometryCache::Factory::GetInstance();
}
void NotifyApplicationTerminating(content::BrowserContext* browser_context) {
AppRestoreService* restore_service =
AppRestoreServiceFactory::GetForBrowserContext(browser_context);
CHECK(restore_service);
restore_service->OnApplicationTerminating();
SavedFilesService* saved_files_service =
SavedFilesServiceFactory::GetForBrowserContextIfExists(browser_context);
if (saved_files_service)
saved_files_service->OnApplicationTerminating();
}
} // namespace apps