Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 2 | // 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] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 7 | |
Avi Drissman | 02e49e58 | 2023-01-07 01:23:18 | [diff] [blame] | 8 | #include "base/functional/callback_forward.h" |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 9 | #include "build/build_config.h" |
10 | |||||
11 | // Hide this function on platforms where the dialog does not exist. | ||||
Georg Neis | ae2d4c2 | 2025-02-14 16:54:05 | [diff] [blame] | 12 | #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 13 | |
[email protected] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 14 | namespace first_run { |
15 | |||||
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 16 | // Shows the first run dialog. Only called for organic first runs on Mac and |
17 | // desktop Linux official builds when metrics reporting is not already enabled. | ||||
18 | // Invokes ChangeMetricsReportingState() if consent is given to enable crash | ||||
19 | // reporting, and may initiate the flow to set the default browser. | ||||
David Roger | d283a17 | 2022-10-06 10:01:15 | [diff] [blame] | 20 | void ShowFirstRunDialog(); |
21 | void ShowFirstRunDialogViews(); | ||||
Keren Zhu | 5680b21d | 2021-05-14 19:01:07 | [diff] [blame] | 22 | // Maintain Cocoa-based first run dialog until we are confident that views' |
23 | // implementation works well on macOS. | ||||
Xiaohan Wang | 19e3055c | 2022-01-16 04:19:32 | [diff] [blame] | 24 | #if BUILDFLAG(IS_MAC) |
David Roger | d283a17 | 2022-10-06 10:01:15 | [diff] [blame] | 25 | void ShowFirstRunDialogCocoa(); |
Keren Zhu | 5680b21d | 2021-05-14 19:01:07 | [diff] [blame] | 26 | #endif |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 27 | |
28 | // Returns a Closure invoked before calling ShowFirstRunDialog(). For testing. | ||||
29 | base::OnceClosure& GetBeforeShowFirstRunDialogHookForTesting(); | ||||
[email protected] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 30 | |
31 | } // namespace first_run | ||||
32 | |||||
Georg Neis | ae2d4c2 | 2025-02-14 16:54:05 | [diff] [blame] | 33 | #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 34 | |
[email protected] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 35 | #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_ |