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

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

Issue 1120013003: Add right-click user switching tutorial bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/profiles/profiles_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_window.cc
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc
index 73508b66e7ae79a536ea27becd25cbbe323b8c00..177bb3bf4415fce717945152c04d62ff3ac59030 100644
--- a/chrome/browser/profiles/profile_window.cc
+++ b/chrome/browser/profiles/profile_window.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/signin/account_reconcilor_factory.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/signin/signin_ui_util.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -312,7 +313,7 @@ bool HasProfileSwitchTargets(Profile* profile) {
size_t min_profiles = profile->IsGuestSession() ? 1 : 2;
size_t number_of_profiles =
g_browser_process->profile_manager()->GetNumberOfProfiles();
- return number_of_profiles < min_profiles;
+ return number_of_profiles >= min_profiles;
}
void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type,
@@ -525,4 +526,26 @@ void BubbleViewModeFromAvatarBubbleMode(
}
}
+bool ShouldShowWelcomeUpgradeTutorial(
+ Profile* profile, TutorialMode tutorial_mode) {
+ const int show_count = profile->GetPrefs()->GetInteger(
+ prefs::kProfileAvatarTutorialShown);
+ // Do not show the tutorial if user has dismissed it.
+ if (show_count > signin_ui_util::kUpgradeWelcomeTutorialShowMax)
+ return false;
+
+ return tutorial_mode == TUTORIAL_MODE_WELCOME_UPGRADE ||
+ show_count != signin_ui_util::kUpgradeWelcomeTutorialShowMax;
+}
+
+bool ShouldShowRightClickTutorial(Profile* profile) {
+ PrefService* local_state = g_browser_process->local_state();
+ const bool dismissed = local_state->GetBoolean(
+ prefs::kProfileAvatarRightClickTutorialDismissed);
+
+ // Don't show the tutorial if it's already been dismissed or if right-clicking
+ // wouldn't show any targets.
+ return !dismissed && HasProfileSwitchTargets(profile);
+}
+
} // namespace profiles
« no previous file with comments | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/profiles/profiles_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698