Commit 0f41a95a authored by Jay Harris's avatar Jay Harris Committed by Commit Bot

WebApps: Set OsSupportsWebAppFileHandling() to true on Chrome OS.

This makes file handling paths more consistent across different operating
systems we support file handling on. The intention is to make the logic for
enabling/disabling file handling for PWAs as similar as possible, which should
simplify the logic we need to implement for origin trials.

Bug: 1028448
Change-Id: I3ca522bc804e1bded96f070c2d0775a1600b12b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935296
Commit-Queue: Jay Harris <harrisjay@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719480}
parent a5730c82
...@@ -79,7 +79,10 @@ source_set("components") { ...@@ -79,7 +79,10 @@ source_set("components") {
] ]
if (is_chromeos) { if (is_chromeos) {
sources += [ "web_app_shortcut_chromeos.cc" ] sources += [
"web_app_file_handler_registration_chromeos.cc",
"web_app_shortcut_chromeos.cc",
]
} }
if (is_desktop_linux) { if (is_desktop_linux) {
......
...@@ -10,12 +10,11 @@ ...@@ -10,12 +10,11 @@
namespace web_app { namespace web_app {
// This block defines stub implementations of OS specific methods for // This block defines stub implementations of OS specific methods for
// FileHandling. Currently, Windows and Desktop Linux (but not Chrome OS) have // FileHandling. Currently, Windows and Desktop Linux and Chrome OS have
// their own implementations. // their own implementations.
// //
// Note: Because OS_LINUX includes OS_CHROMEOS be sure to use the stub on // Note: OS_LINUX includes OS_CHROMEOS
// OS_CHROMEOS. #if !defined(OS_WIN) && !defined(OS_LINUX)
#if !defined(OS_WIN) && !(defined(OS_LINUX) && !defined(OS_CHROMEOS))
bool OsSupportsWebAppFileHandling() { bool OsSupportsWebAppFileHandling() {
return false; return false;
} }
......
...@@ -20,6 +20,8 @@ bool OsSupportsWebAppFileHandling(); ...@@ -20,6 +20,8 @@ bool OsSupportsWebAppFileHandling();
// Do OS-specific registration to handle opening files with the specified // Do OS-specific registration to handle opening files with the specified
// |file_extensions| and |mime_types| with the PWA with the specified |app_id|. // |file_extensions| and |mime_types| with the PWA with the specified |app_id|.
// This may also involve creating a shim app to launch Chrome from. // This may also involve creating a shim app to launch Chrome from.
// Note: Some operating systems (such as Chrome OS) may not need to do any work
// here.
void RegisterFileHandlersForWebApp(const AppId& app_id, void RegisterFileHandlersForWebApp(const AppId& app_id,
const std::string& app_name, const std::string& app_name,
Profile* profile, Profile* profile,
......
// Copyright 2019 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.
#include "chrome/browser/web_applications/components/web_app_file_handler_registration.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "chrome/browser/web_applications/components/app_shortcut_manager.h"
#include "chrome/browser/web_applications/components/web_app_provider_base.h"
#include "chrome/browser/web_applications/components/web_app_shortcut.h"
namespace web_app {
bool OsSupportsWebAppFileHandling() {
return true;
}
void RegisterFileHandlersForWebApp(const AppId& app_id,
const std::string& app_name,
Profile* profile,
const std::set<std::string>& file_extensions,
const std::set<std::string>& mime_types) {
// ChromeOS talks directly to FileHandlerManager for file handler
// registrations.
}
void UnregisterFileHandlersForWebApp(const AppId& app_id, Profile* profile) {
// ChromeOS talks directly to FileHandlerManager for file handler
// registrations.
}
} // namespace web_app
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment