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

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: Add unit-test for comparison operators Created 4 years, 6 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
« no previous file with comments | « base/memory/weak_ptr_unittest.cc ('k') | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ee5a791aa2d5c71ac0e1383a05f0b44464e34c54..b59f0b1ed77396bb42e9d85becc1d632a76ded46 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;
« no previous file with comments | « base/memory/weak_ptr_unittest.cc ('k') | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698