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

Side by Side Diff: apps/shell/app/shell_main_delegate.cc

Issue 396813003: Hook up delegate interfaces so that athena can create its own WebContentsViewDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « apps/shell/app/shell_main_delegate.h ('k') | athena/main/athena_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 void ShellMainDelegate::PreSandboxStartup() { 61 void ShellMainDelegate::PreSandboxStartup() {
62 std::string process_type = 62 std::string process_type =
63 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 63 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
64 switches::kProcessType); 64 switches::kProcessType);
65 if (ProcessNeedsResourceBundle(process_type)) 65 if (ProcessNeedsResourceBundle(process_type))
66 InitializeResourceBundle(); 66 InitializeResourceBundle();
67 } 67 }
68 68
69 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { 69 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
70 browser_client_.reset( 70 browser_client_.reset(CreateContentBrowserClient());
James Cook 2014/07/16 22:43:33 Does this call itself? Should this be CreateShellC
oshima 2014/07/16 22:49:32 Oops sorry. Fixed. I forgot that unittest is not u
71 new apps::ShellContentBrowserClient(CreateShellBrowserMainDelegate()));
72 return browser_client_.get(); 71 return browser_client_.get();
73 } 72 }
74 73
74 content::ContentBrowserClient*
75 ShellMainDelegate::CreateShellContentBrowserClient() {
76 return new apps::ShellContentBrowserClient(
77 new DefaultShellBrowserMainDelegate());
78 }
79
75 content::ContentRendererClient* 80 content::ContentRendererClient*
76 ShellMainDelegate::CreateContentRendererClient() { 81 ShellMainDelegate::CreateContentRendererClient() {
77 renderer_client_.reset( 82 renderer_client_.reset(
78 new ShellContentRendererClient(CreateShellRendererMainDelegate())); 83 new ShellContentRendererClient(CreateShellRendererMainDelegate()));
79 return renderer_client_.get(); 84 return renderer_client_.get();
80 } 85 }
81 86
82 ShellBrowserMainDelegate* ShellMainDelegate::CreateShellBrowserMainDelegate() {
83 return new DefaultShellBrowserMainDelegate();
84 }
85
86 scoped_ptr<ShellRendererMainDelegate> 87 scoped_ptr<ShellRendererMainDelegate>
87 ShellMainDelegate::CreateShellRendererMainDelegate() { 88 ShellMainDelegate::CreateShellRendererMainDelegate() {
88 return scoped_ptr<ShellRendererMainDelegate>(); 89 return scoped_ptr<ShellRendererMainDelegate>();
89 } 90 }
90 91
91 void ShellMainDelegate::InitializeResourceBundle() { 92 void ShellMainDelegate::InitializeResourceBundle() {
92 base::FilePath pak_dir; 93 base::FilePath pak_dir;
93 PathService::Get(base::DIR_MODULE, &pak_dir); 94 PathService::Get(base::DIR_MODULE, &pak_dir);
94 ui::ResourceBundle::InitSharedInstanceWithPakPath( 95 ui::ResourceBundle::InitSharedInstanceWithPakPath(
95 pak_dir.AppendASCII("app_shell.pak")); 96 pak_dir.AppendASCII("app_shell.pak"));
96 } 97 }
97 98
98 // static 99 // static
99 bool ShellMainDelegate::ProcessNeedsResourceBundle( 100 bool ShellMainDelegate::ProcessNeedsResourceBundle(
100 const std::string& process_type) { 101 const std::string& process_type) {
101 // The browser process has no process type flag, but needs resources. 102 // The browser process has no process type flag, but needs resources.
102 // On Linux the zygote process opens the resources for the renderers. 103 // On Linux the zygote process opens the resources for the renderers.
103 return process_type.empty() || 104 return process_type.empty() ||
104 process_type == switches::kZygoteProcess || 105 process_type == switches::kZygoteProcess ||
105 process_type == switches::kRendererProcess || 106 process_type == switches::kRendererProcess ||
106 process_type == switches::kUtilityProcess; 107 process_type == switches::kUtilityProcess;
107 } 108 }
108 109
109 } // namespace apps 110 } // namespace apps
OLDNEW
« no previous file with comments | « apps/shell/app/shell_main_delegate.h ('k') | athena/main/athena_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698