Commit b80ea1c8 authored by Roman Sorokin's avatar Roman Sorokin Committed by Commit Bot

Override stub path before PreEarlyInitDBus

Otherwise install attributes are not loaded on the linux Chrome OS
build.

TEST=manual

Bug: 848615, 729596
Change-Id: I445b2b337b707822459c076058610f49f02767ab
Reviewed-on: https://chromium-review.googlesource.com/c/1264643
Commit-Queue: Roman Sorokin <rsorokin@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599138}
parent 761a7e81
......@@ -118,7 +118,6 @@
#include "chromeos/accelerometer/accelerometer_reader.h"
#include "chromeos/audio/audio_devices_pref_handler_impl.h"
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/chromeos_paths.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/components/drivefs/fake_drivefs_launcher_client.h"
#include "chromeos/cryptohome/async_method_caller.h"
......@@ -267,22 +266,6 @@ bool ShallAttemptTpmOwnership() {
#endif
}
void RegisterStubPathOverridesIfNecessary() {
// These overrides need to occur before BrowserPolicyConnectorChromeOS
// (for one) is created. The DCHECK ensures that is the case.
DCHECK(!g_browser_process);
base::FilePath user_data_dir;
if (base::SysInfo::IsRunningOnChromeOS() ||
!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) {
return;
}
// Override some paths with stub locations so that cloud policy and enterprise
// enrollment work on desktop builds, for ease of development.
chromeos::RegisterStubPathOverrides(user_data_dir);
}
} // namespace
namespace internal {
......@@ -566,8 +549,6 @@ int ChromeBrowserMainPartsChromeos::PreEarlyInitialization() {
.value();
}
RegisterStubPathOverridesIfNecessary();
#if defined(GOOGLE_CHROME_BUILD)
const char kChromeOSReleaseTrack[] = "CHROMEOS_RELEASE_TRACK";
std::string channel;
......
......@@ -12,10 +12,12 @@
#include "base/files/file_util.h"
#include "base/memory/scoped_refptr.h"
#include "base/path_service.h"
#include "base/sys_info.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "cc/base/switches.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/browser/metrics/chrome_metrics_services_manager_client.h"
#include "chrome/browser/prefs/browser_prefs.h"
......@@ -41,7 +43,30 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/dbus/dbus_helper.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#endif
#include "chromeos/chromeos_paths.h"
#endif // defined(OS_CHROMEOS)
namespace {
#if defined(OS_CHROMEOS)
void RegisterStubPathOverridesIfNecessary() {
// These overrides need to occur before BrowserPolicyConnectorChromeOS
// (for one) is created. The DCHECK ensures that is the case.
DCHECK(!g_browser_process);
base::FilePath user_data_dir;
if (base::SysInfo::IsRunningOnChromeOS() ||
!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) {
return;
}
// Override some paths with stub locations so that cloud policy and enterprise
// enrollment work on desktop builds, for ease of development.
chromeos::RegisterStubPathOverrides(user_data_dir);
}
#endif // defined(OS_CHROMEOS)
} // namespace
ChromeFeatureListCreator::ChromeFeatureListCreator() = default;
......@@ -88,6 +113,7 @@ void ChromeFeatureListCreator::CreatePrefService() {
RegisterLocalState(pref_registry.get());
#if defined(OS_CHROMEOS)
RegisterStubPathOverridesIfNecessary();
chromeos::PreEarlyInitDBus();
browser_policy_connector_ =
std::make_unique<policy::BrowserPolicyConnectorChromeOS>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment