diff options
author | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-23 23:02:26 +0000 |
---|---|---|
committer | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-23 23:02:26 +0000 |
commit | dc37b00ad97e68b6c149b38b49415664825701b4 (patch) | |
tree | bb3515eda9ec6dbbc4a993c7c383bf03379bdbde /chrome/browser/ui/browser.cc | |
parent | f14c0450c2d19a798c222c14186e9d17dd4df09e (diff) | |
download | chromium_src-dc37b00ad97e68b6c149b38b49415664825701b4.zip chromium_src-dc37b00ad97e68b6c149b38b49415664825701b4.tar.gz chromium_src-dc37b00ad97e68b6c149b38b49415664825701b4.tar.bz2 |
Switch platform apps from a declarative launch container to handling an onLaunched event.
Platform apps must now have a background page. For the handling of launches,
the background page registers an onLaunched event handler, and creates UI
as appropriate via the chrome.windows.* API.
Updates all tests to use the new window model.
Also makes created shell window respect the bounds that were passed into the
chrome.windows.create() call.
Also fixes bug by resizing windows in PlatformAppBrowserTest.WindowsApi to a
size that matches the Aura grid.
This CL was originally written by mihaip@chromium.org - the original is:
http://codereview.chromium.org/9969087/
TBR=mihaip@chromium.org
BUG=119410
TEST=Platform apps should now require a background page.
Review URL: https://chromiumcodereview.appspot.com/10080017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser.cc')
-rw-r--r-- | chrome/browser/ui/browser.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 1dd9457..a94a009 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -51,7 +51,7 @@ #include "chrome/browser/extensions/browser_extension_window_controller.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/default_apps_trial.h" -#include "chrome/browser/extensions/extension_browser_event_router.h" +#include "chrome/browser/extensions/api/app/app_api.h" #include "chrome/browser/extensions/extension_prefs.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_tab_helper.h" @@ -692,14 +692,14 @@ WebContents* Browser::OpenApplication( UMA_HISTOGRAM_ENUMERATION("Extensions.AppLaunchContainer", container, 100); + if (extension->is_platform_app()) { + extensions::AppEventRouter::DispatchOnLaunchedEvent(profile, extension); + return NULL; + } + 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(); + case extension_misc::LAUNCH_NONE: { + NOTREACHED(); break; } case extension_misc::LAUNCH_PANEL: |