-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix brave/brave-browser#21464 Enabled first run dialog on Windows.
- Loading branch information
Showing
5 changed files
with
97 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_ | ||
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_ | ||
|
||
#include "build/build_config.h" | ||
|
||
#include "src/chrome/browser/first_run/first_run_dialog.h" | ||
|
||
#if BUILDFLAG(IS_WIN) | ||
|
||
class Profile; | ||
|
||
namespace first_run { | ||
|
||
// Enable first run dialog on Win also. | ||
// Upstream only uses it for macOS/Linux. | ||
void ShowFirstRunDialog(Profile* profile); | ||
void ShowFirstRunDialogViews(Profile* profile); | ||
|
||
} // namespace first_run | ||
|
||
#endif // BUILDFLAG(IS_WIN) | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_FIRST_RUN_FIRST_RUN_DIALOG_H_ |
40 changes: 40 additions & 0 deletions
40
chromium_src/chrome/browser/first_run/first_run_internal_win.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "chrome/browser/first_run/first_run_dialog.h" | ||
#include "chrome/browser/first_run/first_run_internal.h" | ||
|
||
namespace { | ||
|
||
bool ShouldShowFirstRunDialog() { | ||
#if defined(OFFICIAL_BUILD) | ||
return first_run::internal::IsOrganicFirstRun(); | ||
#else | ||
return false; | ||
#endif | ||
} | ||
|
||
} // namespace | ||
|
||
#define DoPostImportPlatformSpecificTasks \ | ||
DoPostImportPlatformSpecificTasks_ChromiumImpl | ||
|
||
#include "src/chrome/browser/first_run/first_run_internal_win.cc" | ||
|
||
#undef DoPostImportPlatformSpecificTasks | ||
|
||
namespace first_run { | ||
namespace internal { | ||
|
||
void DoPostImportPlatformSpecificTasks(Profile* profile) { | ||
if (ShouldShowFirstRunDialog()) { | ||
ShowFirstRunDialog(profile); | ||
} | ||
|
||
DoPostImportPlatformSpecificTasks_ChromiumImpl(profile); | ||
} | ||
|
||
} // namespace internal | ||
} // namespace first_run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters