| 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/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 void ShellMainDelegate::InitializeResourceBundle() { | 261 void ShellMainDelegate::InitializeResourceBundle() { |
| 262 #if defined(OS_ANDROID) | 262 #if defined(OS_ANDROID) |
| 263 // In the Android case, the renderer runs with a different UID and can never | 263 // In the Android case, the renderer runs with a different UID and can never |
| 264 // access the file system. So we are passed a file descriptor to the | 264 // access the file system. So we are passed a file descriptor to the |
| 265 // ResourceBundle pak at launch time. | 265 // ResourceBundle pak at launch time. |
| 266 int pak_fd = | 266 int pak_fd = |
| 267 base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor); | 267 base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor); |
| 268 if (pak_fd >= 0) { | 268 if (pak_fd >= 0) { |
| 269 // This is clearly wrong. See crbug.com/330930 | 269 // This is clearly wrong. See crbug.com/330930 |
| 270 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( | 270 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( |
| 271 base::File(pak_fd), base::MemoryMappedFile::Region::kWholeFile, false); | 271 base::File(pak_fd), base::MemoryMappedFile::Region::kWholeFile); |
| 272 ResourceBundle::GetSharedInstance().AddDataPackFromFile( | 272 ResourceBundle::GetSharedInstance().AddDataPackFromFile( |
| 273 base::File(pak_fd), ui::SCALE_FACTOR_100P); | 273 base::File(pak_fd), ui::SCALE_FACTOR_100P); |
| 274 return; | 274 return; |
| 275 } | 275 } |
| 276 #endif | 276 #endif |
| 277 | 277 |
| 278 base::FilePath pak_file; | 278 base::FilePath pak_file; |
| 279 #if defined(OS_MACOSX) | 279 #if defined(OS_MACOSX) |
| 280 pak_file = GetResourcesPakFilePath(); | 280 pak_file = GetResourcesPakFilePath(); |
| 281 #else | 281 #else |
| (...skipping 16 matching lines...) Expand all Loading... |
| 298 browser_client_.reset(new ShellContentBrowserClient); | 298 browser_client_.reset(new ShellContentBrowserClient); |
| 299 return browser_client_.get(); | 299 return browser_client_.get(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 302 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
| 303 renderer_client_.reset(new ShellContentRendererClient); | 303 renderer_client_.reset(new ShellContentRendererClient); |
| 304 return renderer_client_.get(); | 304 return renderer_client_.get(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace content | 307 } // namespace content |
| OLD | NEW |