summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/services/app_service
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-23 17:21:03 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-23 16:25:15 +0000
commitc551f43206405019121bd2b2c93714319a0a3300 (patch)
tree1f48c30631c421fd4bbb3c36da20183c8a2ed7d7 /chromium/chrome/services/app_service
parent7961cea6d1041e3e454dae6a1da660b453efd238 (diff)
BASELINE: Update Chromium to 79.0.3945.139
Change-Id: I336b7182fab9bca80b709682489c07db112eaca5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/services/app_service')
-rw-r--r--chromium/chrome/services/app_service/BUILD.gn4
-rw-r--r--chromium/chrome/services/app_service/public/cpp/BUILD.gn12
-rw-r--r--chromium/chrome/services/app_service/public/mojom/BUILD.gn7
-rw-r--r--chromium/chrome/services/app_service/public/mojom/app_service.mojom62
-rw-r--r--chromium/chrome/services/app_service/public/mojom/constants.mojom7
-rw-r--r--chromium/chrome/services/app_service/public/mojom/types.mojom56
6 files changed, 117 insertions, 31 deletions
diff --git a/chromium/chrome/services/app_service/BUILD.gn b/chromium/chrome/services/app_service/BUILD.gn
index 7f129f27ff9..2b249e8792f 100644
--- a/chromium/chrome/services/app_service/BUILD.gn
+++ b/chromium/chrome/services/app_service/BUILD.gn
@@ -4,8 +4,6 @@
source_set("lib") {
sources = [
- "app_service.cc",
- "app_service.h",
"app_service_impl.cc",
"app_service_impl.h",
]
@@ -13,8 +11,6 @@ source_set("lib") {
deps = [
"//base",
"//mojo/public/cpp/bindings",
- "//services/preferences/public/cpp",
- "//services/service_manager/public/cpp",
]
public_deps = [
diff --git a/chromium/chrome/services/app_service/public/cpp/BUILD.gn b/chromium/chrome/services/app_service/public/cpp/BUILD.gn
index f31b9d580ff..52dfe5db20e 100644
--- a/chromium/chrome/services/app_service/public/cpp/BUILD.gn
+++ b/chromium/chrome/services/app_service/public/cpp/BUILD.gn
@@ -41,17 +41,18 @@ source_set("icon_loader_test_support") {
]
}
-source_set("manifest") {
+source_set("intents") {
sources = [
- "manifest.cc",
- "manifest.h",
+ "intent_filter_util.cc",
+ "intent_filter_util.h",
+ "intent_util.cc",
+ "intent_util.h",
]
deps = [
"//base",
"//chrome/services/app_service/public/mojom",
- "//services/preferences/public/mojom",
- "//services/service_manager/public/cpp",
+ "//components/services/app_service/public/cpp:intent_util",
]
}
@@ -63,6 +64,7 @@ source_set("unit_tests") {
"app_update_unittest.cc",
"icon_cache_unittest.cc",
"icon_coalescer_unittest.cc",
+ "intent_util_unittest.cc",
]
deps = [
diff --git a/chromium/chrome/services/app_service/public/mojom/BUILD.gn b/chromium/chrome/services/app_service/public/mojom/BUILD.gn
index e2a080ba170..39e16e73bd2 100644
--- a/chromium/chrome/services/app_service/public/mojom/BUILD.gn
+++ b/chromium/chrome/services/app_service/public/mojom/BUILD.gn
@@ -10,17 +10,10 @@ mojom("mojom") {
]
public_deps = [
- ":constants",
":types",
]
}
-mojom("constants") {
- sources = [
- "constants.mojom",
- ]
-}
-
mojom("types") {
sources = [
"types.mojom",
diff --git a/chromium/chrome/services/app_service/public/mojom/app_service.mojom b/chromium/chrome/services/app_service/public/mojom/app_service.mojom
index 20bc648f25d..42d9e955f5a 100644
--- a/chromium/chrome/services/app_service/public/mojom/app_service.mojom
+++ b/chromium/chrome/services/app_service/public/mojom/app_service.mojom
@@ -14,9 +14,13 @@ import "chrome/services/app_service/public/mojom/types.mojom";
//
// See chrome/services/app_service/README.md.
interface AppService {
- // App Registry methods.
- RegisterPublisher(Publisher publisher, AppType app_type);
- RegisterSubscriber(Subscriber subscriber, ConnectOptions? opts);
+ // Called by a publisher of apps to register itself and its apps with the App
+ // Service.
+ RegisterPublisher(pending_remote<Publisher> publisher, AppType app_type);
+
+ // Called by a consumer that wishes to know about available apps to register
+ // itself with the App Service.
+ RegisterSubscriber(pending_remote<Subscriber> subscriber, ConnectOptions? opts);
// App Icon Factory methods.
LoadIcon(
@@ -35,15 +39,37 @@ interface AppService {
LaunchSource launch_source,
int64 display_id);
+ // Launches an app with |app_id| and Chrome OS generic |intent| irrespective
+ // of app platform.
+ LaunchAppWithIntent(
+ AppType app_type,
+ string app_id,
+ Intent intent,
+ LaunchSource launch_source,
+ int64 display_id);
+
SetPermission(
AppType app_type,
string app_id,
Permission permission);
- Uninstall(
+ // Uninstall which invokes a specific dialog per app type. When the unified
+ // uninstall dialog is done, this interface will be removed.
+ PromptUninstall(
AppType app_type,
string app_id);
+ // Directly uninstalls |app_id| without prompting the user.
+ // |clear_site_data| is available for bookmark apps only. If true, any site
+ // data associated with the app will be removed..
+ // |report_abuse| is available for Chrome Apps only. If true, the app will be
+ // reported for abuse to the Web Store.
+ Uninstall(
+ AppType app_type,
+ string app_id,
+ bool clear_site_data,
+ bool report_abuse);
+
OpenNativeSettings(
AppType app_type,
string app_id);
@@ -51,7 +77,7 @@ interface AppService {
interface Publisher {
// App Registry methods.
- Connect(Subscriber subscriber, ConnectOptions? opts);
+ Connect(pending_remote<Subscriber> subscriber, ConnectOptions? opts);
// App Icon Factory methods.
LoadIcon(
@@ -68,13 +94,33 @@ interface Publisher {
LaunchSource launch_source,
int64 display_id);
+ // Launches an app with |app_id| and Chrome OS generic |intent| irrespective
+ // of app platform.
+ LaunchAppWithIntent(
+ string app_id,
+ Intent intent,
+ LaunchSource launch_source,
+ int64 display_id);
+
SetPermission(
string app_id,
Permission permission);
- Uninstall(
+ // Uninstall which invokes a specific dialog per app type. When the unified
+ // uninstall dialog is done, this interface will be removed.
+ PromptUninstall(
string app_id);
+ // Directly uninstalls |app_id| without prompting the user.
+ // |clear_site_data| is available for bookmark apps only. If true, any site
+ // data associated with the app will be removed..
+ // |report_abuse| is available for Chrome Apps only. If true, the app will be
+ // reported for abuse to the Web Store.
+ Uninstall(
+ string app_id,
+ bool clear_site_data,
+ bool report_abuse);
+
OpenNativeSettings(
string app_id);
};
@@ -82,11 +128,11 @@ interface Publisher {
interface Subscriber {
OnApps(array<App> deltas);
- // Binds this to the given request (message pipe endpoint), being to Mojo
+ // Binds this to the given receiver (message pipe endpoint), being to Mojo
// interfaces what POSIX's dup is to file descriptors.
//
// See https://groups.google.com/a/chromium.org/d/msg/chromium-mojo/nFhBzGsb5Pg/V7t_8kNRAgAJ
- Clone(Subscriber& request);
+ Clone(pending_receiver<Subscriber> receiver);
};
struct ConnectOptions {
diff --git a/chromium/chrome/services/app_service/public/mojom/constants.mojom b/chromium/chrome/services/app_service/public/mojom/constants.mojom
deleted file mode 100644
index 388c17b7099..00000000000
--- a/chromium/chrome/services/app_service/public/mojom/constants.mojom
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-module apps.mojom;
-
-const string kServiceName = "apps";
diff --git a/chromium/chrome/services/app_service/public/mojom/types.mojom b/chromium/chrome/services/app_service/public/mojom/types.mojom
index e292ea64c34..7479619237e 100644
--- a/chromium/chrome/services/app_service/public/mojom/types.mojom
+++ b/chromium/chrome/services/app_service/public/mojom/types.mojom
@@ -46,6 +46,11 @@ struct App {
OptionalBool show_in_search;
OptionalBool show_in_management;
+ // This vector stores all the intent filters defined in this app. Each
+ // intent filter defines a matching criteria for whether an intent can
+ // be handled by this app. One app can have multiple intent filters.
+ array<IntentFilter> intent_filters;
+
// When adding new fields, also update the Merge method and other helpers in
// chrome/services/app_service/public/cpp/app_update.*
};
@@ -156,6 +161,10 @@ enum LaunchSource {
kFromAppListQueryContextMenu, // Query-dependent results; context menu.
kFromAppListRecommendation, // Query-less recommendations (smaller icons).
kFromParentalControls, // Parental Controls Settings Section.
+ kFromShelf, // Shelf.
+ kFromFileManager, // FileManager.
+ kFromLink, // Left-licking on links in the browser.
+ kFromOmnibox, // Enter URL in the Omnibox in the browser.
};
enum TriState {
@@ -168,3 +177,50 @@ enum PermissionValueType {
kBool, // Permission.value is a Bool (either 0 or 1).
kTriState, // Permission.value is a TriState.
};
+
+// The intent filter matching condition types.
+enum ConditionType {
+ kScheme, // Matches the URL scheme (e.g. https, tel).
+ kHost, // Matches the URL host (e.g. www.google.com).
+ kPattern, // Matches the URL pattern (e.g. /abc/*).
+};
+
+// The pattern match type for intent filter pattern condition.
+enum PatternMatchType {
+ kNone = 0,
+ kLiteral,
+ kPrefix,
+ kGlob,
+};
+
+// For pattern type of condition, the value match will be based on the pattern
+// match type. If the match_type is kNone, then an exact match with the value
+// will be required.
+struct ConditionValue {
+ string value;
+ PatternMatchType match_type; // This will be None for non pattern conditions.
+};
+
+// The condition for an intent filter. It matches if the intent contains this
+// condition type and the corresponding value matches with any of the
+// condition_values.
+struct Condition {
+ ConditionType condition_type;
+ array<ConditionValue> condition_values;
+};
+
+// An intent filter is defined by an app, and contains a list of conditions that
+// an intent needs to match. If all conditions match, then this intent filter
+// matches against an intent.
+struct IntentFilter {
+ array<Condition> conditions;
+};
+
+// Action and resource handling request. This includes the scheme and URL at
+// the moment, and will be extended to handle MIME type and file extensions in
+// the future.
+struct Intent {
+ string? scheme; // URL scheme. e.g. https.
+ string? host; // URL host. e.g. www.google.com.
+ string? path; // URL path. e.g. /abc.
+};