blob: 19eeb90fccb0344beda089826a13e51f8767b623 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2012 The Chromium Authors
[email protected]9de26c9b2011-04-18 22:32:182// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_
6#define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_
[email protected]9de26c9b2011-04-18 22:32:187
Avi Drissman02e49e582023-01-07 01:23:188#include "base/functional/callback_forward.h"
Trent Apted4d7d11d42017-11-17 07:42:519#include "build/build_config.h"
Yuta Hijikatae05049fd2020-11-27 07:50:2110#include "build/chromeos_buildflags.h"
Trent Apted4d7d11d42017-11-17 07:42:5111
12// Hide this function on platforms where the dialog does not exist.
Yuta Hijikatae05049fd2020-11-27 07:50:2113// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
14// of lacros-chrome is complete.
Xiaohan Wang19e3055c2022-01-16 04:19:3215#if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
Trent Apted4d7d11d42017-11-17 07:42:5116
[email protected]9de26c9b2011-04-18 22:32:1817namespace first_run {
18
Trent Apted4d7d11d42017-11-17 07:42:5119// Shows the first run dialog. Only called for organic first runs on Mac and
20// desktop Linux official builds when metrics reporting is not already enabled.
21// Invokes ChangeMetricsReportingState() if consent is given to enable crash
22// reporting, and may initiate the flow to set the default browser.
David Rogerd283a172022-10-06 10:01:1523void ShowFirstRunDialog();
24void ShowFirstRunDialogViews();
Keren Zhu5680b21d2021-05-14 19:01:0725// Maintain Cocoa-based first run dialog until we are confident that views'
26// implementation works well on macOS.
Xiaohan Wang19e3055c2022-01-16 04:19:3227#if BUILDFLAG(IS_MAC)
David Rogerd283a172022-10-06 10:01:1528void ShowFirstRunDialogCocoa();
Keren Zhu5680b21d2021-05-14 19:01:0729#endif
Trent Apted4d7d11d42017-11-17 07:42:5130
31// Returns a Closure invoked before calling ShowFirstRunDialog(). For testing.
32base::OnceClosure& GetBeforeShowFirstRunDialogHookForTesting();
[email protected]9de26c9b2011-04-18 22:32:1833
34} // namespace first_run
35
Xiaohan Wang19e3055c2022-01-16 04:19:3236#endif
Trent Apted4d7d11d42017-11-17 07:42:5137
[email protected]9de26c9b2011-04-18 22:32:1838#endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_