Index: chrome/browser/ui/extensions/shell_window.cc |
diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc |
index f624f95f2636ad32e41dbe970f8f3d201304b42c..301e7354ca26c8ff4f4ffe0e55d6a9417cb280a4 100644 |
--- a/chrome/browser/ui/extensions/shell_window.cc |
+++ b/chrome/browser/ui/extensions/shell_window.cc |
@@ -8,6 +8,7 @@ |
#include "chrome/browser/extensions/extension_process_manager.h" |
#include "chrome/browser/extensions/extension_tabs_module_constants.h" |
#include "chrome/browser/extensions/extension_window_controller.h" |
+#include "chrome/browser/extensions/platform_app_host.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/sessions/session_id.h" |
#include "chrome/common/chrome_notification_types.h" |
@@ -84,23 +85,22 @@ ShellWindow* ShellWindow::Create(Profile* profile, |
// This object will delete itself when the window is closed. |
return ShellWindow::CreateShellWindow( |
- manager->CreateShellHost(extension, url)); |
+ new PlatformAppHost(profile, url), extension); |
} |
void ShellWindow::Observe(int type, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) { |
switch (type) { |
- case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: |
- if (content::Details<ExtensionHost>(host_.get()) == details) |
- Close(); |
- break; |
+ // TODO(benwells): Use new PLATFORM_HOST_VIEW_SHOULD_CLOSE |
+ // case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: |
+ // if (content::Details<ExtensionHost>(host_.get()) == details) |
+ // Close(); |
+ // break; |
case chrome::NOTIFICATION_EXTENSION_UNLOADED: { |
const Extension* unloaded_extension = |
content::Details<UnloadedExtensionInfo>(details)->extension; |
- // We compare extension IDs and not Extension pointers since ExtensionHost |
- // nulls out its Extension pointer when it gets this notification. |
- if (host_->extension_id() == unloaded_extension->id()) |
+ if (extension_ == unloaded_extension) |
Close(); |
break; |
} |
@@ -112,8 +112,9 @@ void ShellWindow::Observe(int type, |
} |
} |
-ShellWindow::ShellWindow(ExtensionHost* host) |
- : host_(host) { |
+ShellWindow::ShellWindow(PlatformAppHost* host, const Extension* extension) |
+ : host_(host), |
+ extension_(extension) { |
// Close the window in response to window.close() and the like. |
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
content::Source<Profile>(host->profile())); |