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

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

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

Powered by Google App Engine
This is Rietveld 408576698