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

Side by Side Diff: chrome/browser/ui/extensions/app_launch_params.cc

Issue 635233008: Make management.launchApp() work for hosted apps on Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webstore_dialogs_athena
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/extensions/app_launch_params.h"
6
7 #include "chrome/browser/extensions/launch_util.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "extensions/browser/extension_prefs.h"
10 #include "extensions/common/extension.h"
11
12 using extensions::ExtensionPrefs;
13
14 AppLaunchParams::AppLaunchParams(Profile* profile,
15 const extensions::Extension* extension,
16 extensions::LaunchContainer container,
17 WindowOpenDisposition disposition)
18 : profile(profile),
19 extension_id(extension ? extension->id() : std::string()),
20 container(container),
21 disposition(disposition),
22 desktop_type(chrome::GetActiveDesktop()),
23 override_url(),
24 override_bounds(),
25 command_line(CommandLine::NO_PROGRAM) {}
26
27 AppLaunchParams::AppLaunchParams(Profile* profile,
28 const extensions::Extension* extension,
29 WindowOpenDisposition disposition)
30 : profile(profile),
31 extension_id(extension ? extension->id() : std::string()),
32 container(extensions::LAUNCH_CONTAINER_NONE),
33 disposition(disposition),
34 desktop_type(chrome::GetActiveDesktop()),
35 override_url(),
36 override_bounds(),
37 command_line(CommandLine::NO_PROGRAM) {
38 // Look up the app preference to find out the right launch container. Default
39 // is to launch as a regular tab.
40 container =
41 extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension);
42 }
43
44 AppLaunchParams::AppLaunchParams(Profile* profile,
45 const extensions::Extension* extension,
46 int event_flags,
47 chrome::HostDesktopType desktop_type)
48 : profile(profile),
49 extension_id(extension ? extension->id() : std::string()),
50 container(extensions::LAUNCH_CONTAINER_NONE),
51 disposition(ui::DispositionFromEventFlags(event_flags)),
52 desktop_type(desktop_type),
53 override_url(),
54 override_bounds(),
55 command_line(CommandLine::NO_PROGRAM) {
56 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) {
57 container = extensions::LAUNCH_CONTAINER_TAB;
58 } else if (disposition == NEW_WINDOW) {
59 container = extensions::LAUNCH_CONTAINER_WINDOW;
60 } else {
61 // Look at preference to find the right launch container. If no preference
62 // is set, launch as a regular tab.
63 container =
64 extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension);
65 disposition = NEW_FOREGROUND_TAB;
66 }
67 }
68
69 AppLaunchParams::~AppLaunchParams() {
70 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/extensions/app_launch_params.h ('k') | chrome/browser/ui/extensions/application_launch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698