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

Unified Diff: apps/shell/app/shell_main_delegate.cc

Issue 412713002: Move apps/shell to extensions/shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 40% Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/shell/app/shell_main_delegate.h ('k') | apps/shell/app_shell.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/shell/app/shell_main_delegate.cc
diff --git a/apps/shell/app/shell_main_delegate.cc b/apps/shell/app/shell_main_delegate.cc
deleted file mode 100644
index 2e98a1df032efb25412f1eaa85cd2b0819278b51..0000000000000000000000000000000000000000
--- a/apps/shell/app/shell_main_delegate.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2013 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/shell/app/shell_main_delegate.h"
-
-#include "apps/shell/browser/default_shell_browser_main_delegate.h"
-#include "apps/shell/browser/shell_content_browser_client.h"
-#include "apps/shell/common/shell_content_client.h"
-#include "apps/shell/renderer/shell_content_renderer_client.h"
-#include "apps/shell/renderer/shell_renderer_main_delegate.h"
-#include "base/command_line.h"
-#include "base/files/file_path.h"
-#include "base/logging.h"
-#include "base/path_service.h"
-#include "content/public/browser/browser_main_runner.h"
-#include "content/public/common/content_switches.h"
-#include "extensions/common/extension_paths.h"
-#include "ui/base/resource/resource_bundle.h"
-
-#if defined(OS_CHROMEOS)
-#include "chromeos/chromeos_paths.h"
-#endif
-
-namespace {
-
-void InitLogging() {
- base::FilePath log_filename;
- PathService::Get(base::DIR_EXE, &log_filename);
- log_filename = log_filename.AppendASCII("app_shell.log");
- logging::LoggingSettings settings;
- settings.logging_dest = logging::LOG_TO_ALL;
- settings.log_file = log_filename.value().c_str();
- settings.delete_old = logging::DELETE_OLD_LOG_FILE;
- logging::InitLogging(settings);
- logging::SetLogItems(true, true, true, true);
-}
-
-} // namespace
-
-namespace apps {
-
-ShellMainDelegate::ShellMainDelegate() {
-}
-
-ShellMainDelegate::~ShellMainDelegate() {
-}
-
-bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
- InitLogging();
- content_client_.reset(new ShellContentClient);
- SetContentClient(content_client_.get());
-
-#if defined(OS_CHROMEOS)
- chromeos::RegisterPathProvider();
-#endif
- extensions::RegisterPathProvider();
- return false;
-}
-
-void ShellMainDelegate::PreSandboxStartup() {
- std::string process_type =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kProcessType);
- if (ProcessNeedsResourceBundle(process_type))
- InitializeResourceBundle();
-}
-
-content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
- browser_client_.reset(CreateShellContentBrowserClient());
- return browser_client_.get();
-}
-
-content::ContentBrowserClient*
-ShellMainDelegate::CreateShellContentBrowserClient() {
- return new apps::ShellContentBrowserClient(
- new DefaultShellBrowserMainDelegate());
-}
-
-content::ContentRendererClient*
-ShellMainDelegate::CreateContentRendererClient() {
- renderer_client_.reset(
- new ShellContentRendererClient(CreateShellRendererMainDelegate()));
- return renderer_client_.get();
-}
-
-scoped_ptr<ShellRendererMainDelegate>
-ShellMainDelegate::CreateShellRendererMainDelegate() {
- return scoped_ptr<ShellRendererMainDelegate>();
-}
-
-void ShellMainDelegate::InitializeResourceBundle() {
- base::FilePath pak_dir;
- PathService::Get(base::DIR_MODULE, &pak_dir);
- ui::ResourceBundle::InitSharedInstanceWithPakPath(
- pak_dir.AppendASCII("app_shell.pak"));
-}
-
-// static
-bool ShellMainDelegate::ProcessNeedsResourceBundle(
- const std::string& process_type) {
- // The browser process has no process type flag, but needs resources.
- // On Linux the zygote process opens the resources for the renderers.
- return process_type.empty() ||
- process_type == switches::kZygoteProcess ||
- process_type == switches::kRendererProcess ||
- process_type == switches::kUtilityProcess;
-}
-
-} // namespace apps
« no previous file with comments | « apps/shell/app/shell_main_delegate.h ('k') | apps/shell/app_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698