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

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: Disable platform app tests on non-GTK platforms. Created 8 years, 11 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 | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 118bdd80b846f393a0050eda719c0654fbcdf34a..8586e02b174b52c305470c55db4c504ac19a2914 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"
@@ -649,9 +649,17 @@ WebContents* 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->web_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;
@@ -682,18 +690,8 @@ WebContents* 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) {
@@ -914,8 +912,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;
}
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698