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

Unified Diff: apps/app_shim/extension_app_shim_handler_mac.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
« no previous file with comments | « apps/app_shim/app_shim_handler_mac.h ('k') | apps/app_window_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_shim/extension_app_shim_handler_mac.cc
diff --git a/apps/app_shim/extension_app_shim_handler_mac.cc b/apps/app_shim/extension_app_shim_handler_mac.cc
index 4a580a5e3ae9507177a819d42ff6de95a969be84..d9917bc028cc41a5345bc9e017e2d3dbb93ac989 100644
--- a/apps/app_shim/extension_app_shim_handler_mac.cc
+++ b/apps/app_shim/extension_app_shim_handler_mac.cc
@@ -230,14 +230,16 @@ void ExtensionAppShimHandler::QuitAppForWindow(ShellWindow* shell_window) {
ExtensionAppShimHandler* handler =
g_browser_process->platform_part()->app_shim_host_manager()->
extension_app_shim_handler();
- Host* host = handler->FindHost(shell_window->profile(),
- shell_window->extension_id());
+ Host* host = handler->FindHost(
+ Profile::FromBrowserContext(shell_window->browser_context()),
+ shell_window->extension_id());
if (host) {
handler->OnShimQuit(host);
} else {
// App shims might be disabled or the shim is still starting up.
- ShellWindowRegistry::Get(shell_window->profile())->
- CloseAllShellWindowsForApp(shell_window->extension_id());
+ ShellWindowRegistry::Get(
+ Profile::FromBrowserContext(shell_window->browser_context()))
tapted 2014/02/17 05:25:59 nit: The `FromBrowserContext` cast probably not ne
+ ->CloseAllShellWindowsForApp(shell_window->extension_id());
}
}
@@ -245,7 +247,8 @@ void ExtensionAppShimHandler::HideAppForWindow(ShellWindow* shell_window) {
ExtensionAppShimHandler* handler =
g_browser_process->platform_part()->app_shim_host_manager()->
extension_app_shim_handler();
- Profile* profile = shell_window->profile();
+ Profile* profile =
+ Profile::FromBrowserContext(shell_window->browser_context());
Host* host = handler->FindHost(profile, shell_window->extension_id());
if (host)
host->OnAppHide();
@@ -258,7 +261,8 @@ void ExtensionAppShimHandler::FocusAppForWindow(ShellWindow* shell_window) {
ExtensionAppShimHandler* handler =
g_browser_process->platform_part()->app_shim_host_manager()->
extension_app_shim_handler();
- Profile* profile = shell_window->profile();
+ Profile* profile =
+ Profile::FromBrowserContext(shell_window->browser_context());
const std::string& app_id = shell_window->extension_id();
Host* host = handler->FindHost(profile, app_id);
if (host) {
@@ -277,7 +281,8 @@ bool ExtensionAppShimHandler::RequestUserAttentionForWindow(
ExtensionAppShimHandler* handler =
g_browser_process->platform_part()->app_shim_host_manager()->
extension_app_shim_handler();
- Profile* profile = shell_window->profile();
+ Profile* profile =
+ Profile::FromBrowserContext(shell_window->browser_context());
Host* host = handler->FindHost(profile, shell_window->extension_id());
if (host) {
// Bring the window to the front without showing it.
« no previous file with comments | « apps/app_shim/app_shim_handler_mac.h ('k') | apps/app_window_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698