Commit f3cf6cd4 authored by mgiuca's avatar mgiuca Committed by Commit bot

Remove --enable-apps-file-associations flag.

The flag was for an old feature that was never launched. Removes the
code behind this feature.

BUG=540055

Review-Url: https://codereview.chromium.org/2621833003
Cr-Commit-Position: refs/heads/master@{#442763}
parent bff54a24
......@@ -6739,12 +6739,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
Use bleeding-edge code to make Chrome draw content faster. The changes
behind this path are very likely to break lots of content.
</message>
<message name="IDS_FLAGS_APPS_FILE_ASSOCIATIONS_NAME" desc="Name for file associations for Chrome Apps.">
Apps file associations
</message>
<message name="IDS_FLAGS_APPS_FILE_ASSOCIATIONS_DESCRIPTION" desc="Description for a flag to enable file associations for Chrome Apps.">
Enable OS integration of file associations for Chrome Apps.
</message>
<message name="IDS_FLAGS_HARFBUZZ_RENDERTEXT_NAME" desc="Name of the about:flags HarfBuzz RenderText experiment.">
HarfBuzz for UI text
</message>
......@@ -1407,9 +1407,6 @@ const FeatureEntry kFeatureEntries[] = {
{"inert-visual-viewport", IDS_FLAGS_INERT_VISUAL_VIEWPORT_NAME,
IDS_FLAGS_INERT_VISUAL_VIEWPORT_DESCRIPTION, kOsAll,
SINGLE_VALUE_TYPE(switches::kInertVisualViewport)},
{"enable-apps-file-associations", IDS_FLAGS_APPS_FILE_ASSOCIATIONS_NAME,
IDS_FLAGS_APPS_FILE_ASSOCIATIONS_DESCRIPTION, kOsMac,
SINGLE_VALUE_TYPE(switches::kEnableAppsFileAssociations)},
{"distance-field-text", IDS_FLAGS_DISTANCE_FIELD_TEXT_NAME,
IDS_FLAGS_DISTANCE_FIELD_TEXT_DESCRIPTION, kOsAll,
ENABLE_DISABLE_VALUE_TYPE(switches::kEnableDistanceFieldText,
......
......@@ -528,49 +528,6 @@ std::unique_ptr<web_app::ShortcutInfo> RecordAppShimErrorAndBuildShortcutInfo(
return BuildShortcutInfoFromBundle(bundle_path);
}
void UpdateFileTypes(NSMutableDictionary* plist,
const extensions::FileHandlersInfo& file_handlers_info) {
NSMutableArray* document_types =
[NSMutableArray arrayWithCapacity:file_handlers_info.size()];
for (extensions::FileHandlersInfo::const_iterator info_it =
file_handlers_info.begin();
info_it != file_handlers_info.end();
++info_it) {
const extensions::FileHandlerInfo& info = *info_it;
NSMutableArray* file_extensions =
[NSMutableArray arrayWithCapacity:info.extensions.size()];
for (std::set<std::string>::iterator it = info.extensions.begin();
it != info.extensions.end();
++it) {
[file_extensions addObject:base::SysUTF8ToNSString(*it)];
}
NSMutableArray* mime_types =
[NSMutableArray arrayWithCapacity:info.types.size()];
for (std::set<std::string>::iterator it = info.types.begin();
it != info.types.end();
++it) {
[mime_types addObject:base::SysUTF8ToNSString(*it)];
}
NSDictionary* type_dictionary = @{
// TODO(jackhou): Add the type name and and icon file once the manifest
// supports these.
// app_mode::kCFBundleTypeNameKey : ,
// app_mode::kCFBundleTypeIconFileKey : ,
app_mode::kCFBundleTypeExtensionsKey : file_extensions,
app_mode::kCFBundleTypeMIMETypesKey : mime_types,
app_mode::kCFBundleTypeRoleKey : app_mode::kBundleTypeRoleViewer
};
[document_types addObject:type_dictionary];
}
[plist setObject:document_types
forKey:app_mode::kCFBundleDocumentTypesKey];
}
void RevealAppShimInFinderForAppOnFileThread(
std::unique_ptr<web_app::ShortcutInfo> shortcut_info,
const base::FilePath& app_path) {
......@@ -892,11 +849,6 @@ bool WebAppShortcutCreator::UpdatePlist(const base::FilePath& app_path) const {
[plist setObject:base::mac::FilePathToNSString(app_name)
forKey:base::mac::CFToNSCast(kCFBundleNameKey)];
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableAppsFileAssociations)) {
UpdateFileTypes(plist, file_handlers_info_);
}
return [plist writeToFile:plist_path
atomically:YES];
}
......
......@@ -344,56 +344,4 @@ TEST_F(WebAppShortcutCreatorTest, RevealAppShimInFinder) {
SHORTCUT_CREATION_BY_USER, web_app::ShortcutLocations()));
}
TEST_F(WebAppShortcutCreatorTest, FileHandlers) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableAppsFileAssociations);
extensions::FileHandlersInfo file_handlers_info;
extensions::FileHandlerInfo handler_0;
handler_0.extensions.insert("ext0");
handler_0.extensions.insert("ext1");
handler_0.types.insert("type0");
handler_0.types.insert("type1");
file_handlers_info.push_back(handler_0);
extensions::FileHandlerInfo handler_1;
handler_1.extensions.insert("ext2");
handler_1.types.insert("type2");
file_handlers_info.push_back(handler_1);
NiceMock<WebAppShortcutCreatorMock> shortcut_creator(
app_data_dir_, info_.get(), file_handlers_info);
EXPECT_CALL(shortcut_creator, GetApplicationsDirname())
.WillRepeatedly(Return(destination_dir_));
EXPECT_TRUE(shortcut_creator.CreateShortcuts(
SHORTCUT_CREATION_AUTOMATED, web_app::ShortcutLocations()));
base::FilePath plist_path =
shim_path_.Append("Contents").Append("Info.plist");
NSDictionary* plist = [NSDictionary
dictionaryWithContentsOfFile:base::mac::FilePathToNSString(plist_path)];
NSArray* file_handlers =
[plist objectForKey:app_mode::kCFBundleDocumentTypesKey];
NSDictionary* file_handler_0 = [file_handlers objectAtIndex:0];
EXPECT_NSEQ(app_mode::kBundleTypeRoleViewer,
[file_handler_0 objectForKey:app_mode::kCFBundleTypeRoleKey]);
NSArray* file_handler_0_extensions =
[file_handler_0 objectForKey:app_mode::kCFBundleTypeExtensionsKey];
EXPECT_TRUE([file_handler_0_extensions containsObject:@"ext0"]);
EXPECT_TRUE([file_handler_0_extensions containsObject:@"ext1"]);
NSArray* file_handler_0_types =
[file_handler_0 objectForKey:app_mode::kCFBundleTypeMIMETypesKey];
EXPECT_TRUE([file_handler_0_types containsObject:@"type0"]);
EXPECT_TRUE([file_handler_0_types containsObject:@"type1"]);
NSDictionary* file_handler_1 = [file_handlers objectAtIndex:1];
EXPECT_NSEQ(app_mode::kBundleTypeRoleViewer,
[file_handler_1 objectForKey:app_mode::kCFBundleTypeRoleKey]);
NSArray* file_handler_1_extensions =
[file_handler_1 objectForKey:app_mode::kCFBundleTypeExtensionsKey];
EXPECT_TRUE([file_handler_1_extensions containsObject:@"ext2"]);
NSArray* file_handler_1_types =
[file_handler_1 objectForKey:app_mode::kCFBundleTypeMIMETypesKey];
EXPECT_TRUE([file_handler_1_types containsObject:@"type2"]);
}
} // namespace web_app
......@@ -311,9 +311,6 @@ const char kEasyUnlockAppPath[] = "easy-unlock-app-path";
// app to their shelf (or platform-specific equivalent)
const char kEnableAddToShelf[] = "enable-add-to-shelf";
// Enable OS integration for Chrome app file associations.
const char kEnableAppsFileAssociations[] = "enable-apps-file-associations";
// If the WebRTC logging private API is active, enables audio debug recordings.
const char kEnableAudioDebugRecordingsFromExtension[] =
"enable-audio-debug-recordings-from-extension";
......
......@@ -103,7 +103,6 @@ extern const char kDnsLogDetails[];
extern const char kDumpBrowserHistograms[];
extern const char kEasyUnlockAppPath[];
extern const char kEnableAddToShelf[];
extern const char kEnableAppsFileAssociations[];
extern const char kEnableAudioDebugRecordingsFromExtension[];
extern const char kEnableBenchmarking[];
extern const char kEnableBookmarkUndo[];
......
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