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

Unified Diff: chrome/browser/ui/ash/launcher/multi_profile_shell_window_launcher_controller.cc

Issue 157813007: Remove Profile dependency from apps::ShellWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 10 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/ui/ash/launcher/multi_profile_shell_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/multi_profile_shell_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/multi_profile_shell_window_launcher_controller.cc
index 13280a99297fc67053595496affea981ea7754a4..dd171f18fa1c387c4dbe1ad0acd7ceef4253fed0 100644
--- a/chrome/browser/ui/ash/launcher/multi_profile_shell_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/multi_profile_shell_window_launcher_controller.cc
@@ -43,14 +43,18 @@ void MultiProfileShellWindowLauncherController::ActiveUserChanged(
for (ShellWindowList::iterator it = shell_window_list_.begin();
it != shell_window_list_.end(); ++it) {
apps::ShellWindow* shell_window = *it;
- if (!multi_user_util::IsProfileFromActiveUser(shell_window->profile()) &&
+ Profile* profile =
+ Profile::FromBrowserContext(shell_window->browser_context());
+ if (!multi_user_util::IsProfileFromActiveUser(profile) &&
IsRegisteredApp(shell_window->GetNativeWindow()))
UnregisterApp(shell_window->GetNativeWindow());
}
for (ShellWindowList::iterator it = shell_window_list_.begin();
it != shell_window_list_.end(); ++it) {
apps::ShellWindow* shell_window = *it;
- if (multi_user_util::IsProfileFromActiveUser(shell_window->profile()) &&
+ Profile* profile =
+ Profile::FromBrowserContext(shell_window->browser_context());
+ if (multi_user_util::IsProfileFromActiveUser(profile) &&
!IsRegisteredApp(shell_window->GetNativeWindow()))
RegisterApp(*it);
}
@@ -69,7 +73,9 @@ void MultiProfileShellWindowLauncherController::OnShellWindowAdded(
if (!ControlsWindow(shell_window->GetNativeWindow()))
return;
shell_window_list_.push_back(shell_window);
- if (multi_user_util::IsProfileFromActiveUser(shell_window->profile()))
+ Profile* profile =
+ Profile::FromBrowserContext(shell_window->browser_context());
+ if (multi_user_util::IsProfileFromActiveUser(profile))
RegisterApp(shell_window);
}

Powered by Google App Engine
This is Rietveld 408576698