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

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc

Issue 1053013007: Minimized windows should not be activated by another user in multiprofile scenario. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address skuhne@'s comments. Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include "ash/accelerators/magnifier_key_scroller.h" 7 #include "ash/accelerators/magnifier_key_scroller.h"
8 #include "ash/accelerators/spoken_feedback_toggler.h" 8 #include "ash/accelerators/spoken_feedback_toggler.h"
9 #include "ash/accessibility_delegate.h" 9 #include "ash/accessibility_delegate.h"
10 #include "ash/wm/mru_window_tracker.h" 10 #include "ash/wm/mru_window_tracker.h"
(...skipping 24 matching lines...) Expand all
35 #include "chrome/grit/generated_resources.h" 35 #include "chrome/grit/generated_resources.h"
36 #include "chromeos/chromeos_switches.h" 36 #include "chromeos/chromeos_switches.h"
37 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
38 #include "content/public/browser/user_metrics.h" 38 #include "content/public/browser/user_metrics.h"
39 #include "ui/aura/window.h" 39 #include "ui/aura/window.h"
40 #include "ui/base/ime/chromeos/input_method_manager.h" 40 #include "ui/base/ime/chromeos/input_method_manager.h"
41 #include "ui/base/l10n/l10n_util.h" 41 #include "ui/base/l10n/l10n_util.h"
42 42
43 namespace { 43 namespace {
44 44
45 void InitAfterSessionStart() { 45 void InitAfterFirstSessionStart() {
46 // Restore focus after the user session is started. It's needed because some 46 // Restore focus after the user session is started. It's needed because some
47 // windows can be opened in background while login UI is still active because 47 // windows can be opened in background while login UI is still active because
48 // we currently restore browser windows before login UI is deleted. 48 // we currently restore browser windows before login UI is deleted.
49 ash::Shell* shell = ash::Shell::GetInstance(); 49 ash::Shell* shell = ash::Shell::GetInstance();
50 ash::MruWindowTracker::WindowList mru_list = 50 ash::MruWindowTracker::WindowList mru_list =
51 shell->mru_window_tracker()->BuildMruWindowList(); 51 shell->mru_window_tracker()->BuildMruWindowList();
52 if (!mru_list.empty()) 52 if (!mru_list.empty())
53 mru_list.front()->Focus(); 53 mru_list.front()->Focus();
54 54
55 // Enable magnifier scroll keys as there may be no mouse cursor in kiosk mode. 55 // Enable magnifier scroll keys as there may be no mouse cursor in kiosk mode.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (!chromeos::ProfileHelper::IsSigninProfile(profile) && 256 if (!chromeos::ProfileHelper::IsSigninProfile(profile) &&
257 !profile->IsGuestSession() && !profile->IsSupervised()) { 257 !profile->IsGuestSession() && !profile->IsSupervised()) {
258 // Start the error notifier services to show auth/sync notifications. 258 // Start the error notifier services to show auth/sync notifications.
259 SigninErrorNotifierFactory::GetForProfile(profile); 259 SigninErrorNotifierFactory::GetForProfile(profile);
260 SyncErrorNotifierFactory::GetForProfile(profile); 260 SyncErrorNotifierFactory::GetForProfile(profile);
261 } 261 }
262 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); 262 ash::Shell::GetInstance()->OnLoginUserProfilePrepared();
263 break; 263 break;
264 } 264 }
265 case chrome::NOTIFICATION_SESSION_STARTED: 265 case chrome::NOTIFICATION_SESSION_STARTED:
266 InitAfterSessionStart(); 266 // InitAfterFirstSessionStart() should only be called once upon system
267 // start.
268 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() < 2)
269 InitAfterFirstSessionStart();
267 ash::Shell::GetInstance()->ShowShelf(); 270 ash::Shell::GetInstance()->ShowShelf();
268 break; 271 break;
269 default: 272 default:
270 NOTREACHED() << "Unexpected notification " << type; 273 NOTREACHED() << "Unexpected notification " << type;
271 } 274 }
272 } 275 }
273 276
274 void ChromeShellDelegate::PlatformInit() { 277 void ChromeShellDelegate::PlatformInit() {
275 registrar_.Add(this, 278 registrar_.Add(this,
276 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 279 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
277 content::NotificationService::AllSources()); 280 content::NotificationService::AllSources());
278 registrar_.Add(this, 281 registrar_.Add(this,
279 chrome::NOTIFICATION_SESSION_STARTED, 282 chrome::NOTIFICATION_SESSION_STARTED,
280 content::NotificationService::AllSources()); 283 content::NotificationService::AllSources());
281 } 284 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698