Revert "feat: upgrade to Chromium 72.0.3626.52 (#16334)"

This reverts commit 1918e76913.
This commit is contained in:
Samuel Attard 2019-01-22 12:01:04 -08:00
parent 58a6fe13d6
commit 0b85fb7ea2
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
178 changed files with 1734 additions and 2102 deletions

View file

@ -92,9 +92,7 @@ void ShowCertificateTrust(atom::NativeWindow* parent_window,
SecTrustRef trust = nullptr;
SecTrustCreateWithCertificates(cert_chain, sec_policy, &trust);
NSWindow* window = parent_window
? parent_window->GetNativeWindow().GetNativeNSWindow()
: nil;
NSWindow* window = parent_window ? parent_window->GetNativeWindow() : nil;
auto msg = base::SysUTF8ToNSString(message);
auto panel = [[SFCertificateTrustPanel alloc] init];

View file

@ -43,7 +43,7 @@
} else {
auto* contents = inspectableWebContentsView_->inspectable_web_contents()
->GetWebContents();
auto* contentsView = contents->GetNativeView().GetNativeNSView();
auto contentsView = contents->GetNativeView();
[contentsView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[self addSubview:contentsView];
}
@ -79,7 +79,7 @@
inspectableWebContentsView_->inspectable_web_contents();
auto* devToolsWebContents =
inspectable_web_contents->GetDevToolsWebContents();
auto* devToolsView = devToolsWebContents->GetNativeView().GetNativeNSView();
auto devToolsView = devToolsWebContents->GetNativeView();
devtools_visible_ = visible;
if (devtools_docked_) {
@ -134,7 +134,7 @@
inspectableWebContentsView_->inspectable_web_contents();
auto* devToolsWebContents =
inspectable_web_contents->GetDevToolsWebContents();
auto devToolsView = devToolsWebContents->GetNativeView().GetNativeNSView();
auto devToolsView = devToolsWebContents->GetNativeView();
auto styleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
NSMiniaturizableWindowMask | NSWindowStyleMaskResizable |
@ -203,7 +203,7 @@
if (!inspectable_web_contents || inspectable_web_contents->IsGuest())
return;
auto* webContents = inspectable_web_contents->GetWebContents();
auto* webContentsView = webContents->GetNativeView().GetNativeNSView();
auto webContentsView = webContents->GetNativeView();
NSView* view = [notification object];
if ([[webContentsView subviews] containsObject:view]) {
@ -215,7 +215,7 @@
inspectable_web_contents->GetDevToolsWebContents();
if (!devToolsWebContents)
return;
auto devToolsView = devToolsWebContents->GetNativeView().GetNativeNSView();
auto devToolsView = devToolsWebContents->GetNativeView();
if ([[devToolsView subviews] containsObject:view]) {
devtools_is_first_responder_ = YES;

View file

@ -21,7 +21,7 @@ class AtomNativeWidgetMac : public views::NativeWidgetMac {
protected:
// NativeWidgetMac:
NativeWidgetMacNSWindow* CreateNSWindow(
const views_bridge_mac::mojom::CreateWindowParams* params) override;
const views::Widget::InitParams& params) override;
private:
NativeWindowMac* shell_;

View file

@ -19,7 +19,7 @@ AtomNativeWidgetMac::AtomNativeWidgetMac(
AtomNativeWidgetMac::~AtomNativeWidgetMac() {}
NativeWidgetMacNSWindow* AtomNativeWidgetMac::CreateNSWindow(
const views_bridge_mac::mojom::CreateWindowParams* params) {
const views::Widget::InitParams& params) {
return [[[AtomNSWindow alloc] initWithShell:shell_ styleMask:style_mask_]
autorelease];
}

View file

@ -9,7 +9,6 @@
#include "atom/browser/ui/cocoa/atom_preview_item.h"
#include "atom/browser/ui/cocoa/atom_touch_bar.h"
#include "base/mac/mac_util.h"
#include "ui/views/cocoa/bridged_native_widget_host_impl.h"
#include "ui/views/widget/native_widget_mac.h"
#include "ui/views_bridge_mac/bridged_native_widget_impl.h"
@ -22,13 +21,12 @@
// on the fly.
// TODO(zcbenz): Add interface in NativeWidgetMac to allow overriding creating
// window delegate.
auto* bridge_host = views::BridgedNativeWidgetHostImpl::GetFromNativeWindow(
auto* bridged_view = views::BridgedNativeWidgetImpl::GetFromNativeWindow(
shell->GetNativeWindow());
auto* bridged_view = bridge_host->bridge_impl();
if ((self = [super initWithBridgedNativeWidget:bridged_view])) {
shell_ = shell;
is_zooming_ = false;
level_ = [shell_->GetNativeWindow().GetNativeNSWindow() level];
level_ = [shell_->GetNativeWindow() level];
}
return self;
}
@ -140,7 +138,7 @@
}
- (void)windowWillMiniaturize:(NSNotification*)notification {
NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = shell_->GetNativeWindow();
// store the current status window level to be restored in
// windowDidDeminiaturize
level_ = [window level];
@ -154,7 +152,7 @@
- (void)windowDidDeminiaturize:(NSNotification*)notification {
[super windowDidDeminiaturize:notification];
[shell_->GetNativeWindow().GetNativeNSWindow() setLevel:level_];
[shell_->GetNativeWindow() setLevel:level_];
shell_->NotifyWindowRestore();
}
@ -181,7 +179,7 @@
// artifacts.
if (@available(macOS 10.10, *)) {
if (shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = shell_->GetNativeWindow();
[window setToolbar:nil];
}
}
@ -194,7 +192,7 @@
// For frameless window we don't show set title for normal mode since the
// titlebar is expected to be empty, but after entering fullscreen mode we
// have to set one, because title bar is visible here.
NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
// FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under
// fullscreen mode.
@ -223,7 +221,7 @@
- (void)windowWillExitFullScreen:(NSNotification*)notification {
if (@available(macOS 10.10, *)) {
// Restore the titlebar visibility.
NSWindow* window = shell_->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
shell_->fullscreen_window_title())) {
@ -249,9 +247,8 @@
// Clears the delegate when window is going to be closed, since EL Capitan it
// is possible that the methods of delegate would get called after the window
// has been closed.
auto* bridge_host = views::BridgedNativeWidgetHostImpl::GetFromNativeWindow(
auto* bridged_view = views::BridgedNativeWidgetImpl::GetFromNativeWindow(
shell_->GetNativeWindow());
auto* bridged_view = bridge_host->bridge_impl();
bridged_view->OnWindowWillClose();
}

View file

@ -33,27 +33,26 @@ void DragFileItems(const std::vector<base::FilePath>& files,
// Synthesize a drag event, since we don't have access to the actual event
// that initiated a drag (possibly consumed by the Web UI, for example).
NSWindow* window = [view.GetNativeNSView() window];
NSPoint position = [window mouseLocationOutsideOfEventStream];
NSPoint position = [[view window] mouseLocationOutsideOfEventStream];
NSTimeInterval eventTime = [[NSApp currentEvent] timestamp];
NSEvent* dragEvent = [NSEvent mouseEventWithType:NSLeftMouseDragged
location:position
modifierFlags:NSLeftMouseDraggedMask
timestamp:eventTime
windowNumber:[window windowNumber]
windowNumber:[[view window] windowNumber]
context:nil
eventNumber:0
clickCount:1
pressure:1.0];
// Run the drag operation.
[window dragImage:icon.ToNSImage()
at:position
offset:NSZeroSize
event:dragEvent
pasteboard:pasteboard
source:view.GetNativeNSView()
slideBack:YES];
[[view window] dragImage:icon.ToNSImage()
at:position
offset:NSZeroSize
event:dragEvent
pasteboard:pasteboard
source:view
slideBack:YES];
}
} // namespace atom

View file

@ -210,8 +210,7 @@ int RunModalDialog(NSSavePanel* dialog, const DialogSettings& settings) {
settings.force_detached) {
chosen = [dialog runModal];
} else {
NSWindow* window =
settings.parent_window->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = settings.parent_window->GetNativeWindow();
[dialog beginSheetModalForWindow:window
completionHandler:^(NSInteger c) {
@ -329,8 +328,7 @@ void ShowOpenDialog(const DialogSettings& settings,
OpenDialogCompletion(chosen, dialog, settings, callback);
}];
} else {
NSWindow* window =
settings.parent_window->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = settings.parent_window->GetNativeWindow();
[dialog beginSheetModalForWindow:window
completionHandler:^(NSInteger chosen) {
OpenDialogCompletion(chosen, dialog, settings, callback);
@ -391,8 +389,7 @@ void ShowSaveDialog(const DialogSettings& settings,
SaveDialogCompletion(chosen, dialog, settings, callback);
}];
} else {
NSWindow* window =
settings.parent_window->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = settings.parent_window->GetNativeWindow();
[dialog beginSheetModalForWindow:window
completionHandler:^(NSInteger chosen) {
SaveDialogCompletion(chosen, dialog, settings, callback);

View file

@ -779,11 +779,12 @@ bool InspectableWebContentsImpl::ShouldCreateWebContents(
return false;
}
bool InspectableWebContentsImpl::HandleKeyboardEvent(
void InspectableWebContentsImpl::HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
auto* delegate = web_contents_->GetDelegate();
return !delegate || delegate->HandleKeyboardEvent(source, event);
if (delegate)
delegate->HandleKeyboardEvent(source, event);
}
void InspectableWebContentsImpl::CloseContents(content::WebContents* source) {

View file

@ -182,7 +182,7 @@ class InspectableWebContentsImpl
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) override;
bool HandleKeyboardEvent(content::WebContents*,
void HandleKeyboardEvent(content::WebContents*,
const content::NativeWebKeyboardEvent&) override;
void CloseContents(content::WebContents* source) override;
content::ColorChooser* OpenColorChooser(

View file

@ -156,7 +156,7 @@ int ShowMessageBox(NativeWindow* parent_window,
andAlert:alert
callEndModal:true];
NSWindow* window = parent_window->GetNativeWindow().GetNativeNSWindow();
NSWindow* window = parent_window->GetNativeWindow();
[alert beginSheetModalForWindow:window
modalDelegate:delegate
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
@ -193,9 +193,7 @@ void ShowMessageBox(NativeWindow* parent_window,
andAlert:alert
callEndModal:false];
NSWindow* window =
parent_window ? parent_window->GetNativeWindow().GetNativeNSWindow()
: nil;
NSWindow* window = parent_window ? parent_window->GetNativeWindow() : nil;
[alert
beginSheetModalForWindow:window
modalDelegate:delegate

View file

@ -47,6 +47,9 @@ bool ViewsDelegate::GetSavedWindowPlacement(
return false;
}
void ViewsDelegate::NotifyAccessibilityEvent(views::View* view,
ax::mojom::Event event_type) {}
void ViewsDelegate::NotifyMenuItemFocused(const base::string16& menu_name,
const base::string16& menu_item_name,
int item_index,

View file

@ -27,6 +27,8 @@ class ViewsDelegate : public views::ViewsDelegate {
const std::string& window_name,
gfx::Rect* bounds,
ui::WindowShowState* show_state) const override;
void NotifyAccessibilityEvent(views::View* view,
ax::mojom::Event event_type) override;
void NotifyMenuItemFocused(const base::string16& menu_name,
const base::string16& menu_item_name,
int item_index,

View file

@ -23,7 +23,8 @@ SubmenuButton::SubmenuButton(const base::string16& title,
views::MenuButtonListener* menu_button_listener,
const SkColor& background_color)
: views::MenuButton(gfx::RemoveAcceleratorChar(title, '&', NULL, NULL),
menu_button_listener),
menu_button_listener,
false),
background_color_(background_color) {
#if defined(OS_LINUX)
// Dont' use native style border.
@ -71,7 +72,7 @@ void SubmenuButton::SetUnderlineColor(SkColor color) {
}
void SubmenuButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->SetName(GetAccessibleName());
node_data->SetName(accessible_name());
node_data->role = ax::mojom::Role::kPopUpButton;
}