OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/shell/shell_content_browser_client.h" | 5 #include "content/shell/shell_content_browser_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate( | 115 WebContentsViewDelegate* ShellContentBrowserClient::GetWebContentsViewDelegate( |
116 WebContents* web_contents) { | 116 WebContents* web_contents) { |
117 #if defined(TOOLKIT_GTK) || defined(OS_WIN) || defined(OS_MACOSX) | 117 #if defined(TOOLKIT_GTK) || defined(OS_WIN) || defined(OS_MACOSX) |
118 return CreateShellWebContentsViewDelegate(web_contents); | 118 return CreateShellWebContentsViewDelegate(web_contents); |
119 #endif | 119 #endif |
120 NOTIMPLEMENTED(); | 120 NOTIMPLEMENTED(); |
121 return NULL; | 121 return NULL; |
122 } | 122 } |
123 | 123 |
124 bool ShellContentBrowserClient::CanCreateWindow( | |
125 const GURL& opener_url, | |
126 const GURL& origin, | |
127 WindowContainerType container_type, | |
128 ResourceContext* context, | |
129 int render_process_id, | |
130 bool* no_javascript_access) { | |
131 *no_javascript_access = false; | |
132 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | |
133 return true; | |
134 return WebKitTestController::Get()->can_open_windows(); | |
135 } | |
136 | |
137 #if defined(OS_ANDROID) | 124 #if defined(OS_ANDROID) |
138 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 125 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
139 const CommandLine& command_line, | 126 const CommandLine& command_line, |
140 int child_process_id, | 127 int child_process_id, |
141 std::vector<content::FileDescriptorInfo>* mappings) { | 128 std::vector<content::FileDescriptorInfo>* mappings) { |
142 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; | 129 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; |
143 FilePath pak_file; | 130 FilePath pak_file; |
144 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); | 131 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); |
145 CHECK(r); | 132 CHECK(r); |
146 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); | 133 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); |
(...skipping 18 matching lines...) Expand all Loading... |
165 ShellBrowserContext* | 152 ShellBrowserContext* |
166 ShellContentBrowserClient::off_the_record_browser_context() { | 153 ShellContentBrowserClient::off_the_record_browser_context() { |
167 return shell_browser_main_parts_->off_the_record_browser_context(); | 154 return shell_browser_main_parts_->off_the_record_browser_context(); |
168 } | 155 } |
169 | 156 |
170 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { | 157 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { |
171 return new ShellAccessTokenStore(browser_context()->GetRequestContext()); | 158 return new ShellAccessTokenStore(browser_context()->GetRequestContext()); |
172 } | 159 } |
173 | 160 |
174 } // namespace content | 161 } // namespace content |
OLD | NEW |