[email protected] | 2381ed2 | 2012-01-26 04:05:29 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[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 | |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 8 | #include "base/callback_forward.h" |
| 9 | #include "build/build_config.h" |
Yuta Hijikata | e05049fd | 2020-11-27 07:50:21 | [diff] [blame] | 10 | #include "build/chromeos_buildflags.h" |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 11 | |
| 12 | // Hide this function on platforms where the dialog does not exist. |
Yuta Hijikata | e05049fd | 2020-11-27 07:50:21 | [diff] [blame] | 13 | // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch |
| 14 | // of lacros-chrome is complete. |
Xiaohan Wang | 19e3055c | 2022-01-16 04:19:32 | [diff] [blame^] | 15 | #if BUILDFLAG(IS_MAC) || (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 16 | |
[email protected] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 17 | class Profile; |
| 18 | |
| 19 | namespace first_run { |
| 20 | |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 21 | // Shows the first run dialog. Only called for organic first runs on Mac and |
| 22 | // desktop Linux official builds when metrics reporting is not already enabled. |
| 23 | // Invokes ChangeMetricsReportingState() if consent is given to enable crash |
| 24 | // reporting, and may initiate the flow to set the default browser. |
| 25 | void ShowFirstRunDialog(Profile* profile); |
Keren Zhu | 5680b21d | 2021-05-14 19:01:07 | [diff] [blame] | 26 | void ShowFirstRunDialogViews(Profile* profile); |
| 27 | // Maintain Cocoa-based first run dialog until we are confident that views' |
| 28 | // implementation works well on macOS. |
Xiaohan Wang | 19e3055c | 2022-01-16 04:19:32 | [diff] [blame^] | 29 | #if BUILDFLAG(IS_MAC) |
Keren Zhu | 5680b21d | 2021-05-14 19:01:07 | [diff] [blame] | 30 | void ShowFirstRunDialogCocoa(Profile* profile); |
| 31 | #endif |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 32 | |
| 33 | // Returns a Closure invoked before calling ShowFirstRunDialog(). For testing. |
| 34 | base::OnceClosure& GetBeforeShowFirstRunDialogHookForTesting(); |
[email protected] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 35 | |
| 36 | } // namespace first_run |
| 37 | |
Xiaohan Wang | 19e3055c | 2022-01-16 04:19:32 | [diff] [blame^] | 38 | #endif |
Trent Apted | 4d7d11d4 | 2017-11-17 07:42:51 | [diff] [blame] | 39 | |
[email protected] | 9de26c9b | 2011-04-18 22:32:18 | [diff] [blame] | 40 | #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_ |