• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2012 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 "ash/shell/content_client/shell_main_delegate.h"
6 
7 #include "ash/shell/content_client/shell_content_browser_client.h"
8 #include "base/command_line.h"
9 #include "content/public/common/content_switches.h"
10 #include "ui/base/resource/resource_bundle.h"
11 
12 namespace ash {
13 namespace shell {
14 
ShellMainDelegate()15 ShellMainDelegate::ShellMainDelegate() {
16 }
17 
~ShellMainDelegate()18 ShellMainDelegate::~ShellMainDelegate() {
19 }
20 
BasicStartupComplete(int * exit_code)21 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
22   const CommandLine& command_line = *CommandLine::ForCurrentProcess();
23   std::string process_type =
24       command_line.GetSwitchValueASCII(switches::kProcessType);
25 
26   content::SetContentClient(&content_client_);
27 
28   return false;
29 }
30 
PreSandboxStartup()31 void ShellMainDelegate::PreSandboxStartup() {
32   InitializeResourceBundle();
33 }
34 
CreateContentBrowserClient()35 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
36   browser_client_.reset(new ShellContentBrowserClient);
37   return browser_client_.get();
38 }
39 
InitializeResourceBundle()40 void ShellMainDelegate::InitializeResourceBundle() {
41   ui::ResourceBundle::InitSharedInstanceWithLocale(
42       "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES);
43 }
44 
45 }  // namespace shell
46 }  // namespace ash
47