| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "apps/shell/app/shell_main_delegate.h" | 5 #include "apps/shell/app/shell_main_delegate.h" |
| 6 | 6 |
| 7 #include "apps/shell/browser/default_shell_browser_main_delegate.h" | 7 #include "apps/shell/browser/default_shell_browser_main_delegate.h" |
| 8 #include "apps/shell/browser/shell_content_browser_client.h" | 8 #include "apps/shell/browser/shell_content_browser_client.h" |
| 9 #include "apps/shell/common/shell_content_client.h" | 9 #include "apps/shell/common/shell_content_client.h" |
| 10 #include "apps/shell/renderer/shell_content_renderer_client.h" | 10 #include "apps/shell/renderer/shell_content_renderer_client.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { | 68 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { |
| 69 browser_client_.reset( | 69 browser_client_.reset( |
| 70 new apps::ShellContentBrowserClient(CreateShellBrowserMainDelegate())); | 70 new apps::ShellContentBrowserClient(CreateShellBrowserMainDelegate())); |
| 71 return browser_client_.get(); | 71 return browser_client_.get(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 content::ContentRendererClient* | 74 content::ContentRendererClient* |
| 75 ShellMainDelegate::CreateContentRendererClient() { | 75 ShellMainDelegate::CreateContentRendererClient() { |
| 76 renderer_client_.reset(new ShellContentRendererClient); | 76 renderer_client_.reset( |
| 77 new ShellContentRendererClient(CreateShellRendererMainDelegate())); |
| 77 return renderer_client_.get(); | 78 return renderer_client_.get(); |
| 78 } | 79 } |
| 79 | 80 |
| 80 ShellBrowserMainDelegate* ShellMainDelegate::CreateShellBrowserMainDelegate() { | 81 ShellBrowserMainDelegate* ShellMainDelegate::CreateShellBrowserMainDelegate() { |
| 81 return new DefaultShellBrowserMainDelegate(); | 82 return new DefaultShellBrowserMainDelegate(); |
| 82 } | 83 } |
| 83 | 84 |
| 85 ShellRendererMainDelegate* |
| 86 ShellMainDelegate::CreateShellRendererMainDelegate() { |
| 87 return NULL; |
| 88 } |
| 89 |
| 84 // static | 90 // static |
| 85 bool ShellMainDelegate::ProcessNeedsResourceBundle( | 91 bool ShellMainDelegate::ProcessNeedsResourceBundle( |
| 86 const std::string& process_type) { | 92 const std::string& process_type) { |
| 87 // The browser process has no process type flag, but needs resources. | 93 // The browser process has no process type flag, but needs resources. |
| 88 // On Linux the zygote process opens the resources for the renderers. | 94 // On Linux the zygote process opens the resources for the renderers. |
| 89 return process_type.empty() || | 95 return process_type.empty() || |
| 90 process_type == switches::kZygoteProcess || | 96 process_type == switches::kZygoteProcess || |
| 91 process_type == switches::kRendererProcess || | 97 process_type == switches::kRendererProcess || |
| 92 process_type == switches::kUtilityProcess; | 98 process_type == switches::kUtilityProcess; |
| 93 } | 99 } |
| 94 | 100 |
| 95 void ShellMainDelegate::InitializeResourceBundle() { | 101 void ShellMainDelegate::InitializeResourceBundle() { |
| 96 base::FilePath pak_dir; | 102 base::FilePath pak_dir; |
| 97 PathService::Get(base::DIR_MODULE, &pak_dir); | 103 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 98 ui::ResourceBundle::InitSharedInstanceWithPakPath( | 104 ui::ResourceBundle::InitSharedInstanceWithPakPath( |
| 99 pak_dir.AppendASCII("app_shell.pak")); | 105 pak_dir.AppendASCII("app_shell.pak")); |
| 100 } | 106 } |
| 101 | 107 |
| 102 } // namespace apps | 108 } // namespace apps |
| OLD | NEW |