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

Unified Diff: chrome/browser/chromeos/accessibility/magnification_manager.cc

Issue 11791016: Magnifier: support guest mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/accessibility/magnification_manager.cc
diff --git a/chrome/browser/chromeos/accessibility/magnification_manager.cc b/chrome/browser/chromeos/accessibility/magnification_manager.cc
index c4a7f686513bc1b2609b7514ad726af560f4b2d1..25d4879881a96183f52bec805bdc8f2d51c9ac2b 100644
--- a/chrome/browser/chromeos/accessibility/magnification_manager.cc
+++ b/chrome/browser/chromeos/accessibility/magnification_manager.cc
@@ -36,6 +36,9 @@ class MagnificationManagerImpl : public MagnificationManager,
profile_(NULL),
type_(ash::MAGNIFIER_OFF) {
registrar_.Add(this,
+ chrome::NOTIFICATION_PROFILE_CREATED,
+ content::NotificationService::AllSources());
+ registrar_.Add(this,
chrome::NOTIFICATION_SESSION_STARTED,
content::NotificationService::AllSources());
registrar_.Add(this,
@@ -139,10 +142,20 @@ class MagnificationManagerImpl : public MagnificationManager,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE {
switch (type) {
+ // When entering the login screen or non-guest desktop.
case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE:
case chrome::NOTIFICATION_SESSION_STARTED: {
Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
- SetProfile(profile);
+ if (!profile->IsGuestSession())
+ SetProfile(profile);
+ break;
+ }
+ // When entering guest desktop, no NOTIFICATION_SESSION_STARTED event is
+ // fired, so we use NOTIFICATION_PROFILE_CREATED event instead.
+ case chrome::NOTIFICATION_PROFILE_CREATED: {
+ Profile* profile = content::Source<Profile>(source).ptr();
+ if (profile->IsGuestSession())
+ SetProfile(profile);
break;
}
case chrome::NOTIFICATION_PROFILE_DESTROYED: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698