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

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

Issue 2272813003: Add ARC++ specific fields to launch data for specific apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 3 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
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 "base/memory/ptr_util.h"
8 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
7 #include "chrome/browser/extensions/launch_util.h" 9 #include "chrome/browser/extensions/launch_util.h"
8 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "components/arc/arc_bridge_service.h"
9 #include "extensions/browser/extension_prefs.h" 12 #include "extensions/browser/extension_prefs.h"
10 #include "extensions/common/constants.h" 13 #include "extensions/common/constants.h"
11 #include "extensions/common/extension.h" 14 #include "extensions/common/extension.h"
12 #include "ui/base/window_open_disposition.h" 15 #include "ui/base/window_open_disposition.h"
13 16
14 using extensions::ExtensionPrefs; 17 using extensions::ExtensionPrefs;
15 18
16 AppLaunchParams::AppLaunchParams(Profile* profile, 19 AppLaunchParams::AppLaunchParams(Profile* profile,
17 const extensions::Extension* extension, 20 const extensions::Extension* extension,
18 extensions::LaunchContainer container, 21 extensions::LaunchContainer container,
19 WindowOpenDisposition disposition, 22 WindowOpenDisposition disposition,
20 extensions::AppLaunchSource source) 23 extensions::AppLaunchSource source,
24 bool set_playstore_status)
21 : profile(profile), 25 : profile(profile),
22 extension_id(extension ? extension->id() : std::string()), 26 extension_id(extension ? extension->id() : std::string()),
23 container(container), 27 container(container),
24 disposition(disposition), 28 disposition(disposition),
25 command_line(base::CommandLine::NO_PROGRAM), 29 command_line(base::CommandLine::NO_PROGRAM),
26 source(source) {} 30 source(source),
31 play_store_status(PlayStoreStatus::PLAY_STORE_STATUS_UNKNOWN) {
32 if (set_playstore_status) {
33 if (arc::ArcAuthService::IsAllowedForProfile(profile)) {
34 play_store_status = PlayStoreStatus::PLAY_STORE_STATUS_ENABLED;
35 } else if (arc::ArcBridgeService::IsArcAvailable()) {
36 play_store_status = PlayStoreStatus::PLAY_STORE_STATUS_AVAILABLE;
37 } // else, defaults to PLAY_STORE_STATUS_UNKNOWN.
38 }
39 }
27 40
28 AppLaunchParams::AppLaunchParams(const AppLaunchParams& other) = default; 41 AppLaunchParams::AppLaunchParams(const AppLaunchParams& other) = default;
29 42
30 AppLaunchParams::~AppLaunchParams() {} 43 AppLaunchParams::~AppLaunchParams() {}
31 44
32 AppLaunchParams CreateAppLaunchParamsUserContainer( 45 AppLaunchParams CreateAppLaunchParamsUserContainer(
33 Profile* profile, 46 Profile* profile,
34 const extensions::Extension* extension, 47 const extensions::Extension* extension,
35 WindowOpenDisposition disposition, 48 WindowOpenDisposition disposition,
36 extensions::AppLaunchSource source) { 49 extensions::AppLaunchSource source) {
(...skipping 23 matching lines...) Expand all
60 disposition = raw_disposition; 73 disposition = raw_disposition;
61 } else { 74 } else {
62 // Look at preference to find the right launch container. If no preference 75 // Look at preference to find the right launch container. If no preference
63 // is set, launch as a regular tab. 76 // is set, launch as a regular tab.
64 container = 77 container =
65 extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension); 78 extensions::GetLaunchContainer(ExtensionPrefs::Get(profile), extension);
66 disposition = NEW_FOREGROUND_TAB; 79 disposition = NEW_FOREGROUND_TAB;
67 } 80 }
68 return AppLaunchParams(profile, extension, container, disposition, source); 81 return AppLaunchParams(profile, extension, container, disposition, source);
69 } 82 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698