Files
brave-core/installer/util/brave_shell_util.cc
T
Simon Hong 63b23efb43 Use different icon for some file types
fix https://github.com/brave/brave-browser/issues/12761

When brave browser is set as a default application,
different icon will be used for that file type.
Currently, .pdf and .svg files will have different icon.

So far, we set BraveBHTML (beta) prog id for supported file types in
registry.
and that BraveBHTML entry has some attributes such as default icon or
commands. That default icon is used for the file type when browser
is set as its default application. default icon of BraveBHTML reg entry
is brave browser's default icon.
Because of this, all file types uses same icon.

This PR introduces new BraveFile prog entry and it uses different icon.
And, new BraveFile id is set for some file types when brave is its
default application.
2021-06-18 10:53:40 +09:00

35 lines
1016 B
C++

/* Copyright (c) 2021 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "brave/installer/util/brave_shell_util.h"
#include "base/notreached.h"
#include "chrome/install_static/install_util.h"
#include "components/version_info/channel.h"
namespace installer {
std::wstring GetProgIdForFileType() {
switch (install_static::GetChromeChannel()) {
case version_info::Channel::STABLE:
return L"BraveFile";
case version_info::Channel::BETA:
return L"BraveBFile";
case version_info::Channel::DEV:
return L"BraveDFile";
case version_info::Channel::CANARY:
return L"BraveSSFile";
default:
NOTREACHED();
return L"BraveFile";
}
}
bool ShouldUseFileTypeProgId(const std::wstring& ext) {
return (ext == L".pdf" || ext == L".svg");
}
} // namespace installer