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 |
124 #if defined(OS_ANDROID) | 137 #if defined(OS_ANDROID) |
125 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 138 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
126 const CommandLine& command_line, | 139 const CommandLine& command_line, |
127 int child_process_id, | 140 int child_process_id, |
128 std::vector<content::FileDescriptorInfo>* mappings) { | 141 std::vector<content::FileDescriptorInfo>* mappings) { |
129 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; | 142 int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ; |
130 FilePath pak_file; | 143 FilePath pak_file; |
131 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); | 144 bool r = PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file); |
132 CHECK(r); | 145 CHECK(r); |
133 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); | 146 pak_file = pak_file.Append(FILE_PATH_LITERAL("paks")); |
(...skipping 18 matching lines...) Expand all Loading... |
152 ShellBrowserContext* | 165 ShellBrowserContext* |
153 ShellContentBrowserClient::off_the_record_browser_context() { | 166 ShellContentBrowserClient::off_the_record_browser_context() { |
154 return shell_browser_main_parts_->off_the_record_browser_context(); | 167 return shell_browser_main_parts_->off_the_record_browser_context(); |
155 } | 168 } |
156 | 169 |
157 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { | 170 AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() { |
158 return new ShellAccessTokenStore(browser_context()->GetRequestContext()); | 171 return new ShellAccessTokenStore(browser_context()->GetRequestContext()); |
159 } | 172 } |
160 | 173 |
161 } // namespace content | 174 } // namespace content |
OLD | NEW |