Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3419)

Unified Diff: chrome/browser/ui/startup/default_browser_infobar_delegate.cc

Issue 2758353002: Deprecate the StickyDefaultBrowserPrompt experiment (Closed)
Patch Set: Remove unused include Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/startup/default_browser_infobar_delegate.cc
diff --git a/chrome/browser/ui/startup/default_browser_infobar_delegate.cc b/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
index bec61e7cdc0e1b434fd6e4c397785704c6edb0fd..71f308de51e7107146afb87e3633d2ef398a26f8 100644
--- a/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
+++ b/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
@@ -16,22 +16,8 @@
#include "content/public/browser/user_metrics.h"
#include "ui/base/l10n/l10n_util.h"
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif
-
namespace chrome {
-bool IsStickyDefaultBrowserPromptEnabled() {
-#if defined(OS_WIN)
- // The flow to set the default browser is only asynchronous on Windows 10+.
- return base::win::GetVersion() >= base::win::VERSION_WIN10 &&
- base::FeatureList::IsEnabled(kStickyDefaultBrowserPrompt);
-#else
- return false;
-#endif
-}
-
// static
void DefaultBrowserInfoBarDelegate::Create(InfoBarService* infobar_service,
Profile* profile) {
@@ -128,34 +114,13 @@ bool DefaultBrowserInfoBarDelegate::Accept() {
ACCEPT_INFO_BAR,
NUM_INFO_BAR_USER_INTERACTION_TYPES);
- bool close_infobar = true;
- shell_integration::DefaultWebClientWorkerCallback set_as_default_callback;
-
- if (IsStickyDefaultBrowserPromptEnabled()) {
- // When the experiment is enabled, the infobar is only closed when the
- // DefaultBrowserWorker is finished.
- set_as_default_callback =
- base::Bind(&DefaultBrowserInfoBarDelegate::OnSetAsDefaultFinished,
- weak_factory_.GetWeakPtr());
- close_infobar = false;
- }
-
// The worker pointer is reference counted. While it is running, the
// message loops of the FILE and UI thread will hold references to it
// and it will be automatically freed once all its tasks have finished.
- CreateDefaultBrowserWorker(set_as_default_callback)->StartSetAsDefault();
- return close_infobar;
-}
-
-scoped_refptr<shell_integration::DefaultBrowserWorker>
-DefaultBrowserInfoBarDelegate::CreateDefaultBrowserWorker(
- const shell_integration::DefaultWebClientWorkerCallback& callback) {
- return new shell_integration::DefaultBrowserWorker(callback);
-}
-
-void DefaultBrowserInfoBarDelegate::OnSetAsDefaultFinished(
- shell_integration::DefaultWebClientState state) {
- infobar()->owner()->RemoveInfoBar(infobar());
+ make_scoped_refptr(new shell_integration::DefaultBrowserWorker(
+ shell_integration::DefaultWebClientWorkerCallback()))
+ ->StartSetAsDefault();
+ return true;
}
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698