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

Side by Side Diff: headless/lib/headless_content_main_delegate.cc

Issue 2753033004: Fix resources path for Mac non component build (Closed)
Patch Set: fixed for non component builds Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "headless/lib/headless_content_main_delegate.h" 5 #include "headless/lib/headless_content_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/environment.h" 9 #include "base/environment.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 ui::ResourceBundle::InitSharedInstanceWithLocale( 243 ui::ResourceBundle::InitSharedInstanceWithLocale(
244 locale, nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES); 244 locale, nullptr, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
245 245
246 #ifdef HEADLESS_USE_EMBEDDED_RESOURCES 246 #ifdef HEADLESS_USE_EMBEDDED_RESOURCES
247 ResourceBundle::GetSharedInstance().AddDataPackFromBuffer( 247 ResourceBundle::GetSharedInstance().AddDataPackFromBuffer(
248 base::StringPiece( 248 base::StringPiece(
249 reinterpret_cast<const char*>(kHeadlessResourcePak.contents), 249 reinterpret_cast<const char*>(kHeadlessResourcePak.contents),
250 kHeadlessResourcePak.length), 250 kHeadlessResourcePak.length),
251 ui::SCALE_FACTOR_NONE); 251 ui::SCALE_FACTOR_NONE);
252 #else 252 #else
253 #if defined(OS_MACOSX) && !defined(COMPONENT_BUILD)
254 dir_module = dir_module.Append(FILE_PATH_LITERAL("resources/"));
Sami 2017/03/17 11:12:01 Should this be capitalized? The common pattern I s
dvallet 2017/03/17 19:46:11 You're right, funny I just realized that HFS+ is c
255 #endif
253 // Try loading the headless library pak file first. If it doesn't exist (i.e., 256 // Try loading the headless library pak file first. If it doesn't exist (i.e.,
254 // when we're running with the --headless switch), fall back to the browser's 257 // when we're running with the --headless switch), fall back to the browser's
255 // resource pak. 258 // resource pak.
256 pak_file = dir_module.Append(FILE_PATH_LITERAL("headless_lib.pak")); 259 pak_file = dir_module.Append(FILE_PATH_LITERAL("headless_lib.pak"));
257 if (!base::PathExists(pak_file)) 260 if (!base::PathExists(pak_file))
258 pak_file = dir_module.Append(FILE_PATH_LITERAL("resources.pak")); 261 pak_file = dir_module.Append(FILE_PATH_LITERAL("resources.pak"));
259 ResourceBundle::GetSharedInstance().AddDataPackFromPath( 262 ResourceBundle::GetSharedInstance().AddDataPackFromPath(
260 pak_file, ui::SCALE_FACTOR_NONE); 263 pak_file, ui::SCALE_FACTOR_NONE);
261 #endif 264 #endif
262 } 265 }
263 266
264 content::ContentBrowserClient* 267 content::ContentBrowserClient*
265 HeadlessContentMainDelegate::CreateContentBrowserClient() { 268 HeadlessContentMainDelegate::CreateContentBrowserClient() {
266 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get())); 269 browser_client_.reset(new HeadlessContentBrowserClient(browser_.get()));
267 return browser_client_.get(); 270 return browser_client_.get();
268 } 271 }
269 272
270 } // namespace headless 273 } // namespace headless
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698