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

Unified Diff: chrome/browser/profiles/profile_shortcut_manager_win.cc

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/profiles/profile_shortcut_manager_win.cc
diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc
index 1b3fffd10eff8aa9319f0aae2e89fa3365a8b7e2..d65cec066e6490bcd3d3e862b35f85cf627b4761 100644
--- a/chrome/browser/profiles/profile_shortcut_manager_win.cc
+++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc
@@ -1008,20 +1008,13 @@ void ProfileShortcutManagerWin::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- switch (type) {
- // This notification is triggered when a profile is loaded.
- case chrome::NOTIFICATION_PROFILE_CREATED: {
- Profile* profile =
- content::Source<Profile>(source).ptr()->GetOriginalProfile();
- if (profile->GetPrefs()->GetInteger(prefs::kProfileIconVersion) <
- kCurrentProfileIconVersion) {
- // Ensure the profile's icon file has been created.
- CreateOrUpdateProfileIcon(profile->GetPath());
- }
- break;
- }
- default:
- NOTREACHED();
- break;
+ DCHECK_EQ(chrome::NOTIFICATION_PROFILE_CREATED, type);
+
+ Profile* profile =
+ content::Source<Profile>(source).ptr()->GetOriginalProfile();
+ if (profile->GetPrefs()->GetInteger(prefs::kProfileIconVersion) <
+ kCurrentProfileIconVersion) {
+ // Ensure the profile's icon file has been created.
+ CreateOrUpdateProfileIcon(profile->GetPath());
}
}

Powered by Google App Engine
This is Rietveld 408576698