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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 1909263002: Replace safe-bool idiom with explicit WeakPtr::operator bool() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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/sync/one_click_signin_sync_starter.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
index 8aeb723f22347631056d6a4e50d7e40feea652df..fd7bcc10332cdca34414edcfc9560e6bb699c113 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -84,7 +84,7 @@ OneClickSigninSyncStarter::OneClickSigninSyncStarter(
const GURL& continue_url,
Callback sync_setup_completed_callback)
: content::WebContentsObserver(web_contents),
- profile_(NULL),
+ profile_(nullptr),
start_mode_(start_mode),
confirmation_required_(confirmation_required),
current_url_(current_url),
@@ -108,7 +108,7 @@ OneClickSigninSyncStarter::OneClickSigninSyncStarter(
void OneClickSigninSyncStarter::OnBrowserRemoved(Browser* browser) {
if (browser == browser_)
- browser_ = NULL;
+ browser_ = nullptr;
}
OneClickSigninSyncStarter::~OneClickSigninSyncStarter() {
@@ -174,7 +174,7 @@ void OneClickSigninSyncStarter::SigninDialogDelegate::OnCancelSignin() {
SetUserChoiceHistogram(SIGNIN_CHOICE_CANCEL);
content::RecordAction(
base::UserMetricsAction("Signin_EnterpriseAccountPrompt_Cancel"));
- if (sync_starter_ != NULL)
+ if (sync_starter_)
sync_starter_->CancelSigninAndDelete();
}
@@ -183,7 +183,7 @@ void OneClickSigninSyncStarter::SigninDialogDelegate::OnContinueSignin() {
content::RecordAction(
base::UserMetricsAction("Signin_EnterpriseAccountPrompt_ImportData"));
- if (sync_starter_ != NULL)
+ if (sync_starter_)
sync_starter_->LoadPolicyWithCachedCredentials();
}
@@ -192,7 +192,7 @@ void OneClickSigninSyncStarter::SigninDialogDelegate::OnSigninWithNewProfile() {
content::RecordAction(
base::UserMetricsAction("Signin_EnterpriseAccountPrompt_DontImportData"));
- if (sync_starter_ != NULL)
+ if (sync_starter_)
sync_starter_->CreateNewSignedInProfile();
}
@@ -306,7 +306,7 @@ void OneClickSigninSyncStarter::CompleteInitForNewProfile(
// and switch over to tracking that profile.
new_signin_manager->CopyCredentialsFrom(*old_signin_manager);
FinishProfileSyncServiceSetup();
- Initialize(new_profile, NULL);
+ Initialize(new_profile, nullptr);
DCHECK_EQ(profile_, new_profile);
// We've transferred our credentials to the new profile - notify that
@@ -608,7 +608,7 @@ void OneClickSigninSyncStarter::ShowSettingsPage(bool configure_sync) {
}
ProfileSyncService* OneClickSigninSyncStarter::GetProfileSyncService() {
- ProfileSyncService* service = NULL;
+ ProfileSyncService* service = nullptr;
if (profile_->IsSyncAllowed())
service = ProfileSyncServiceFactory::GetForProfile(profile_);
return service;

Powered by Google App Engine
This is Rietveld 408576698