| Index: chrome/browser/ui/extensions/app_launch_params.cc
|
| diff --git a/chrome/browser/ui/extensions/app_launch_params.cc b/chrome/browser/ui/extensions/app_launch_params.cc
|
| index fdb6a9f1e331be798eb8b3690320c0b48b582b2e..883ce4710e3519cbdf23fefaa239008e198ba795 100644
|
| --- a/chrome/browser/ui/extensions/app_launch_params.cc
|
| +++ b/chrome/browser/ui/extensions/app_launch_params.cc
|
| @@ -7,14 +7,17 @@
|
| #include "chrome/browser/extensions/launch_util.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "extensions/browser/extension_prefs.h"
|
| +#include "extensions/common/constants.h"
|
| #include "extensions/common/extension.h"
|
| +#include "ui/base/window_open_disposition.h"
|
|
|
| using extensions::ExtensionPrefs;
|
|
|
| AppLaunchParams::AppLaunchParams(Profile* profile,
|
| const extensions::Extension* extension,
|
| extensions::LaunchContainer container,
|
| - WindowOpenDisposition disposition)
|
| + WindowOpenDisposition disposition,
|
| + extensions::AppLaunchSource source)
|
| : profile(profile),
|
| extension_id(extension ? extension->id() : std::string()),
|
| container(container),
|
| @@ -23,12 +26,13 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
|
| override_url(),
|
| override_bounds(),
|
| command_line(CommandLine::NO_PROGRAM),
|
| - source(extensions::SOURCE_UNTRACKED) {
|
| + source(source) {
|
| }
|
|
|
| AppLaunchParams::AppLaunchParams(Profile* profile,
|
| const extensions::Extension* extension,
|
| - WindowOpenDisposition disposition)
|
| + WindowOpenDisposition disposition,
|
| + extensions::AppLaunchSource source)
|
| : profile(profile),
|
| extension_id(extension ? extension->id() : std::string()),
|
| container(extensions::LAUNCH_CONTAINER_NONE),
|
| @@ -37,7 +41,7 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
|
| override_url(),
|
| override_bounds(),
|
| command_line(CommandLine::NO_PROGRAM),
|
| - source(extensions::SOURCE_UNTRACKED) {
|
| + source(source) {
|
| // Look up the app preference to find out the right launch container. Default
|
| // is to launch as a regular tab.
|
| container =
|
| @@ -46,21 +50,24 @@ AppLaunchParams::AppLaunchParams(Profile* profile,
|
|
|
| AppLaunchParams::AppLaunchParams(Profile* profile,
|
| const extensions::Extension* extension,
|
| - int event_flags,
|
| - chrome::HostDesktopType desktop_type)
|
| + WindowOpenDisposition raw_disposition,
|
| + chrome::HostDesktopType desktop_type,
|
| + extensions::AppLaunchSource source)
|
| : profile(profile),
|
| extension_id(extension ? extension->id() : std::string()),
|
| container(extensions::LAUNCH_CONTAINER_NONE),
|
| - disposition(ui::DispositionFromEventFlags(event_flags)),
|
| desktop_type(desktop_type),
|
| override_url(),
|
| override_bounds(),
|
| command_line(CommandLine::NO_PROGRAM),
|
| - source(extensions::SOURCE_UNTRACKED) {
|
| - if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) {
|
| + source(source) {
|
| + if (raw_disposition == NEW_FOREGROUND_TAB ||
|
| + raw_disposition == NEW_BACKGROUND_TAB) {
|
| container = extensions::LAUNCH_CONTAINER_TAB;
|
| - } else if (disposition == NEW_WINDOW) {
|
| + disposition = raw_disposition;
|
| + } else if (raw_disposition == NEW_WINDOW) {
|
| container = extensions::LAUNCH_CONTAINER_WINDOW;
|
| + disposition = raw_disposition;
|
| } else {
|
| // Look at preference to find the right launch container. If no preference
|
| // is set, launch as a regular tab.
|
|
|