chore: bump chromium to 116.0.5817.0 (main) (#38465)
* chore: bump chromium in DEPS to 116.0.5793.3 * chore: update patches * chore: bump chromium in DEPS to 116.0.5795.0 * chore: update patches * chore: bump chromium in DEPS to 116.0.5797.0 * chore: update patches * chore: bump chromium in DEPS to 116.0.5799.0 * 4522192: [serial] Allow Bluetooth ports to be requested by service class ID. |4522192
* 4545385: Create base:🍎:Owned[frameworktype], use it for gfx::NativeEvent |4545385
* chore: bump chromium in DEPS to 116.0.5801.0 * chore: update patches * 4562796: Use base:🍎:Owned[frameworktype] for ui::PlatformEvent |4562796
* 4559790: Manual raw_ptr rewrite: //base |4559790
* chore: bump chromium in DEPS to 116.0.5803.0 * chore: update patches * chore: bump chromium in DEPS to 116.0.5805.2 * chore: update patches * 4547630: Move content/public/common/network_service_util.h to c/p/browser/ |4547630
* 4510075: Adding extensions to network response experiment |4510075
* 4566552: Auto-generate grd file for chrome://accessibility. |4566552
* chore: bump chromium in DEPS to 116.0.5807.0 * chore: update patches * 4533536: [Privacy Hub] Geolocation manager used directly |4533536
* chore: patch out ARC support from /chrome/browser 4571955: Convert /chrome/browser to use ARC |4571955
* chore: bump chromium in DEPS to 116.0.5809.2 * chore: bump chromium in DEPS to 116.0.5811.0 * chore: update patches * 4573627: Adopt base::NoDestructor for KeyedService factories |4573627
* 4576878: Reland "Shared Storage: Add mojo method for observing response headers" |4576878
* chore: bump chromium in DEPS to 116.0.5813.0 * chore: update patches * fixup! 4566552: Auto-generate grd file for chrome://accessibility. |4566552
* chore: fix up lint * test: (debug) use Promise.all in asan tests * chore: manually roll DEPS to 116.0.5815.0 * chore: update patches * 4585150: Convert /printing to use ARC |4585150
* test: (asan) extend timeout, clean up debugging * chore: remove ARC chromium patch * chore: update patches after main sync * 4546398: Convert /chrome/browser to use ARC |4546398
* build: add chrome_lib_arc for chromium_src/BUILD.gn sources * fixup! 4559790: Manual raw_ptr rewrite: //base |4559790
--------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
This commit is contained in:
parent
a3448376a1
commit
fd5e6fbc14
102 changed files with 459 additions and 469 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "base/at_exit.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/i18n/icu_util.h"
|
||||
#include "base/memory/raw_ptr_exclusion.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/win/dark_mode_support.h"
|
||||
|
@ -128,7 +129,8 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
|||
|
||||
struct Arguments {
|
||||
int argc = 0;
|
||||
wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
|
||||
RAW_PTR_EXCLUSION wchar_t** argv =
|
||||
::CommandLineToArgvW(::GetCommandLineW(), &argc);
|
||||
|
||||
~Arguments() { LocalFree(argv); }
|
||||
} arguments;
|
||||
|
|
|
@ -469,6 +469,13 @@ void SimpleURLLoaderWrapper::OnLoadingStateUpdate(
|
|||
std::move(callback).Run();
|
||||
}
|
||||
|
||||
void SimpleURLLoaderWrapper::OnSharedStorageHeaderReceived(
|
||||
const url::Origin& request_origin,
|
||||
std::vector<network::mojom::SharedStorageOperationPtr> operations,
|
||||
OnSharedStorageHeaderReceivedCallback callback) {
|
||||
std::move(callback).Run();
|
||||
}
|
||||
|
||||
void SimpleURLLoaderWrapper::Clone(
|
||||
mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver>
|
||||
observer) {
|
||||
|
|
|
@ -99,6 +99,10 @@ class SimpleURLLoaderWrapper
|
|||
OnClearSiteDataCallback callback) override;
|
||||
void OnLoadingStateUpdate(network::mojom::LoadInfoPtr info,
|
||||
OnLoadingStateUpdateCallback callback) override;
|
||||
void OnSharedStorageHeaderReceived(
|
||||
const url::Origin& request_origin,
|
||||
std::vector<network::mojom::SharedStorageOperationPtr> operations,
|
||||
OnSharedStorageHeaderReceivedCallback callback) override;
|
||||
void OnDataUseUpdate(int32_t network_traffic_annotation_id_hash,
|
||||
int64_t recv_bytes,
|
||||
int64_t sent_bytes) override {}
|
||||
|
|
|
@ -53,8 +53,9 @@ bool WebContents::PlatformHandleKeyboardEvent(
|
|||
if (web_preferences && web_preferences->ShouldIgnoreMenuShortcuts())
|
||||
return false;
|
||||
|
||||
NSEvent* ns_event = event.os_event.Get();
|
||||
// Send the event to the menu before sending it to the window
|
||||
if (event.os_event.type == NSEventTypeKeyDown) {
|
||||
if (ns_event.type == NSEventTypeKeyDown) {
|
||||
// If the keyboard event is a system shortcut, it's already sent to the
|
||||
// NSMenu instance in
|
||||
// content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm via
|
||||
|
@ -62,33 +63,32 @@ bool WebContents::PlatformHandleKeyboardEvent(
|
|||
// NSMenu handle it here as well, it'll be sent twice with unexpected side
|
||||
// effects.
|
||||
bool is_a_keyboard_shortcut_event =
|
||||
[[NSApp mainMenu] cr_menuItemForKeyEquivalentEvent:event.os_event] !=
|
||||
nil;
|
||||
[[NSApp mainMenu] cr_menuItemForKeyEquivalentEvent:ns_event] != nil;
|
||||
bool is_a_system_shortcut_event =
|
||||
is_a_keyboard_shortcut_event &&
|
||||
(ui::cocoa::ModifierMaskForKeyEvent(event.os_event) &
|
||||
(ui::cocoa::ModifierMaskForKeyEvent(ns_event) &
|
||||
NSEventModifierFlagFunction) != 0;
|
||||
if (is_a_system_shortcut_event)
|
||||
return false;
|
||||
|
||||
if ([[NSApp mainMenu] performKeyEquivalent:event.os_event])
|
||||
if ([[NSApp mainMenu] performKeyEquivalent:ns_event])
|
||||
return true;
|
||||
}
|
||||
|
||||
// Let the window redispatch the OS event
|
||||
if (event.os_event.window &&
|
||||
[event.os_event.window isKindOfClass:[EventDispatchingWindow class]]) {
|
||||
[event.os_event.window redispatchKeyEvent:event.os_event];
|
||||
if (ns_event.window &&
|
||||
[ns_event.window isKindOfClass:[EventDispatchingWindow class]]) {
|
||||
[ns_event.window redispatchKeyEvent:ns_event];
|
||||
// FIXME(nornagon): this isn't the right return value; we should implement
|
||||
// devtools windows as Widgets in order to take advantage of the
|
||||
// preexisting redispatch code in bridged_native_widget.
|
||||
return false;
|
||||
} else if (event.os_event.window &&
|
||||
[event.os_event.window
|
||||
} else if (ns_event.window &&
|
||||
[ns_event.window
|
||||
conformsToProtocol:@protocol(CommandDispatchingWindow)]) {
|
||||
NSObject<CommandDispatchingWindow>* window =
|
||||
static_cast<NSObject<CommandDispatchingWindow>*>(event.os_event.window);
|
||||
[[window commandDispatcher] redispatchKeyEvent:event.os_event];
|
||||
static_cast<NSObject<CommandDispatchingWindow>*>(ns_event.window);
|
||||
[[window commandDispatcher] redispatchKeyEvent:ns_event];
|
||||
// FIXME(clavin): Not exactly sure what to return here, likely the same
|
||||
// situation as the branch above. If a future refactor removes
|
||||
// |EventDispatchingWindow| then only this branch will need to remain.
|
||||
|
|
|
@ -331,15 +331,6 @@ StartupData* BrowserProcessImpl::startup_data() {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
device::GeolocationManager* BrowserProcessImpl::geolocation_manager() {
|
||||
return geolocation_manager_.get();
|
||||
}
|
||||
|
||||
void BrowserProcessImpl::SetGeolocationManager(
|
||||
std::unique_ptr<device::GeolocationManager> geolocation_manager) {
|
||||
geolocation_manager_ = std::move(geolocation_manager);
|
||||
}
|
||||
|
||||
network::NetworkQualityTracker* BrowserProcessImpl::GetNetworkQualityTracker() {
|
||||
if (!network_quality_tracker_) {
|
||||
network_quality_tracker_ = std::make_unique<network::NetworkQualityTracker>(
|
||||
|
|
|
@ -110,9 +110,6 @@ class BrowserProcessImpl : public BrowserProcess {
|
|||
const std::string& GetApplicationLocale() override;
|
||||
printing::PrintJobManager* print_job_manager() override;
|
||||
StartupData* startup_data() override;
|
||||
device::GeolocationManager* geolocation_manager() override;
|
||||
void SetGeolocationManager(
|
||||
std::unique_ptr<device::GeolocationManager> geolocation_manager) override;
|
||||
|
||||
private:
|
||||
void CreateNetworkQualityObserver();
|
||||
|
@ -122,7 +119,6 @@ class BrowserProcessImpl : public BrowserProcess {
|
|||
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
|
||||
#endif
|
||||
std::unique_ptr<PrefService> local_state_;
|
||||
std::unique_ptr<device::GeolocationManager> geolocation_manager_;
|
||||
std::string locale_;
|
||||
std::string system_locale_;
|
||||
embedder_support::OriginTrialsSettingsStorage origin_trials_settings_storage_;
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
#include "ppapi/buildflags/buildflags.h"
|
||||
#include "ppapi/host/ppapi_host.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "services/device/public/cpp/geolocation/geolocation_manager.h"
|
||||
#include "services/device/public/cpp/geolocation/location_provider.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/is_potentially_trustworthy.h"
|
||||
|
@ -1301,7 +1302,8 @@ bool ElectronBrowserClient::WillCreateURLLoaderFactory(
|
|||
header_client,
|
||||
bool* bypass_redirect_checks,
|
||||
bool* disable_secure_dns,
|
||||
network::mojom::URLLoaderFactoryOverridePtr* factory_override) {
|
||||
network::mojom::URLLoaderFactoryOverridePtr* factory_override,
|
||||
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
auto web_request = api::WebRequest::FromOrCreate(isolate, browser_context);
|
||||
|
@ -1316,7 +1318,8 @@ bool ElectronBrowserClient::WillCreateURLLoaderFactory(
|
|||
bool use_proxy_for_web_request =
|
||||
web_request_api->MaybeProxyURLLoaderFactory(
|
||||
browser_context, frame_host, render_process_id, type, navigation_id,
|
||||
ukm_source_id, factory_receiver, header_client);
|
||||
ukm_source_id, factory_receiver, header_client,
|
||||
navigation_response_task_runner);
|
||||
|
||||
if (bypass_redirect_checks)
|
||||
*bypass_redirect_checks = use_proxy_for_web_request;
|
||||
|
@ -1684,7 +1687,7 @@ void ElectronBrowserClient::RegisterBrowserInterfaceBindersForServiceWorker(
|
|||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
device::GeolocationManager* ElectronBrowserClient::GetGeolocationManager() {
|
||||
return g_browser_process->geolocation_manager();
|
||||
return device::GeolocationManager::GetInstance();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -228,7 +228,9 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
|||
header_client,
|
||||
bool* bypass_redirect_checks,
|
||||
bool* disable_secure_dns,
|
||||
network::mojom::URLLoaderFactoryOverridePtr* factory_override) override;
|
||||
network::mojom::URLLoaderFactoryOverridePtr* factory_override,
|
||||
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner)
|
||||
override;
|
||||
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
|
||||
WillCreateURLLoaderRequestInterceptors(
|
||||
content::NavigationUIData* navigation_ui_data,
|
||||
|
|
|
@ -446,7 +446,8 @@ ElectronBrowserContext::GetURLLoaderFactory() {
|
|||
this, nullptr, -1,
|
||||
content::ContentBrowserClient::URLLoaderFactoryType::kNavigation,
|
||||
url::Origin(), absl::nullopt, ukm::kInvalidSourceIdObj,
|
||||
&factory_receiver, &header_client, nullptr, nullptr, nullptr);
|
||||
&factory_receiver, &header_client, nullptr, nullptr, nullptr,
|
||||
nullptr);
|
||||
|
||||
network::mojom::URLLoaderFactoryParamsPtr params =
|
||||
network::mojom::URLLoaderFactoryParams::New();
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "base/apple/bundle_locations.h"
|
||||
#include "base/mac/foundation_util.h"
|
||||
#include "base/path_service.h"
|
||||
#include "services/device/public/cpp/geolocation/geolocation_manager.h"
|
||||
#include "services/device/public/cpp/geolocation/system_geolocation_source_mac.h"
|
||||
#include "shell/browser/browser_process_impl.h"
|
||||
#import "shell/browser/mac/electron_application.h"
|
||||
|
@ -32,8 +33,8 @@ void ElectronBrowserMainParts::PreCreateMainMessageLoop() {
|
|||
setObject:@"NO"
|
||||
forKey:@"NSTreatUnknownArgumentsAsOpen"];
|
||||
|
||||
if (!g_browser_process->geolocation_manager()) {
|
||||
g_browser_process->SetGeolocationManager(
|
||||
if (!device::GeolocationManager::GetInstance()) {
|
||||
device::GeolocationManager::SetInstance(
|
||||
device::SystemGeolocationSourceMac::CreateGeolocationManagerOnMac());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/network_service_instance.h"
|
||||
#include "content/public/browser/network_service_util.h"
|
||||
#include "content/public/common/content_features.h"
|
||||
#include "content/public/common/network_service_util.h"
|
||||
#include "electron/fuses.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
#include "net/dns/public/dns_over_https_config.h"
|
||||
|
|
|
@ -29,6 +29,7 @@ ElectronSerialDelegate::~ElectronSerialDelegate() = default;
|
|||
std::unique_ptr<content::SerialChooser> ElectronSerialDelegate::RunChooser(
|
||||
content::RenderFrameHost* frame,
|
||||
std::vector<blink::mojom::SerialPortFilterPtr> filters,
|
||||
std::vector<device::BluetoothUUID> allowed_bluetooth_service_class_ids,
|
||||
content::SerialChooser::Callback callback) {
|
||||
SerialChooserController* controller = ControllerForFrame(frame);
|
||||
if (controller) {
|
||||
|
|
|
@ -32,6 +32,7 @@ class ElectronSerialDelegate : public content::SerialDelegate,
|
|||
std::unique_ptr<content::SerialChooser> RunChooser(
|
||||
content::RenderFrameHost* frame,
|
||||
std::vector<blink::mojom::SerialPortFilterPtr> filters,
|
||||
std::vector<device::BluetoothUUID> allowed_bluetooth_service_class_ids,
|
||||
content::SerialChooser::Callback callback) override;
|
||||
bool CanRequestPortPermission(content::RenderFrameHost* frame) override;
|
||||
bool HasPortPermission(content::RenderFrameHost* frame,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/ui/cocoa/delayed_native_view_host.h"
|
||||
#include "base/apple/owned_objc.h"
|
||||
#include "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h"
|
||||
|
||||
namespace electron {
|
||||
|
@ -26,10 +27,12 @@ bool DelayedNativeViewHost::OnMousePressed(const ui::MouseEvent& ui_event) {
|
|||
// handle them here.
|
||||
// See:
|
||||
// https://source.chromium.org/chromium/chromium/src/+/main:components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm;l=415-421;drc=a5af91924bafb85426e091c6035801990a6dc697
|
||||
|
||||
ElectronInspectableWebContentsView* inspectable_web_contents_view =
|
||||
(ElectronInspectableWebContentsView*)native_view_.GetNativeNSView();
|
||||
[inspectable_web_contents_view
|
||||
redispatchContextMenuEvent:ui_event.native_event()];
|
||||
redispatchContextMenuEvent:base::apple::OwnedNSEvent(
|
||||
ui_event.native_event())];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#include "base/apple/owned_objc.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "chrome/browser/devtools/devtools_contents_resizing_strategy.h"
|
||||
#include "ui/base/cocoa/base_view.h"
|
||||
|
@ -46,7 +47,7 @@ using electron::InspectableWebContentsViewMac;
|
|||
(const DevToolsContentsResizingStrategy&)strategy;
|
||||
- (void)setTitle:(NSString*)title;
|
||||
|
||||
- (void)redispatchContextMenuEvent:(NSEvent*)theEvent;
|
||||
- (void)redispatchContextMenuEvent:(base::apple::OwnedNSEvent)theEvent;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -275,10 +275,10 @@
|
|||
[self notifyDevToolsFocused];
|
||||
}
|
||||
|
||||
- (void)redispatchContextMenuEvent:(NSEvent*)event {
|
||||
DCHECK(event.type == NSEventTypeRightMouseDown ||
|
||||
(event.type == NSEventTypeLeftMouseDown &&
|
||||
(event.modifierFlags & NSEventModifierFlagControl)));
|
||||
- (void)redispatchContextMenuEvent:(base::apple::OwnedNSEvent)event {
|
||||
DCHECK(event.Get().type == NSEventTypeRightMouseDown ||
|
||||
(event.Get().type == NSEventTypeLeftMouseDown &&
|
||||
(event.Get().modifierFlags & NSEventModifierFlagControl)));
|
||||
content::WebContents* contents =
|
||||
inspectableWebContentsView_->inspectable_web_contents()->GetWebContents();
|
||||
electron::api::WebContents* api_contents =
|
||||
|
@ -292,7 +292,7 @@
|
|||
api_contents->SetForceNonDraggable(true);
|
||||
BaseView* contentsView =
|
||||
(BaseView*)rwhv->GetNativeView().GetNativeNSView();
|
||||
[contentsView mouseEvent:event];
|
||||
[contentsView mouseEvent:event.Get()];
|
||||
api_contents->SetForceNonDraggable(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ void TrayIcon::RemoveBalloon() {}
|
|||
void TrayIcon::Focus() {}
|
||||
|
||||
void TrayIcon::PopUpContextMenu(const gfx::Point& pos,
|
||||
ElectronMenuModel* menu_model) {}
|
||||
raw_ptr<ElectronMenuModel> menu_model) {}
|
||||
|
||||
void TrayIcon::CloseContextMenu() {}
|
||||
|
||||
|
|
|
@ -89,12 +89,12 @@ class TrayIcon {
|
|||
|
||||
// Popups the menu.
|
||||
virtual void PopUpContextMenu(const gfx::Point& pos,
|
||||
ElectronMenuModel* menu_model);
|
||||
raw_ptr<ElectronMenuModel> menu_model);
|
||||
|
||||
virtual void CloseContextMenu();
|
||||
|
||||
// Set the context menu for this icon.
|
||||
virtual void SetContextMenu(ElectronMenuModel* menu_model) = 0;
|
||||
virtual void SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) = 0;
|
||||
|
||||
// Returns the bounds of tray icon.
|
||||
virtual gfx::Rect GetBounds();
|
||||
|
|
|
@ -31,9 +31,9 @@ class TrayIconCocoa : public TrayIcon {
|
|||
bool GetIgnoreDoubleClickEvents() override;
|
||||
void PopUpOnUI(ElectronMenuModel* menu_model);
|
||||
void PopUpContextMenu(const gfx::Point& pos,
|
||||
ElectronMenuModel* menu_model) override;
|
||||
raw_ptr<ElectronMenuModel>) override;
|
||||
void CloseContextMenu() override;
|
||||
void SetContextMenu(ElectronMenuModel* menu_model) override;
|
||||
void SetContextMenu(raw_ptr<ElectronMenuModel>) override;
|
||||
gfx::Rect GetBounds() override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -363,7 +363,7 @@ void TrayIconCocoa::PopUpOnUI(ElectronMenuModel* menu_model) {
|
|||
}
|
||||
|
||||
void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos,
|
||||
ElectronMenuModel* menu_model) {
|
||||
raw_ptr<ElectronMenuModel> menu_model) {
|
||||
content::GetUIThreadTaskRunner({})->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(&TrayIconCocoa::PopUpOnUI, weak_factory_.GetWeakPtr(),
|
||||
|
@ -374,7 +374,7 @@ void TrayIconCocoa::CloseContextMenu() {
|
|||
[status_item_view_ closeContextMenu];
|
||||
}
|
||||
|
||||
void TrayIconCocoa::SetContextMenu(ElectronMenuModel* menu_model) {
|
||||
void TrayIconCocoa::SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) {
|
||||
if (menu_model) {
|
||||
// Create native menu.
|
||||
menu_.reset([[ElectronMenuController alloc] initWithModel:menu_model
|
||||
|
|
|
@ -50,7 +50,7 @@ void TrayIconLinux::SetToolTip(const std::string& tool_tip) {
|
|||
status_icon->SetToolTip(tool_tip_);
|
||||
}
|
||||
|
||||
void TrayIconLinux::SetContextMenu(ElectronMenuModel* menu_model) {
|
||||
void TrayIconLinux::SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) {
|
||||
menu_model_ = menu_model;
|
||||
if (auto* status_icon = GetStatusIcon())
|
||||
status_icon->UpdatePlatformContextMenu(menu_model_);
|
||||
|
|
|
@ -25,7 +25,7 @@ class TrayIconLinux : public TrayIcon, public ui::StatusIconLinux::Delegate {
|
|||
// TrayIcon:
|
||||
void SetImage(const gfx::Image& image) override;
|
||||
void SetToolTip(const std::string& tool_tip) override;
|
||||
void SetContextMenu(ElectronMenuModel* menu_model) override;
|
||||
void SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) override;
|
||||
|
||||
// ui::StatusIconLinux::Delegate
|
||||
void OnClick() override;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "chrome/browser/ui/frame/window_frame_util.h"
|
||||
#include "chrome/browser/ui/view_ids.h"
|
||||
#include "shell/browser/ui/views/win_icon_painter.h"
|
||||
|
@ -58,7 +59,7 @@ class WinCaptionButton : public views::Button {
|
|||
// Paints the minimize/maximize/restore/close icon for the button.
|
||||
void PaintSymbol(gfx::Canvas* canvas);
|
||||
|
||||
WinFrameView* frame_view_;
|
||||
raw_ptr<WinFrameView> frame_view_;
|
||||
std::unique_ptr<WinIconPainter> icon_painter_;
|
||||
ViewID button_type_;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#ifndef ELECTRON_SHELL_BROWSER_UI_VIEWS_WIN_CAPTION_BUTTON_CONTAINER_H_
|
||||
#define ELECTRON_SHELL_BROWSER_UI_VIEWS_WIN_CAPTION_BUTTON_CONTAINER_H_
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/scoped_observation.h"
|
||||
#include "ui/base/metadata/metadata_header_macros.h"
|
||||
#include "ui/base/pointer/touch_ui_controller.h"
|
||||
|
@ -61,11 +62,11 @@ class WinCaptionButtonContainer : public views::View,
|
|||
void OnWidgetBoundsChanged(views::Widget* widget,
|
||||
const gfx::Rect& new_bounds) override;
|
||||
|
||||
WinFrameView* const frame_view_;
|
||||
WinCaptionButton* const minimize_button_;
|
||||
WinCaptionButton* const maximize_button_;
|
||||
WinCaptionButton* const restore_button_;
|
||||
WinCaptionButton* const close_button_;
|
||||
raw_ptr<WinFrameView> const frame_view_;
|
||||
raw_ptr<WinCaptionButton> const minimize_button_;
|
||||
raw_ptr<WinCaptionButton> const maximize_button_;
|
||||
raw_ptr<WinCaptionButton> const restore_button_;
|
||||
raw_ptr<WinCaptionButton> const close_button_;
|
||||
|
||||
base::ScopedObservation<views::Widget, views::WidgetObserver>
|
||||
widget_observation_{this};
|
||||
|
|
|
@ -90,7 +90,7 @@ class WinFrameView : public FramelessView {
|
|||
// The container holding the caption buttons (minimize, maximize, close, etc.)
|
||||
// May be null if the caption button container is destroyed before the frame
|
||||
// view. Always check for validity before using!
|
||||
WinCaptionButtonContainer* caption_button_container_;
|
||||
raw_ptr<WinCaptionButtonContainer> caption_button_container_;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include "chrome/common/chrome_features.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#include "chrome/grit/dev_ui_browser_resources.h" // nogncheck
|
||||
#include "chrome/grit/accessibility_resources.h" // nogncheck
|
||||
#include "chrome/grit/accessibility_resources_map.h" // nogncheck
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/ax_event_notification_details.h"
|
||||
|
@ -313,9 +314,9 @@ ElectronAccessibilityUI::ElectronAccessibilityUI(content::WebUI* web_ui)
|
|||
|
||||
// Add required resources.
|
||||
html_source->UseStringsJs();
|
||||
html_source->AddResourcePath("accessibility.css", IDR_ACCESSIBILITY_CSS);
|
||||
html_source->AddResourcePath("accessibility.js", IDR_ACCESSIBILITY_JS);
|
||||
html_source->SetDefaultResource(IDR_ACCESSIBILITY_HTML);
|
||||
html_source->AddResourcePaths(
|
||||
base::make_span(kAccessibilityResources, kAccessibilityResourcesSize));
|
||||
html_source->SetDefaultResource(IDR_ACCESSIBILITY_ACCESSIBILITY_HTML);
|
||||
html_source->SetRequestFilter(
|
||||
base::BindRepeating(&ShouldHandleAccessibilityRequestCallback),
|
||||
base::BindRepeating(&HandleAccessibilityRequestCallback,
|
||||
|
|
|
@ -36,10 +36,10 @@ class ElectronDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
|
|||
aura::Window* gained_active,
|
||||
aura::Window* lost_active) override;
|
||||
|
||||
NativeWindowViews* native_window_view_;
|
||||
raw_ptr<NativeWindowViews> native_window_view_;
|
||||
|
||||
// Owned by DesktopNativeWidgetAura.
|
||||
views::DesktopWindowTreeHost* desktop_window_tree_host_;
|
||||
raw_ptr<views::DesktopWindowTreeHost> desktop_window_tree_host_;
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -40,7 +40,7 @@ class ElectronDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin,
|
|||
void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override;
|
||||
|
||||
private:
|
||||
NativeWindowViews* native_window_view_; // weak ref
|
||||
raw_ptr<NativeWindowViews> native_window_view_; // weak ref
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -191,7 +191,7 @@ void NotifyIcon::Focus() {
|
|||
}
|
||||
|
||||
void NotifyIcon::PopUpContextMenu(const gfx::Point& pos,
|
||||
ElectronMenuModel* menu_model) {
|
||||
raw_ptr<ElectronMenuModel> menu_model) {
|
||||
// Returns if context menu isn't set.
|
||||
if (menu_model == nullptr && menu_model_ == nullptr)
|
||||
return;
|
||||
|
@ -223,7 +223,7 @@ void NotifyIcon::CloseContextMenu() {
|
|||
}
|
||||
}
|
||||
|
||||
void NotifyIcon::SetContextMenu(ElectronMenuModel* menu_model) {
|
||||
void NotifyIcon::SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) {
|
||||
menu_model_ = menu_model;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,9 +65,9 @@ class NotifyIcon : public TrayIcon {
|
|||
void RemoveBalloon() override;
|
||||
void Focus() override;
|
||||
void PopUpContextMenu(const gfx::Point& pos,
|
||||
ElectronMenuModel* menu_model) override;
|
||||
raw_ptr<ElectronMenuModel> menu_model) override;
|
||||
void CloseContextMenu() override;
|
||||
void SetContextMenu(ElectronMenuModel* menu_model) override;
|
||||
void SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) override;
|
||||
gfx::Rect GetBounds() override;
|
||||
|
||||
base::WeakPtr<NotifyIcon> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
|
||||
|
@ -76,7 +76,7 @@ class NotifyIcon : public TrayIcon {
|
|||
void InitIconData(NOTIFYICONDATA* icon_data);
|
||||
|
||||
// The tray that owns us. Weak.
|
||||
NotifyIconHost* host_;
|
||||
raw_ptr<NotifyIconHost> host_;
|
||||
|
||||
// The unique ID corresponding to this icon.
|
||||
UINT icon_id_;
|
||||
|
@ -91,7 +91,7 @@ class NotifyIcon : public TrayIcon {
|
|||
base::win::ScopedHICON icon_;
|
||||
|
||||
// The context menu.
|
||||
ElectronMenuModel* menu_model_ = nullptr;
|
||||
raw_ptr<ElectronMenuModel> menu_model_ = nullptr;
|
||||
|
||||
// An optional GUID used for identifying tray entries on Windows
|
||||
GUID guid_ = GUID_DEFAULT;
|
||||
|
|
|
@ -118,18 +118,6 @@ void OpenExternal(const GURL& url,
|
|||
});
|
||||
}
|
||||
|
||||
// The following function helps with debug builds on the Mac
|
||||
gfx::NativeView GetViewForWindow(gfx::NativeWindow native_window) {
|
||||
NOTREACHED();
|
||||
return nil;
|
||||
}
|
||||
|
||||
// The following function helps with debug builds on the Mac
|
||||
gfx::NativeView GetParent(gfx::NativeView view) {
|
||||
NOTREACHED();
|
||||
return nil;
|
||||
}
|
||||
|
||||
bool MoveItemToTrashWithError(const base::FilePath& full_path,
|
||||
bool delete_on_fail,
|
||||
std::string* error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue