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/app/shell_main_delegate.h" | 5 #include "content/shell/app/shell_main_delegate.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 #endif | 252 #endif |
253 | 253 |
254 void ShellMainDelegate::InitializeResourceBundle() { | 254 void ShellMainDelegate::InitializeResourceBundle() { |
255 #if defined(OS_ANDROID) | 255 #if defined(OS_ANDROID) |
256 // In the Android case, the renderer runs with a different UID and can never | 256 // In the Android case, the renderer runs with a different UID and can never |
257 // access the file system. So we are passed a file descriptor to the | 257 // access the file system. So we are passed a file descriptor to the |
258 // ResourceBundle pak at launch time. | 258 // ResourceBundle pak at launch time. |
259 int pak_fd = | 259 int pak_fd = |
260 base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor); | 260 base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor); |
261 if (pak_fd != base::kInvalidPlatformFileValue) { | 261 if (pak_fd != base::kInvalidPlatformFileValue) { |
262 ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_fd, false); | 262 ui::ResourceBundle::InitSharedInstanceWithPakFile(base::File(pak_fd), |
| 263 false); |
263 ResourceBundle::GetSharedInstance().AddDataPackFromFile( | 264 ResourceBundle::GetSharedInstance().AddDataPackFromFile( |
264 pak_fd, ui::SCALE_FACTOR_100P); | 265 base::File(pak_fd), ui::SCALE_FACTOR_100P); |
265 return; | 266 return; |
266 } | 267 } |
267 #endif | 268 #endif |
268 | 269 |
269 base::FilePath pak_file; | 270 base::FilePath pak_file; |
270 #if defined(OS_MACOSX) | 271 #if defined(OS_MACOSX) |
271 pak_file = GetResourcesPakFilePath(); | 272 pak_file = GetResourcesPakFilePath(); |
272 #else | 273 #else |
273 base::FilePath pak_dir; | 274 base::FilePath pak_dir; |
274 | 275 |
(...skipping 14 matching lines...) Expand all Loading... |
289 browser_client_.reset(new ShellContentBrowserClient); | 290 browser_client_.reset(new ShellContentBrowserClient); |
290 return browser_client_.get(); | 291 return browser_client_.get(); |
291 } | 292 } |
292 | 293 |
293 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 294 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
294 renderer_client_.reset(new ShellContentRendererClient); | 295 renderer_client_.reset(new ShellContentRendererClient); |
295 return renderer_client_.get(); | 296 return renderer_client_.get(); |
296 } | 297 } |
297 | 298 |
298 } // namespace content | 299 } // namespace content |
OLD | NEW |