Commit 70fee986 authored by James Cook's avatar James Cook Committed by Commit Bot

lacros: Introduce ChromeBrowserMainPartsLacros

I need to introduce it so I have a place to put some crash and metrics
consent code that needs to run early in browser startup.

No functional changes.

Bug: 1148604
Change-Id: I9dca170b1cf9f0453e174d7cbe0a0b8652f7328b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2508367Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828773}
parent cf89a770
......@@ -4501,6 +4501,8 @@ static_library("browser") {
if (is_lacros) {
assert(enable_native_notifications)
sources += [
"chrome_browser_main_parts_lacros.cc",
"chrome_browser_main_parts_lacros.h",
"feedback/show_feedback_page_lacros.cc",
"first_run/first_run_internal_lacros.cc",
"lacros/account_manager_facade_factory_lacros.cc",
......
......@@ -17,6 +17,8 @@ per-file *.xtb=file://tools/translation/TRANSLATION_OWNERS
per-file *_android.*=file://chrome/browser/android/OWNERS
per-file *.java=file://chrome/browser/android/OWNERS
per-file *_lacros*=file://chrome/browser/lacros/OWNERS
per-file browser_resources.grd=file://ui/webui/PLATFORM_OWNERS
per-file dev_ui_browser_resources.grd=file://ui/webui/PLATFORM_OWNERS
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chrome_browser_main_parts_lacros.h"
#include "base/check.h"
#include "chrome/browser/browser_process.h"
#include "content/public/common/result_codes.h"
ChromeBrowserMainPartsLacros::ChromeBrowserMainPartsLacros(
const content::MainFunctionParams& parameters,
StartupData* startup_data)
: ChromeBrowserMainPartsLinux(parameters, startup_data) {}
ChromeBrowserMainPartsLacros::~ChromeBrowserMainPartsLacros() = default;
int ChromeBrowserMainPartsLacros::PreEarlyInitialization() {
int result = ChromeBrowserMainPartsLinux::PreEarlyInitialization();
if (result != content::RESULT_CODE_NORMAL_EXIT)
return result;
DCHECK(g_browser_process->local_state());
// TODO(https://crbug.com/1148604): Inherit metrics consent from ash. Do it
// here because local state is required to check for policy overrides.
return content::RESULT_CODE_NORMAL_EXIT;
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_PARTS_LACROS_H_
#define CHROME_BROWSER_CHROME_BROWSER_MAIN_PARTS_LACROS_H_
#include "chrome/browser/chrome_browser_main_linux.h"
// Startup and shutdown code for Lacros. See ChromeBrowserMainParts for details.
class ChromeBrowserMainPartsLacros : public ChromeBrowserMainPartsLinux {
public:
ChromeBrowserMainPartsLacros(const content::MainFunctionParams& parameters,
StartupData* startup_data);
ChromeBrowserMainPartsLacros(const ChromeBrowserMainPartsLacros&) = delete;
ChromeBrowserMainPartsLacros& operator=(const ChromeBrowserMainPartsLacros&) =
delete;
~ChromeBrowserMainPartsLacros() override;
// ChromeBrowserMainParts:
int PreEarlyInitialization() override;
};
#endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_PARTS_LACROS_H_
......@@ -647,6 +647,7 @@
#endif
#if BUILDFLAG(IS_LACROS)
#include "chrome/browser/chrome_browser_main_parts_lacros.h"
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_lacros.h"
#include "chromeos/lacros/lacros_chrome_service_impl.h"
#endif
......@@ -1374,9 +1375,12 @@ ChromeContentBrowserClient::CreateBrowserMainParts(
#elif defined(OS_MAC)
main_parts =
std::make_unique<ChromeBrowserMainPartsMac>(parameters, &startup_data_);
#elif defined(OS_CHROMEOS)
#elif BUILDFLAG(IS_CHROMEOS_ASH)
main_parts = std::make_unique<chromeos::ChromeBrowserMainPartsChromeos>(
parameters, &startup_data_);
#elif BUILDFLAG(IS_CHROMEOS_LACROS)
main_parts = std::make_unique<ChromeBrowserMainPartsLacros>(parameters,
&startup_data_);
#elif defined(OS_LINUX)
main_parts =
std::make_unique<ChromeBrowserMainPartsLinux>(parameters, &startup_data_);
......
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