Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / apps / shell / shell_main_delegate.cc
1 // Copyright 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 "apps/shell/shell_main_delegate.h"
6
7 #include "apps/shell/shell_content_browser_client.h"
8 #include "apps/shell/shell_content_client.h"
9 #include "base/command_line.h"
10 #include "base/files/file_path.h"
11 #include "base/logging.h"
12 #include "base/path_service.h"
13 #include "content/public/browser/browser_main_runner.h"
14 #include "ui/base/resource/resource_bundle.h"
15
16 namespace apps {
17
18 ShellMainDelegate::ShellMainDelegate() {
19 }
20
21 ShellMainDelegate::~ShellMainDelegate() {
22 }
23
24 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
25   // TODO(jamescook): Initialize logging here.
26   content_client_.reset(new ShellContentClient);
27   SetContentClient(content_client_.get());
28   return false;
29 }
30
31 void ShellMainDelegate::PreSandboxStartup() {
32   InitializeResourceBundle();
33 }
34
35 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
36   browser_client_.reset(new apps::ShellContentBrowserClient);
37   return browser_client_.get();
38 }
39
40 content::ContentRendererClient*
41 ShellMainDelegate::CreateContentRendererClient() {
42   // TODO(jamescook): Create a ShellContentRendererClient with the extensions
43   // initialization pieces of ChromeContentRendererClient.
44   return content::ContentMainDelegate::CreateContentRendererClient();
45 }
46
47 void ShellMainDelegate::InitializeResourceBundle() {
48   ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
49 }
50
51 }  // namespace apps