mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 85.0.4165.1 * chore: bump chromium in DEPS to 85.0.4166.1 * chore: bump chromium in DEPS to 85.0.4166.2 * chore: bump chromium in DEPS to 85.0.4166.3 * update patches * fixup! Revert "[printing] Mojofy PrintHostMsg_CheckForCancel" (cherry picked from commit 2cc1caf5d7d716ceefb23d5228a79544a2e91206) * update patches * Revert "[printing] Mojofy PrintHostMsg_CheckForCancel" (cherry picked from commit c2b389957836ad77eb8e977872e6a8590666f3da) * Remove WebImeTextSpan https://chromium-review.googlesource.com/c/chromium/src/+/2225240 (cherry picked from commit d839261d71b156c972d3878f16f971e6b6d98f45) * Remove PDFAnnotations flag altogether. https://chromium-review.googlesource.com/c/chromium/src/+/2229317 (cherry picked from commit 50384ed12602d4a9da3209eacfca4faae78f9986) * Rework find-from-selection so it's synchronous -- fixes flaky tests https://chromium-review.googlesource.com/c/chromium/src/+/2181570 (cherry picked from commit 3e9241560390fb18969393beda425afc63f5a151) * Use ExtensionSystem::is_ready() instead of ExtensionService::is_ready() https://chromium-review.googlesource.com/c/chromium/src/+/2207499 (cherry picked from commit 2424589454a9a2ef9cc89c232b4ee87b0bf400cc) * update sysroots (cherry picked from commit b5ea653e602152dde00303d1cfb915d4df320983) * chore: bump chromium in DEPS to 85.0.4167.1 * Take RFH as a parameter for DidUpdateFavicon/ManifestURL https://chromium-review.googlesource.com/c/chromium/src/+/2224745 (cherry picked from commit ad40668221732e28bcc8b9b270ab4686c42e956a) * update patches * update patches * Rename net::cookie_util::StripStatuses to StripAccessResults https://chromium-review.googlesource.com/c/chromium/src/+/2212697 (cherry picked from commit bf3de1fe1cbb17feb46b40c81f0eb13b1e7b6412) * use net::CookieAccessResultList instead of net::CookieAccessResultList (cherry picked from commit 400da79504da2310b7c1177b4b3f9f83a3f2b305) * chore: bump chromium in DEPS to 85.0.4168.1 * fix mas_no_private_api patch https://chromium-review.googlesource.com/c/chromium/src/+/2230281 (cherry picked from commit 9b127147e0ba7ef1d4454099effe49327b1a5ab6) * Update patches * fix: add new navigation state REUSE_SITE_INSTANCE To fix the new set of state checks added in https://chromium-review.googlesource.com/c/chromium/src/+/2215141 (cherry picked from commit 3a91b684efdc7742e7c5efa65263f80e8a24ec4a) * chore: bump chromium in DEPS to 85.0.4169.1 * update patches * chore: bump chromium in DEPS to 85.0.4170.1 * chore: bump chromium in DEPS to 85.0.4171.1 * chore: bump chromium in DEPS to 85.0.4172.1 * chore: bump chromium in DEPS to 85.0.4173.1 * chore: bump chromium in DEPS to 85.0.4174.1 * chore: bump chromium in DEPS to 85.0.4175.3 * chore: bump chromium in DEPS to 85.0.4176.1 * chore: bump chromium in DEPS to 85.0.4177.2 * chore: bump chromium in DEPS to 85.0.4178.1 * chore: bump chromium in DEPS to 85.0.4178.3 * refactor: MessageLoop, you are terminated \o/ Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2246173 (cherry picked from commit0368131d60) * chore: bump chromium in DEPS to 85.0.4178.4 * update patches * update lib_src_switch_buffer_kmaxlength_to_size_t.patch (cherry picked from commitc5efbdd166) * [v8] Allow for 4GB TypedArrays https: //chromium-review.googlesource.com/c/v8/v8/+/2249668 (cherry picked from commit2c1d6bfd9d) Co-Authored-By: Robo <hop2deep@gmail.com> * Cleanup usages of old mojo types and remove unused code https://chromium-review.googlesource.com/c/chromium/src/+/2235699 (cherry picked from commite89cb21e8e) * refactor: plumb DownloadSchedule to DownloadItem Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2242202 (cherry picked from commit4d549ae2b0) * chore: fix variable typo in IPC (cherry picked from commit7251b1e6c5) * chore: s/BindPipeAndPassReceiver/BindNewPipeAndPassReceiver (cherry picked from commite89bd6c639) * chore: XEvent becomes x11::Event Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2240355 (cherry picked from commit4d832da740) * fixup! refactor: MessageLoop, you are terminated \o/ (cherry picked from commit902d72d740) * fixup! chore: XEvent becomes x11::Event (cherry picked from commit27043549f3) * chore: fix windows build (cherry picked from commit4977098eb3) * chore: disable SameSite-by-default changes https://chromium-review.googlesource.com/c/chromium/src/+/2231445 (cherry picked from commitd8318aafff) * update printing.patch (cherry picked from commite2037f527f) * Convert WidgetHostMsg_SelectionBoundsChanged/TextInputStateChanged https://chromium-review.googlesource.com/c/chromium/src/+/2243531 (cherry picked from commit60ff2e067d) * [XProto] Replace usages of XID and ::Window with x11::Window https://chromium-review.googlesource.com/c/chromium/src/+/2249389 (cherry picked from commit97f5b59e06) * Update VideoFrameMetadata to use base::Optionals https://chromium-review.googlesource.com/c/chromium/src/+/2231706 https://chromium-review.googlesource.com/c/chromium/src/+/2238361 (cherry picked from commit4787e1f541) * --disable-dev-shm-usage for gpu process crash (cherry picked from commit207d8a380a) * update patches * fixup: Cleanup usages of old mojo types and remove unused code * update patches * chore: bump chromium in DEPS to 85.0.4180.1 * build: update v8 headers (cherry picked from commit4808975f75) * Update patches * fixup: build: update v8 headers * Fixup ssl_security_state_tab_helper.patch * Add missing headers * Adds icon loading service with sandbox for Windows. https://chromium-review.googlesource.com/c/chromium/src/+/1987273 * disable app.getGPUInfo spec on linux (cherry picked from commitb7ea16c4b7) * Add missing headers for Linux and Windows * Fixup Adds icon loading service with sandbox for Windows * chore: bump chromium in DEPS to 85.0.4181.1 * update patches * Fixup: (for real) Adds icon loading service with sandbox for Windows * No more Vulkan info collection for UMA on Windows https://chromium-review.googlesource.com/c/chromium/src/+/2252818 * extensions: Rename SharedUserScriptMaster to SharedUserScriptManager https://chromium-review.googlesource.com/c/chromium/src/+/2258357 * Add missing headers * fixup: extensions: Rename SharedUserScriptMaster to SharedUserScriptManager * fixup: No more Vulkan info collection for UMA on Windows * Add missing header * Add resource for IDS_UTILITY_PROCESS_UTILITY_WIN_NAME * fix build on windows * fix gn check Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Electron Bot <anonymous@electronjs.org> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
115 lines
3.3 KiB
C++
115 lines
3.3 KiB
C++
// Copyright (c) 2013 GitHub, Inc.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "shell/common/application_info.h"
|
|
|
|
#include <windows.h> // windows.h must be included first
|
|
|
|
#include <VersionHelpers.h>
|
|
#include <appmodel.h>
|
|
#include <shlobj.h>
|
|
|
|
#include <memory>
|
|
|
|
#include "base/file_version_info.h"
|
|
#include "base/notreached.h"
|
|
#include "base/strings/string_util.h"
|
|
#include "base/strings/stringprintf.h"
|
|
#include "base/strings/utf_string_conversions.h"
|
|
#include "shell/browser/win/scoped_hstring.h"
|
|
|
|
namespace electron {
|
|
|
|
namespace {
|
|
|
|
base::string16 g_app_user_model_id;
|
|
}
|
|
|
|
const wchar_t kAppUserModelIDFormat[] = L"electron.app.$1";
|
|
|
|
std::string GetApplicationName() {
|
|
auto* module = GetModuleHandle(nullptr);
|
|
std::unique_ptr<FileVersionInfo> info(
|
|
FileVersionInfo::CreateFileVersionInfoForModule(module));
|
|
return base::UTF16ToUTF8(info->product_name());
|
|
}
|
|
|
|
std::string GetApplicationVersion() {
|
|
auto* module = GetModuleHandle(nullptr);
|
|
std::unique_ptr<FileVersionInfo> info(
|
|
FileVersionInfo::CreateFileVersionInfoForModule(module));
|
|
return base::UTF16ToUTF8(info->product_version());
|
|
}
|
|
|
|
void SetAppUserModelID(const base::string16& name) {
|
|
g_app_user_model_id = name;
|
|
SetCurrentProcessExplicitAppUserModelID(g_app_user_model_id.c_str());
|
|
}
|
|
|
|
PCWSTR GetRawAppUserModelID() {
|
|
if (g_app_user_model_id.empty()) {
|
|
PWSTR current_app_id;
|
|
if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(¤t_app_id))) {
|
|
g_app_user_model_id = current_app_id;
|
|
} else {
|
|
std::string name = GetApplicationName();
|
|
base::string16 generated_app_id = base::ReplaceStringPlaceholders(
|
|
kAppUserModelIDFormat, base::UTF8ToUTF16(name), nullptr);
|
|
SetAppUserModelID(generated_app_id);
|
|
}
|
|
CoTaskMemFree(current_app_id);
|
|
}
|
|
|
|
return g_app_user_model_id.c_str();
|
|
}
|
|
|
|
bool GetAppUserModelID(ScopedHString* app_id) {
|
|
app_id->Reset(GetRawAppUserModelID());
|
|
return app_id->success();
|
|
}
|
|
|
|
bool IsRunningInDesktopBridgeImpl() {
|
|
if (IsWindows8OrGreater()) {
|
|
// GetPackageFamilyName is not available on Windows 7
|
|
using GetPackageFamilyNameFuncPtr = decltype(&GetPackageFamilyName);
|
|
|
|
static bool initialize_get_package_family_name = true;
|
|
static GetPackageFamilyNameFuncPtr get_package_family_namePtr = NULL;
|
|
|
|
if (initialize_get_package_family_name) {
|
|
initialize_get_package_family_name = false;
|
|
HMODULE kernel32_base = GetModuleHandle(L"Kernel32.dll");
|
|
if (!kernel32_base) {
|
|
NOTREACHED() << " " << __FUNCTION__ << "(): Can't open Kernel32.dll";
|
|
return false;
|
|
}
|
|
|
|
get_package_family_namePtr =
|
|
reinterpret_cast<GetPackageFamilyNameFuncPtr>(
|
|
GetProcAddress(kernel32_base, "GetPackageFamilyName"));
|
|
|
|
if (!get_package_family_namePtr) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
UINT32 length = PACKAGE_FAMILY_NAME_MAX_LENGTH;
|
|
wchar_t packageFamilyName[PACKAGE_FAMILY_NAME_MAX_LENGTH];
|
|
HANDLE proc = GetCurrentProcess();
|
|
LONG result =
|
|
(*get_package_family_namePtr)(proc, &length, packageFamilyName);
|
|
|
|
return result == ERROR_SUCCESS;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
bool IsRunningInDesktopBridge() {
|
|
static bool result = IsRunningInDesktopBridgeImpl();
|
|
return result;
|
|
}
|
|
|
|
} // namespace electron
|