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

Unified Diff: chrome/browser/ui/browser.cc

Issue 8985008: Don't use browser windows for platform app shell windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add view type, handle window closing. Created 9 years 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/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index ed3bf6ac20ad952cf93fc484b99a4da6b1b9875e..1cef9a413efaee80b909296e4ef20daaf876ddd4 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -49,7 +49,6 @@
#include "chrome/browser/extensions/default_apps_trial.h"
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extension_disabled_infobar_delegate.h"
-#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_tab_helper.h"
@@ -103,6 +102,7 @@
#include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/constrained_window_tab_helper.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_tab_helper.h"
@@ -633,9 +633,17 @@ TabContents* Browser::OpenApplication(
UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100);
switch (container) {
+ case extension_misc::LAUNCH_SHELL: {
+ ShellWindow* shell_window = ShellWindow::Create(
+ profile,
+ extension,
+ UrlForExtension(extension, override_url));
+ if (shell_window)
+ tab = shell_window->tab_contents();
+ break;
+ }
case extension_misc::LAUNCH_WINDOW:
case extension_misc::LAUNCH_PANEL:
- case extension_misc::LAUNCH_SHELL:
tab = Browser::OpenApplicationWindow(profile, extension, container,
override_url, NULL);
break;
@@ -666,18 +674,8 @@ TabContents* Browser::OpenApplicationWindow(
web_app::GenerateApplicationNameFromExtensionId(extension->id()) :
web_app::GenerateApplicationNameFromURL(url);
- Type type = TYPE_POPUP;
- if (extension) {
- switch (container) {
- case extension_misc::LAUNCH_PANEL:
- type = TYPE_PANEL;
- break;
- case extension_misc::LAUNCH_SHELL:
- type = TYPE_SHELL;
- break;
- default: break;
- }
- }
+ Type type = extension && (container == extension_misc::LAUNCH_PANEL) ?
+ TYPE_PANEL : TYPE_POPUP;
gfx::Rect window_bounds;
if (extension) {
@@ -898,8 +896,6 @@ bool Browser::ShouldSaveWindowPlacement() const {
case TYPE_PANEL:
// Do not save the window placement of panels.
return false;
- case TYPE_SHELL:
- return true;
default:
return false;
}

Powered by Google App Engine
This is Rietveld 408576698