Compare commits

...

32 Commits

Author SHA1 Message Date
Electron Bot
d1ae575c66 Bump v5.0.11 2019-09-24 13:39:15 -07:00
Samuel Attard
07f0f577c2 Revert "Bump v5.0.11"
This reverts commit db96d05fed.
2019-09-24 13:37:44 -07:00
trop[bot]
b07ec8d7b1 build: use a lower process count for publish builds with no sccache (#20337) 2019-09-24 13:36:28 -07:00
trop[bot]
c7b320163b fix: correct 'Entire screen' to ' Entire Screen' (#20300) 2019-09-20 07:44:19 -07:00
trop[bot]
00bc8c265a fix: crash when exiting simple fullscreen on macOS (#20144) (#20291) 2019-09-20 10:37:48 -04:00
Shelley Vohr
1f658e98a3 docs: improve and add examples for clipboard (#20224) (#20283) (#20288)
* docs: improve and add examples for clipboard

* address feedback from jkleinsc review
2019-09-20 10:21:10 -04:00
Electron Bot
db96d05fed Bump v5.0.11 2019-09-18 12:48:14 -07:00
trop[bot]
f0f0f20a7e fix: strip chrome-sandbox typo (#20259) 2019-09-18 09:44:11 -07:00
Pedro Pontes
b39978d7ed fix: Add more checks in MojoCdmService. (#20221)
Applies b7b305f338%5E%21/
2019-09-17 13:04:06 -04:00
trop[bot]
052f14b977 build: get all the release assets when looking for one to delete (#20166)
* build: get all the release assets when looking for one to delete

yeah we totally have more than 30....

* Update upload-to-github.js
2019-09-09 06:07:22 -07:00
John Kleinschmidt
9192c85b10 ci: do not run WOA builds on older versions of Electron (#20090) 2019-09-04 17:23:27 -04:00
trop[bot]
24f454557d Revert "fix: make sure that menu bar gets focus even when you click an item to focus it first (#19710)" (#20034)
This reverts commit 27b2747b61.
2019-09-03 23:18:49 -07:00
trop[bot]
6d52197c8c fix: strip chrome_sandbox executable (#20082) 2019-09-03 09:49:17 -07:00
trop[bot]
c9b0b52f3f fix: honor cursor blink rate (#20045)
* fix: honor cursor blink rate on macOS

* fix: honor cursor blink rate on Linux

* fix: honor cursor blink rate on Windows

* refactor: clean up os_win cursor blink logic

* remove unneeded include
2019-09-03 16:22:03 +09:00
Charles Kerr
cb67e6ebc5 fix: i18n of gtk msgbox buttons (#20010)
* fix: i18n of gtk msgbox buttons

Manually backport #19904. See that PR for details.

* fix: make linter happy

* fix: make linter happy
2019-08-29 15:28:20 +09:00
Shelley Vohr
e441ac1c5a fix: add default media usage strings to info.plist (#19950) 2019-08-27 10:50:40 -04:00
Cheng Zhao
9591975f32 fix: notify views of content view size change (#19882) 2019-08-26 10:11:02 -07:00
trop[bot]
6cd9f303fe fix: command-line scheme switch values' spillover (#19939) 2019-08-25 23:01:44 -07:00
trop[bot]
65d2dd262d build: ninja count should be 2*cores + 2 (#19868) 2019-08-21 08:53:09 -07:00
Electron Bot
095d690062 Bump v5.0.10 2019-08-19 14:30:51 -07:00
trop[bot]
8b1594de25 chore: upgrades-wg owns DEPS (#19832) 2019-08-19 14:04:08 -07:00
Pedro Pontes
33a007383d fix: always use new site instance for a new navigation. (#19828) 2019-08-19 12:04:26 -07:00
Erick Zhao
1d9c3d7d2a fix: normalize behavior of win.setOpacity() for invalid number values across operating systems (#19724)
* fix: normalize behavior of `win.setOpacity()` for invalid number values across operating systems

* expect -> assert

* assert 2

* fix `this` scoping

* fix equality

* tests
2019-08-18 17:47:43 -07:00
John Kleinschmidt
c00f71513b ci: fix flaky test on arm (5-0-x) (#19806)
* ci: update docker options for arm testing
2019-08-16 16:36:59 -04:00
Charles Kerr
9c2d9ba6de fix: i18n gtk dialog buttons (#19801)
manual backport of https://github.com/electron/electron/pull/19756
2019-08-16 13:28:08 -07:00
trop[bot]
88605dd94a MessageBoxOptions.icon should allow string (#19796) 2019-08-16 13:25:30 -07:00
trop[bot]
a14285bebe fix: make sure that menu bar gets focus even when you click an item to focus it first (#19763) 2019-08-15 10:30:16 -07:00
Micha Hanselmann
b58b5980a4 fix: return correct bounds on will-resize (#19705) 2019-08-14 07:56:09 -07:00
trop[bot]
11037230eb docs: update hasShadow for win and linux (#19675) (#19721) 2019-08-12 20:57:26 -07:00
trop[bot]
bac953292f fix: avoid losing focus on inputs when opening menu (Windows/Linux) (#19707)
* remove cause of issue

* remove comment
2019-08-12 19:45:21 -07:00
Shelley Vohr
3fdfa68bd2 fix: crash on window.print() (#19678) 2019-08-08 07:52:42 -07:00
Shelley Vohr
0289c19a07 fix: serialize messages being sent over chrome message ports (#19654) 2019-08-07 08:44:22 -07:00
40 changed files with 538 additions and 165 deletions

View File

@@ -91,13 +91,19 @@ env-linux-medium: &env-linux-medium
NUMBER_OF_NINJA_PROCESSES: 3
env-linux-2xlarge: &env-linux-2xlarge
NUMBER_OF_NINJA_PROCESSES: 18
NUMBER_OF_NINJA_PROCESSES: 34
env-linux-2xlarge-release: &env-linux-2xlarge-release
NUMBER_OF_NINJA_PROCESSES: 16
env-machine-mac: &env-machine-mac
NUMBER_OF_NINJA_PROCESSES: 6
env-mac-large: &env-mac-large
NUMBER_OF_NINJA_PROCESSES: 10
NUMBER_OF_NINJA_PROCESSES: 18
env-mac-large-release: &env-mac-large-release
NUMBER_OF_NINJA_PROCESSES: 8
env-disable-crash-reporter-tests: &env-disable-crash-reporter-tests
DISABLE_CRASH_REPORTER_TESTS: true
@@ -895,7 +901,7 @@ jobs:
linux-x64-publish:
<<: *machine-linux-2xlarge
environment:
<<: *env-linux-2xlarge
<<: *env-linux-2xlarge-release
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *env-release-build
<<: *steps-electron-build-for-publish
@@ -941,7 +947,7 @@ jobs:
linux-ia32-publish:
<<: *machine-linux-2xlarge
environment:
<<: *env-linux-2xlarge
<<: *env-linux-2xlarge-release
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *env-ia32
<<: *env-release-build
@@ -989,7 +995,7 @@ jobs:
linux-arm-publish:
<<: *machine-linux-2xlarge
environment:
<<: *env-linux-2xlarge
<<: *env-linux-2xlarge-release
<<: *env-arm
<<: *env-release-build
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
@@ -1047,7 +1053,7 @@ jobs:
linux-arm64-publish:
<<: *machine-linux-2xlarge
environment:
<<: *env-linux-2xlarge
<<: *env-linux-2xlarge-release
<<: *env-arm64
<<: *env-release-build
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_arm64=True --custom-var=checkout_boto=True --custom-var=checkout_requests=True'
@@ -1091,7 +1097,7 @@ jobs:
osx-publish:
<<: *machine-mac-large
environment:
<<: *env-mac-large
<<: *env-mac-large-release
<<: *env-release-build
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'
<<: *steps-electron-build-for-publish
@@ -1126,7 +1132,7 @@ jobs:
mas-publish:
<<: *machine-mac-large
environment:
<<: *env-mac-large
<<: *env-mac-large-release
<<: *env-mas
<<: *env-release-build
GCLIENT_EXTRA_ARGS: '--custom-var=checkout_boto=True --custom-var=checkout_requests=True'

1
.github/CODEOWNERS vendored
View File

@@ -11,6 +11,7 @@
# Upgrades WG
/patches/ @electron/wg-upgrades
DEPS @electron/wg-upgrades
# Releases WG
/npm/ @electron/wg-releases

View File

@@ -1 +1 @@
5.0.9
5.0.11

View File

@@ -32,6 +32,9 @@ environment:
ELECTRON_OUT_DIR: Default
build_script:
- ps: >-
if($env:APPVEYOR_PROJECT_NAME -eq "electron-woa-testing") {
Write-warning "WOA builds not supported on older versions of Electron"; Exit-AppveyorBuild
}
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
}

View File

@@ -5,6 +5,7 @@
#include "atom/app/atom_content_client.h"
#include <string>
#include <utility>
#include <vector>
#include "atom/common/options_switches.h"
@@ -161,14 +162,19 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
}
void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
const char* separator,
const char* cmd_switch) {
void AppendDelimitedSwitchToVector(const base::StringPiece cmd_switch,
std::vector<std::string>* append_me) {
auto* command_line = base::CommandLine::ForCurrentProcess();
auto string_with_separator = command_line->GetSwitchValueASCII(cmd_switch);
if (!string_with_separator.empty())
*vec = base::SplitString(string_with_separator, separator,
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
auto switch_value = command_line->GetSwitchValueASCII(cmd_switch);
if (!switch_value.empty()) {
constexpr base::StringPiece delimiter(",", 1);
auto tokens =
base::SplitString(switch_value, delimiter, base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY);
append_me->reserve(append_me->size() + tokens.size());
std::move(std::begin(tokens), std::end(tokens),
std::back_inserter(*append_me));
}
}
} // namespace
@@ -200,30 +206,19 @@ base::RefCountedMemory* AtomContentClient::GetDataResourceBytes(
}
void AtomContentClient::AddAdditionalSchemes(Schemes* schemes) {
std::vector<std::string> splited;
ConvertStringWithSeparatorToVector(&splited, ",",
switches::kServiceWorkerSchemes);
for (const std::string& scheme : splited)
schemes->service_worker_schemes.push_back(scheme);
AppendDelimitedSwitchToVector(switches::kServiceWorkerSchemes,
&schemes->service_worker_schemes);
AppendDelimitedSwitchToVector(switches::kStandardSchemes,
&schemes->standard_schemes);
AppendDelimitedSwitchToVector(switches::kSecureSchemes,
&schemes->secure_schemes);
AppendDelimitedSwitchToVector(switches::kBypassCSPSchemes,
&schemes->csp_bypassing_schemes);
AppendDelimitedSwitchToVector(switches::kCORSSchemes,
&schemes->cors_enabled_schemes);
schemes->service_worker_schemes.push_back(url::kFileScheme);
ConvertStringWithSeparatorToVector(&splited, ",", switches::kStandardSchemes);
for (const std::string& scheme : splited)
schemes->standard_schemes.push_back(scheme);
schemes->standard_schemes.push_back("chrome-extension");
ConvertStringWithSeparatorToVector(&splited, ",", switches::kSecureSchemes);
for (const std::string& scheme : splited)
schemes->secure_schemes.push_back(scheme);
ConvertStringWithSeparatorToVector(&splited, ",",
switches::kBypassCSPSchemes);
for (const std::string& scheme : splited)
schemes->csp_bypassing_schemes.push_back(scheme);
ConvertStringWithSeparatorToVector(&splited, ",", switches::kCORSSchemes);
for (const std::string& scheme : splited)
schemes->cors_enabled_schemes.push_back(scheme);
}
void AtomContentClient::AddPepperPlugins(

View File

@@ -93,6 +93,12 @@
#if !defined(OS_MACOSX)
#include "ui/aura/window.h"
#else
#include "ui/base/cocoa/defaults_utils.h"
#endif
#if defined(OS_LINUX)
#include "ui/views/linux_ui/linux_ui.h"
#endif
#if defined(OS_LINUX) || defined(OS_WIN)
@@ -434,6 +440,25 @@ void WebContents::InitWithSessionAndOptions(
prefs->subpixel_rendering = params->subpixel_rendering;
#endif
// Honor the system's cursor blink rate settings
#if defined(OS_MACOSX)
base::TimeDelta interval;
if (ui::TextInsertionCaretBlinkPeriod(&interval))
prefs->caret_blink_interval = interval;
#elif defined(OS_LINUX)
views::LinuxUI* linux_ui = views::LinuxUI::instance();
if (linux_ui)
prefs->caret_blink_interval = linux_ui->GetCursorBlinkInterval();
#elif defined(OS_WIN)
const auto system_msec = ::GetCaretBlinkTime();
if (system_msec != 0) {
prefs->caret_blink_interval =
(system_msec == INFINITE)
? base::TimeDelta()
: base::TimeDelta::FromMilliseconds(system_msec);
}
#endif
// Save the preferences in C++.
new WebContentsPreferences(web_contents(), options);

View File

@@ -404,6 +404,7 @@ AtomBrowserClient::ShouldOverrideSiteInstanceForNavigation(
content::RenderFrameHost* speculative_rfh,
content::BrowserContext* browser_context,
const GURL& url,
bool has_navigation_started,
bool has_response_started,
content::SiteInstance** affinity_site_instance) const {
if (g_suppress_renderer_process_restart) {
@@ -438,6 +439,13 @@ AtomBrowserClient::ShouldOverrideSiteInstanceForNavigation(
return SiteInstanceForNavigationType::FORCE_CURRENT;
}
if (!has_navigation_started) {
// If the navigation didn't start yet, ignore any candidate site instance.
// If such instance exists, it belongs to a previous navigation still
// taking place. Fixes https://github.com/electron/electron/issues/17576.
return SiteInstanceForNavigationType::FORCE_NEW;
}
return SiteInstanceForNavigationType::FORCE_CANDIDATE_OR_NEW;
}

View File

@@ -78,6 +78,7 @@ class AtomBrowserClient : public content::ContentBrowserClient,
content::RenderFrameHost* speculative_rfh,
content::BrowserContext* browser_context,
const GURL& url,
bool has_navigation_started,
bool has_request_started,
content::SiteInstance** affinity_site_instance) const override;
void RegisterPendingSiteInstance(

View File

@@ -21,7 +21,6 @@
@class AtomPreviewItem;
@class AtomTouchBar;
@class CustomWindowButtonView;
@class FullSizeContentView;
namespace atom {
@@ -156,7 +155,7 @@ class NativeWindowMac : public NativeWindow {
AtomTouchBar* touch_bar() const { return touch_bar_.get(); }
bool zoom_to_page_width() const { return zoom_to_page_width_; }
bool fullscreen_window_title() const { return fullscreen_window_title_; }
bool simple_fullscreen() const { return always_simple_fullscreen_; }
bool always_simple_fullscreen() const { return always_simple_fullscreen_; }
protected:
// views::WidgetDelegate:
@@ -180,10 +179,12 @@ class NativeWindowMac : public NativeWindow {
// Event monitor for scroll wheel event.
id wheel_event_monitor_;
// The view that will fill the whole frameless window.
base::scoped_nsobject<FullSizeContentView> container_view_;
// The NSView that used as contentView of window.
//
// For frameless window it would fill the whole window.
base::scoped_nsobject<NSView> container_view_;
// The view that fills the client area.
// The views::View that fills the client area.
std::unique_ptr<RootViewMac> root_view_;
bool is_kiosk_ = false;

View File

@@ -22,6 +22,7 @@
#include "atom/common/options_switches.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/numerics/ranges.h"
#include "base/strings/sys_string_conversions.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "native_mate/dictionary.h"
@@ -29,9 +30,60 @@
#include "ui/gfx/skia_util.h"
#include "ui/gl/gpu_switching_manager.h"
#include "ui/views/background.h"
#include "ui/views/cocoa/bridged_native_widget_host_impl.h"
#include "ui/views/widget/widget.h"
#include "ui/views_bridge_mac/bridged_native_widget_impl.h"
// This view would inform Chromium to resize the hosted views::View.
//
// The overrided methods should behave the same with BridgedContentView.
@interface ElectronAdapatedContentView : NSView {
@private
views::BridgedNativeWidgetHostImpl* bridge_host_;
}
@end
@implementation ElectronAdapatedContentView
- (id)initWithShell:(atom::NativeWindowMac*)shell {
if ((self = [self init])) {
bridge_host_ = views::BridgedNativeWidgetHostImpl::GetFromNativeWindow(
shell->GetNativeWindow());
}
return self;
}
- (void)viewDidMoveToWindow {
// When this view is added to a window, AppKit calls setFrameSize before it is
// added to the window, so the behavior in setFrameSize is not triggered.
NSWindow* window = [self window];
if (window)
[self setFrameSize:NSZeroSize];
}
- (void)setFrameSize:(NSSize)newSize {
// The size passed in here does not always use
// -[NSWindow contentRectForFrameRect]. The following ensures that the
// contentView for a frameless window can extend over the titlebar of the new
// window containing it, since AppKit requires a titlebar to give frameless
// windows correct shadows and rounded corners.
NSWindow* window = [self window];
if (window && [window contentView] == self) {
newSize = [window contentRectForFrameRect:[window frame]].size;
// Ensure that the window geometry be updated on the host side before the
// view size is updated.
bridge_host_->bridge_impl()->UpdateWindowGeometry();
}
[super setFrameSize:newSize];
// The OnViewSizeChanged is marked private in derived class.
static_cast<views_bridge_mac::mojom::BridgedNativeWidgetHost*>(bridge_host_)
->OnViewSizeChanged(gfx::Size(newSize.width, newSize.height));
}
@end
// This view always takes the size of its superview. It is intended to be used
// as a NSWindow's contentView. It is needed because NSWindow's implementation
// explicitly resizes the contentView at inopportune times.
@@ -1037,7 +1089,8 @@ bool NativeWindowMac::HasShadow() {
}
void NativeWindowMac::SetOpacity(const double opacity) {
[window_ setAlphaValue:opacity];
const double boundedOpacity = base::ClampToRange(opacity, 0.0, 1.0);
[window_ setAlphaValue:boundedOpacity];
}
double NativeWindowMac::GetOpacity() {
@@ -1484,10 +1537,15 @@ void NativeWindowMac::OverrideNSWindowContentView() {
// `BridgedContentView` as content view, which does not support draggable
// regions. In order to make draggable regions work, we have to replace the
// content view with a simple NSView.
container_view_.reset([[FullSizeContentView alloc] init]);
if (has_frame()) {
container_view_.reset(
[[ElectronAdapatedContentView alloc] initWithShell:this]);
} else {
container_view_.reset([[FullSizeContentView alloc] init]);
[container_view_ setFrame:[[[window_ contentView] superview] bounds]];
}
[container_view_
setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[container_view_ setFrame:[[[window_ contentView] superview] bounds]];
[window_ setContentView:container_view_];
AddContentViewLayers(IsMinimizable(), IsClosable());
}

View File

@@ -26,6 +26,7 @@
#include "atom/common/draggable_region.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/options_switches.h"
#include "base/numerics/ranges.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "native_mate/dictionary.h"
@@ -849,6 +850,7 @@ bool NativeWindowViews::HasShadow() {
void NativeWindowViews::SetOpacity(const double opacity) {
#if defined(OS_WIN)
const double boundedOpacity = base::ClampToRange(opacity, 0.0, 1.0);
HWND hwnd = GetAcceleratedWidget();
if (!layered_) {
LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
@@ -856,9 +858,11 @@ void NativeWindowViews::SetOpacity(const double opacity) {
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
layered_ = true;
}
::SetLayeredWindowAttributes(hwnd, 0, opacity * 255, LWA_ALPHA);
::SetLayeredWindowAttributes(hwnd, 0, boundedOpacity * 255, LWA_ALPHA);
opacity_ = boundedOpacity;
#else
opacity_ = 1.0; // setOpacity unsupported on Linux
#endif
opacity_ = opacity;
}
double NativeWindowViews::GetOpacity() {

View File

@@ -17,9 +17,9 @@
<key>CFBundleIconFile</key>
<string>electron.icns</string>
<key>CFBundleVersion</key>
<string>5.0.9</string>
<string>5.0.11</string>
<key>CFBundleShortVersionString</key>
<string>5.0.9</string>
<string>5.0.11</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
@@ -32,5 +32,9 @@
<true/>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to the microphone</string>
<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera</string>
</dict>
</plist>

View File

@@ -50,8 +50,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,0,9,0
PRODUCTVERSION 5,0,9,0
FILEVERSION 5,0,11,0
PRODUCTVERSION 5,0,11,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -68,12 +68,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Electron"
VALUE "FileVersion", "5.0.9"
VALUE "FileVersion", "5.0.11"
VALUE "InternalName", "electron.exe"
VALUE "LegalCopyright", "Copyright (C) 2015 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "electron.exe"
VALUE "ProductName", "Electron"
VALUE "ProductVersion", "5.0.9"
VALUE "ProductVersion", "5.0.11"
VALUE "SquirrelAwareVersion", "1"
END
END

View File

@@ -174,8 +174,14 @@ bool ScopedDisableResize::disable_resize_ = false;
}
- (void)toggleFullScreenMode:(id)sender {
if (shell_->simple_fullscreen())
shell_->SetSimpleFullScreen(!shell_->IsSimpleFullScreen());
bool is_simple_fs = shell_->IsSimpleFullScreen();
bool always_simple_fs = shell_->always_simple_fullscreen();
// If we're in simple fullscreen mode and trying to exit it
// we need to ensure we exit it properly to prevent a crash
// with NSWindowStyleMaskTitled mode
if (is_simple_fs || always_simple_fs)
shell_->SetSimpleFullScreen(!is_simple_fs);
else
[super toggleFullScreen:sender];
}

View File

@@ -9,6 +9,7 @@
#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/gfx/mac/coordinate_conversion.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"
@@ -116,8 +117,10 @@
{
bool prevent_default = false;
gfx::Rect new_bounds(gfx::Point(sender.frame.origin), gfx::Size(newSize));
shell_->NotifyWindowWillResize(new_bounds, &prevent_default);
NSRect new_bounds = NSMakeRect(sender.frame.origin.x, sender.frame.origin.y,
newSize.width, newSize.height);
shell_->NotifyWindowWillResize(gfx::ScreenRectFromNSRect(new_bounds),
&prevent_default);
if (prevent_default) {
return sender.frame.size;
}

View File

@@ -3,8 +3,7 @@
// found in the LICENSE file.
#include "atom/browser/ui/file_dialog.h"
#include <glib/gi18n.h> // _() macro
#include "atom/browser/ui/util_gtk.h"
#include "atom/browser/native_window_views.h"
#include "atom/browser/unresponsive_suppressor.h"
@@ -43,18 +42,18 @@ class FileChooserDialog {
FileChooserDialog(GtkFileChooserAction action, const DialogSettings& settings)
: parent_(static_cast<atom::NativeWindowViews*>(settings.parent_window)),
filters_(settings.filters) {
const char* confirm_text = _("_OK");
const char* confirm_text = util_gtk::kOkLabel;
if (!settings.button_label.empty())
confirm_text = settings.button_label.c_str();
else if (action == GTK_FILE_CHOOSER_ACTION_SAVE)
confirm_text = _("_Save");
confirm_text = util_gtk::kSaveLabel;
else if (action == GTK_FILE_CHOOSER_ACTION_OPEN)
confirm_text = _("_Open");
confirm_text = util_gtk::kOpenLabel;
dialog_ = gtk_file_chooser_dialog_new(
settings.title.c_str(), NULL, action, _("_Cancel"), GTK_RESPONSE_CANCEL,
confirm_text, GTK_RESPONSE_ACCEPT, NULL);
settings.title.c_str(), NULL, action, util_gtk::kCancelLabel,
GTK_RESPONSE_CANCEL, confirm_text, GTK_RESPONSE_ACCEPT, NULL);
if (parent_) {
parent_->SetEnabled(false);
libgtkui::SetGtkTransientForAura(dialog_, parent_->GetNativeWindow());

View File

@@ -9,6 +9,7 @@
#include "atom/browser/browser.h"
#include "atom/browser/native_window_observer.h"
#include "atom/browser/native_window_views.h"
#include "atom/browser/ui/util_gtk.h"
#include "atom/browser/unresponsive_suppressor.h"
#include "base/callback.h"
#include "base/strings/string_util.h"
@@ -127,13 +128,13 @@ class GtkMessageBox : public NativeWindowObserver {
const char* TranslateToStock(int id, const std::string& text) {
const std::string lower = base::ToLowerASCII(text);
if (lower == "cancel")
return _("_Cancel");
return util_gtk::kCancelLabel;
if (lower == "no")
return _("_No");
return util_gtk::kNoLabel;
if (lower == "ok")
return _("_OK");
return util_gtk::kOkLabel;
if (lower == "yes")
return _("_Yes");
return util_gtk::kYesLabel;
return text.c_str();
}
@@ -237,8 +238,8 @@ void ShowMessageBox(NativeWindow* parent,
void ShowErrorBox(const base::string16& title, const base::string16& content) {
if (Browser::Get()->is_ready()) {
GtkMessageBox(nullptr, MESSAGE_BOX_TYPE_ERROR, {"OK"}, -1, 0, "Error",
base::UTF16ToUTF8(title).c_str(),
GtkMessageBox(nullptr, MESSAGE_BOX_TYPE_ERROR, {util_gtk::kOkLabel}, -1, 0,
"Error", base::UTF16ToUTF8(title).c_str(),
base::UTF16ToUTF8(content).c_str(), "", false,
gfx::ImageSkia())
.RunSynchronous();

View File

@@ -0,0 +1,36 @@
// Copyright (c) 2019 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/ui/util_gtk.h"
#include <gtk/gtk.h>
namespace util_gtk {
// Copied from L40-L55 in
// https://cs.chromium.org/chromium/src/chrome/browser/ui/libgtkui/select_file_dialog_impl_gtk.cc
#if GTK_CHECK_VERSION(3, 90, 0)
// GTK stock items have been deprecated. The docs say to switch to using the
// strings "_Open", etc. However this breaks i18n. We could supply our own
// internationalized strings, but the "_" in these strings is significant: it's
// the keyboard shortcut to select these actions. TODO: Provide
// internationalized strings when GTK provides support for it.
const char* const kCancelLabel = "_Cancel";
const char* const kNoLabel = "_No";
const char* const kOkLabel = "_OK";
const char* const kOpenLabel = "_Open";
const char* const kSaveLabel = "_Save";
const char* const kYesLabel = "_Yes";
#else
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
const char* const kCancelLabel = GTK_STOCK_CANCEL;
const char* const kNoLabel = GTK_STOCK_NO;
const char* const kOkLabel = GTK_STOCK_OK;
const char* const kOpenLabel = GTK_STOCK_OPEN;
const char* const kSaveLabel = GTK_STOCK_SAVE;
const char* const kYesLabel = GTK_STOCK_YES;
G_GNUC_END_IGNORE_DEPRECATIONS
#endif
} // namespace util_gtk

View File

@@ -0,0 +1,21 @@
// Copyright (c) 2019 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_UI_UTIL_GTK_H_
#define ATOM_BROWSER_UI_UTIL_GTK_H_
namespace util_gtk {
/* These are `const char*` rather than the project-preferred `const char[]`
because they must fit the type of an external dependency */
extern const char* const kCancelLabel;
extern const char* const kNoLabel;
extern const char* const kOkLabel;
extern const char* const kOpenLabel;
extern const char* const kSaveLabel;
extern const char* const kYesLabel;
} // namespace util_gtk
#endif // ATOM_BROWSER_UI_UTIL_GTK_H_

View File

@@ -252,9 +252,6 @@ void MenuBar::OnMenuButtonClicked(views::MenuButton* source,
return;
}
GetFocusManager()->SetFocusedViewWithReason(
source, views::FocusManager::kReasonFocusTraversal);
// Deleted in MenuDelegate::OnMenuClosed
MenuDelegate* menu_delegate = new MenuDelegate(this);
menu_delegate->RunMenu(menu_model_->GetSubmenuModelAt(id), source,

View File

@@ -7,7 +7,7 @@
#define ATOM_MAJOR_VERSION 5
#define ATOM_MINOR_VERSION 0
#define ATOM_PATCH_VERSION 9
#define ATOM_PATCH_VERSION 11
// clang-format off
// #define ATOM_PRE_RELEASE_VERSION
// clang-format on

View File

@@ -1345,20 +1345,16 @@ screen readers
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
convey some sort of application status or to passively notify the user.
#### `win.setHasShadow(hasShadow)` _macOS_
#### `win.setHasShadow(hasShadow)`
* `hasShadow` Boolean
Sets whether the window should have a shadow. On Windows and Linux does
nothing.
Sets whether the window should have a shadow.
#### `win.hasShadow()` _macOS_
#### `win.hasShadow()`
Returns `Boolean` - Whether the window has a shadow.
On Windows and Linux always returns
`true`.
#### `win.setOpacity(opacity)` _Windows_ _macOS_
* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque)

View File

@@ -9,16 +9,12 @@ it is therefore not available when this module is disabled.
The following example shows how to write a string to the clipboard:
```javascript
const { clipboard } = require('electron')
clipboard.writeText('Example String')
```
On Linux, there is also a `selection` clipboard. To manipulate it
you need to pass `selection` to each method:
```javascript
const { clipboard } = require('electron')
clipboard.writeText('Example String', 'selection')
console.log(clipboard.readText('selection'))
```
@@ -31,56 +27,106 @@ The `clipboard` module has the following methods:
### `clipboard.readText([type])`
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String` - The content in the clipboard as plain text.
```js
const { clipboard } = require('electron')
clipboard.writeText('hello i am a bit of text!')
const text = clipboard.readText()
console.log(text)
// hello i am a bit of text!'
```
### `clipboard.writeText(text[, type])`
* `text` String
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `text` into the clipboard as plain text.
```js
const { clipboard } = require('electron')
const text = 'hello i am a bit of text!'
clipboard.writeText(text)
```
### `clipboard.readHTML([type])`
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String` - The content in the clipboard as markup.
```js
const { clipboard } = require('electron')
clipboard.writeHTML('<b>Hi</b>')
const html = clipboard.readHTML()
console.log(html)
// <meta charset='utf-8'><b>Hi</b>
```
### `clipboard.writeHTML(markup[, type])`
* `markup` String
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes `markup` to the clipboard.
```js
const { clipboard } = require('electron')
clipboard.writeHTML('<b>Hi</b')
```
### `clipboard.readImage([type])`
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns [`NativeImage`](native-image.md) - The image content in the clipboard.
### `clipboard.writeImage(image[, type])`
* `image` [NativeImage](native-image.md)
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes `image` to the clipboard.
### `clipboard.readRTF([type])`
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String` - The content in the clipboard as RTF.
```js
const { clipboard } = require('electron')
clipboard.writeRTF('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\nThis is some {\\b bold} text.\\par\n}')
const rtf = clipboard.readRTF()
console.log(rtf)
// {\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\nThis is some {\\b bold} text.\\par\n}
```
### `clipboard.writeRTF(text[, type])`
* `text` String
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `text` into the clipboard in RTF.
```js
const { clipboard } = require('electron')
const rtf = '{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\nThis is some {\\b bold} text.\\par\n}'
clipboard.writeRTF(rtf)
```
### `clipboard.readBookmark()` _macOS_ _Windows_
Returns `Object`:
@@ -96,7 +142,7 @@ bookmark is unavailable.
* `title` String
* `url` String
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `title` and `url` into the clipboard as a bookmark.
@@ -105,7 +151,9 @@ you can use `clipboard.write` to write both a bookmark and fallback text to the
clipboard.
```js
clipboard.write({
const { clipboard } = require('electron')
clipboard.writeBookmark({
text: 'https://electronjs.org',
bookmark: 'Electron Homepage'
})
@@ -113,39 +161,50 @@ clipboard.write({
### `clipboard.readFindText()` _macOS_
Returns `String` - The text on the find pasteboard. This method uses synchronous
IPC when called from the renderer process. The cached value is reread from the
find pasteboard whenever the application is activated.
Returns `String` - The text on the find pasteboard, which is the pasteboard that holds information about the current state of the active applications find panel.
This method uses synchronous IPC when called from the renderer process.
The cached value is reread from the find pasteboard whenever the application is activated.
### `clipboard.writeFindText(text)` _macOS_
* `text` String
Writes the `text` into the find pasteboard as plain text. This method uses
synchronous IPC when called from the renderer process.
Writes the `text` into the find pasteboard (the pasteboard that holds information about the current state of the active applications find panel) as plain text. This method uses synchronous IPC when called from the renderer process.
### `clipboard.clear([type])`
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Clears the clipboard content.
### `clipboard.availableFormats([type])`
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `String[]` - An array of supported formats for the clipboard `type`.
```js
const { clipboard } = require('electron')
const formats = clipboard.availableFormats()
console.log(formats)
// [ 'text/plain', 'text/html' ]
```
### `clipboard.has(format[, type])` _Experimental_
* `format` String
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Returns `Boolean` - Whether the clipboard supports the specified `format`.
```javascript
```js
const { clipboard } = require('electron')
console.log(clipboard.has('<p>selection</p>'))
const hasFormat = clipboard.has('<p>selection</p>')
console.log(hasFormat)
// 'true' or 'false
```
### `clipboard.read(format)` _Experimental_
@@ -160,14 +219,33 @@ Returns `String` - Reads `format` type from the clipboard.
Returns `Buffer` - Reads `format` type from the clipboard.
```js
const { clipboard } = require('electron')
const buffer = Buffer.from('this is binary', 'utf8')
clipboard.writeBuffer('public.utf8-plain-text', buffer)
const ret = clipboard.readBuffer('public.utf8-plain-text')
console.log(buffer.equals(out))
// true
```
### `clipboard.writeBuffer(format, buffer[, type])` _Experimental_
* `format` String
* `buffer` Buffer
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
Writes the `buffer` into the clipboard as `format`.
```js
const { clipboard } = require('electron')
const buffer = Buffer.from('writeBuffer', 'utf8')
clipboard.writeBuffer('public.utf8-plain-text', buffer)
```
### `clipboard.write(data[, type])`
* `data` Object
@@ -175,11 +253,30 @@ Writes the `buffer` into the clipboard as `format`.
* `html` String (optional)
* `image` [NativeImage](native-image.md) (optional)
* `rtf` String (optional)
* `bookmark` String (optional) - The title of the url at `text`.
* `type` String (optional) - Can be `selection` or `clipboard`. `selection` is only available on Linux.
* `bookmark` String (optional) - The title of the URL at `text`.
* `type` String (optional) - Can be `selection` or `clipboard`; default is 'clipboard'. `selection` is only available on Linux.
```javascript
const { clipboard } = require('electron')
clipboard.write({ text: 'test', html: '<b>test</b>' })
```
Writes `data` to the clipboard.
```js
const { clipboard } = require('electron')
clipboard.write({
text: 'test',
html: '<b>Hi</b>',
rtf: '{\\rtf1\\utf8 text}',
bookmark: 'a title'
})
console.log(clipboard.readText())
// 'test'
console.log(clipboard.readHTML())
// <meta charset='utf-8'><b>Hi</b>
console.log(clipboard.readRTF())
// '{\\rtf1\\utf8 text}'
console.log(clipboard.readBookmark())
// { title: 'a title', url: 'test' }
```

View File

@@ -137,7 +137,7 @@ will be passed via `callback(filename)`.
inspected only when using `callback`.
* `checkboxChecked` Boolean (optional) - Initial checked state of the
checkbox. `false` by default.
* `icon` [NativeImage](native-image.md) (optional)
* `icon` ([NativeImage](native-image.md) | String) (optional)
* `cancelId` Integer (optional) - The index of the button to be used to cancel the dialog, via
the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the
label. If no such labeled buttons exist and this option is not set, `0` will be used as the

View File

@@ -23,7 +23,7 @@
<!-- Desktop Capturer API -->
<message name="IDS_DESKTOP_MEDIA_PICKER_SINGLE_SCREEN_NAME" desc="Name for screens in the desktop media picker UI when there is only one monitor.">
Entire screen
Entire Screen
</message>
<message name="IDS_DESKTOP_MEDIA_PICKER_MULTIPLE_SCREEN_NAME" desc="Name for screens in the desktop media picker UI when there are multiple monitors.">
{SCREEN_INDEX, plural, =1{Screen #} other{Screen #}}

View File

@@ -454,6 +454,8 @@ filenames = {
"atom/browser/ui/tray_icon_cocoa.mm",
"atom/browser/ui/tray_icon_observer.h",
"atom/browser/ui/tray_icon_win.cc",
"atom/browser/ui/util_gtk.cc",
"atom/browser/ui/util_gtk.h",
"atom/browser/ui/views/atom_views_delegate.cc",
"atom/browser/ui/views/atom_views_delegate.h",
"atom/browser/ui/views/autofill_popup_view.cc",

View File

@@ -34,7 +34,7 @@ class Port {
})
ipcRenderer.on(`CHROME_PORT_POSTMESSAGE_${portId}`, (event, message) => {
const sendResponse = function () { console.error('sendResponse is not implemented') }
this.onMessage.emit(message, this.sender, sendResponse)
this.onMessage.emit(JSON.parse(message), this.sender, sendResponse)
})
}
@@ -46,7 +46,7 @@ class Port {
}
postMessage (message) {
ipcRenderer.sendToAll(this.tabId, `CHROME_PORT_POSTMESSAGE_${this.portId}`, message)
ipcRenderer.sendToAll(this.tabId, `CHROME_PORT_POSTMESSAGE_${this.portId}`, JSON.stringify(message))
}
_onDisconnect () {

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "5.0.9",
"version": "5.0.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "5.0.9",
"version": "5.0.11",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {

View File

@@ -79,4 +79,5 @@ unsandboxed_ppapi_processes_skip_zygote.patch
autofill_size_calculation.patch
disable_detach_webview_frame.patch
chore_add_debounce_on_the_updatewebcontentsvisibility_method_to.patch
fix_use_weakptr_to_detect_deletion.patch
fix_use_weakptr_to_detect_deletion.patch
fix_add_more_checks_in_mojocdmservice.patch

View File

@@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Pedro Pontes <pepontes@microsoft.com>
Date: Thu, 12 Sep 2019 16:28:47 +0200
Subject: fix: Add more checks in MojoCdmService.
Applies https://chromium.googlesource.com/chromium/src.git/+/b7b305f3389017cc42e2cfac6e7a319f42d5bde3%5E%21/
diff --git a/media/mojo/services/mojo_cdm_service.cc b/media/mojo/services/mojo_cdm_service.cc
index 3334ac0f6d3a03b0df879b5b015e95de307c1cda..a49ac813b0f8540fadf2c3cccdcc36a6a504d4cd 100644
--- a/media/mojo/services/mojo_cdm_service.cc
+++ b/media/mojo/services/mojo_cdm_service.cc
@@ -60,7 +60,9 @@ void MojoCdmService::Initialize(const std::string& key_system,
const CdmConfig& cdm_config,
InitializeCallback callback) {
DVLOG(1) << __func__ << ": " << key_system;
- DCHECK(!cdm_);
+
+ CHECK(!has_initialize_been_called_) << "Initialize should only happen once";
+ has_initialize_been_called_ = true;
auto weak_this = weak_factory_.GetWeakPtr();
cdm_factory_->Create(
@@ -154,6 +156,7 @@ void MojoCdmService::OnCdmCreated(
return;
}
+ CHECK(!cdm_) << "CDM should only be created once.";
cdm_ = cdm;
if (context_) {
diff --git a/media/mojo/services/mojo_cdm_service.h b/media/mojo/services/mojo_cdm_service.h
index c8de5534202ac8de99be3bc52766f48c3e10b95a..bfe7baf10bb8642e7c6ce79c8a4e86942909a56a 100644
--- a/media/mojo/services/mojo_cdm_service.h
+++ b/media/mojo/services/mojo_cdm_service.h
@@ -101,6 +101,8 @@ class MEDIA_MOJO_EXPORT MojoCdmService : public mojom::ContentDecryptionModule {
// Callback for when |decryptor_| loses connectivity.
void OnDecryptorConnectionError();
+ bool has_initialize_been_called_ = false;
+
CdmFactory* cdm_factory_;
MojoCdmServiceContext* const context_ = nullptr;
scoped_refptr<::media::ContentDecryptionModule> cdm_;

View File

@@ -41,7 +41,7 @@ index d439dfbb603876f942ff40fe1a505f9498f57c23..fd576eb894e06fe6c5cb21351b2b95b0
// another SiteInstance for the same site.
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 0e3fc30fae933e0493920ed1823b086ac6ceee61..6dbb73c964601f0dae7ef6460a0ae2a048634a35 100644
index 0e3fc30fae933e0493920ed1823b086ac6ceee61..943d1290cfb4b51129e4c0fa1c1f268b808cd37e 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1984,6 +1984,16 @@ bool RenderFrameHostManager::InitRenderView(
@@ -61,11 +61,12 @@ index 0e3fc30fae933e0493920ed1823b086ac6ceee61..6dbb73c964601f0dae7ef6460a0ae2a0
// First, check if the navigation can switch SiteInstances. If not, the
// navigation should use the current SiteInstance.
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
@@ -2016,6 +2026,51 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2016,6 +2026,57 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request.common_params().url);
no_renderer_swap_allowed |=
request.from_begin_navigation() && !can_renderer_initiate_transfer;
+
+ bool has_navigation_started = request.state() != NavigationRequest::NOT_STARTED;
+ bool has_response_started =
+ (request.state() == NavigationRequest::RESPONSE_STARTED ||
+ request.state() == NavigationRequest::FAILED) &&
@@ -73,11 +74,12 @@ index 0e3fc30fae933e0493920ed1823b086ac6ceee61..6dbb73c964601f0dae7ef6460a0ae2a0
+ // Gives user a chance to choose a custom site instance.
+ SiteInstance* affinity_site_instance = nullptr;
+ scoped_refptr<SiteInstance> overriden_site_instance;
+ bool should_register_site_instance = false;
+ ContentBrowserClient::SiteInstanceForNavigationType siteInstanceType =
+ GetContentClient()->browser()->ShouldOverrideSiteInstanceForNavigation(
+ current_frame_host(), speculative_frame_host(), browser_context,
+ request.common_params().url, has_response_started,
+ &affinity_site_instance);
+ request.common_params().url, has_navigation_started,
+ has_response_started, &affinity_site_instance);
+ switch (siteInstanceType) {
+ case ContentBrowserClient::SiteInstanceForNavigationType::
+ FORCE_CANDIDATE_OR_NEW:
@@ -86,6 +88,12 @@ index 0e3fc30fae933e0493920ed1823b086ac6ceee61..6dbb73c964601f0dae7ef6460a0ae2a0
+ ? candidate_site_instance
+ : current_site_instance->CreateRelatedSiteInstance(
+ request.common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_NEW:
+ overriden_site_instance = current_site_instance->CreateRelatedSiteInstance(
+ request.common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_CURRENT:
+ overriden_site_instance = render_frame_host_->GetSiteInstance();
@@ -102,9 +110,7 @@ index 0e3fc30fae933e0493920ed1823b086ac6ceee61..6dbb73c964601f0dae7ef6460a0ae2a0
+ break;
+ }
+ if (overriden_site_instance) {
+ if (siteInstanceType ==
+ ContentBrowserClient::SiteInstanceForNavigationType::
+ FORCE_CANDIDATE_OR_NEW) {
+ if (should_register_site_instance) {
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
+ render_frame_host_.get(), overriden_site_instance.get());
+ }
@@ -113,7 +119,7 @@ index 0e3fc30fae933e0493920ed1823b086ac6ceee61..6dbb73c964601f0dae7ef6460a0ae2a0
} else {
// Subframe navigations will use the current renderer, unless specifically
// allowed to swap processes.
@@ -2027,23 +2082,17 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2027,23 +2088,17 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
if (no_renderer_swap_allowed && !should_swap_for_error_isolation)
return scoped_refptr<SiteInstance>(current_site_instance);
@@ -169,10 +175,10 @@ index da2696d679953096356e0c73891ff97854f76b54..c4c8e29a7723c4a22e6e52bd2f9ff792
size_t GetRelatedActiveContentsCount() override;
bool RequiresDedicatedProcess() override;
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 64c4d9eb2dfb8f53f7a6c8f00140b0cf22f18a49..0aff71c4339d0eacecf6b6d86ab750738696c31e 100644
index 64c4d9eb2dfb8f53f7a6c8f00140b0cf22f18a49..c9cf67e0408c388aee574f36f63b822f31f72e5f 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -48,6 +48,16 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
@@ -48,6 +48,17 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
handle);
}
@@ -181,6 +187,7 @@ index 64c4d9eb2dfb8f53f7a6c8f00140b0cf22f18a49..0aff71c4339d0eacecf6b6d86ab75073
+ content::RenderFrameHost* speculative_rfh,
+ content::BrowserContext* browser_context,
+ const GURL& url,
+ bool has_navigation_started,
+ bool has_request_started,
+ content::SiteInstance** affinity_site_instance) const {
+ return SiteInstanceForNavigationType::ASK_CHROMIUM;
@@ -190,10 +197,10 @@ index 64c4d9eb2dfb8f53f7a6c8f00140b0cf22f18a49..0aff71c4339d0eacecf6b6d86ab75073
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index fdb9d7b8859270b36453e25349f7d84c44a6ce92..9f0a966d8abf72b606906b14f00748b4466f8b0a 100644
index fdb9d7b8859270b36453e25349f7d84c44a6ce92..6b6a8047d6d479bebbfde792eaa0861eb547413e 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -206,8 +206,37 @@ CONTENT_EXPORT void OverrideOnBindInterface(
@@ -206,8 +206,41 @@ CONTENT_EXPORT void OverrideOnBindInterface(
// the observer interfaces.)
class CONTENT_EXPORT ContentBrowserClient {
public:
@@ -206,6 +213,9 @@ index fdb9d7b8859270b36453e25349f7d84c44a6ce92..9f0a966d8abf72b606906b14f00748b4
+ // Use the current site instance for the navigation.
+ FORCE_CURRENT,
+
+ // Use a new, unrelated site instance.
+ FORCE_NEW,
+
+ // Use the provided affinity site instance for the navigation.
+ FORCE_AFFINITY,
+
@@ -220,6 +230,7 @@ index fdb9d7b8859270b36453e25349f7d84c44a6ce92..9f0a966d8abf72b606906b14f00748b4
+ content::RenderFrameHost* speculative_rfh,
+ content::BrowserContext* browser_context,
+ const GURL& url,
+ bool has_navigation_started,
+ bool has_request_started,
+ content::SiteInstance** affinity_site_instance) const;
+

View File

@@ -47,7 +47,7 @@ index 961e1560aa914942c01372c354059d6d6b72c50f..5e364fa6637e8453b0be701637c7d5b9
void PrintJobWorker::GetSettingsWithUI(
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 007b003dd58d44acd6e1351c237fca6463d90602..da7c14d03a740e5d2ca2099a15c6105b74c101b4 100644
index 007b003dd58d44acd6e1351c237fca6463d90602..e2f7e5f0936292b84c021a70d4800065645aef6a 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -27,10 +27,7 @@
@@ -176,16 +176,19 @@ index 007b003dd58d44acd6e1351c237fca6463d90602..da7c14d03a740e5d2ca2099a15c6105b
if (!print_job_)
return;
@@ -604,7 +612,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -603,8 +611,9 @@ void PrintViewManagerBase::ReleasePrintJob() {
rfh->Send(msg.release());
}
registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- content::Source<PrintJob>(print_job_.get()));
+ content::NotificationService::AllSources());
+ if (!callback_.is_null())
+ registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
+ content::NotificationService::AllSources());
// Don't close the worker thread.
print_job_ = nullptr;
}
@@ -678,6 +686,10 @@ bool PrintViewManagerBase::PrintNowInternal(
@@ -678,6 +687,10 @@ bool PrintViewManagerBase::PrintNowInternal(
// Don't print / print preview interstitials or crashed tabs.
if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed())
return false;

View File

@@ -7,6 +7,7 @@ from lib.util import execute, get_out_dir
LINUX_BINARIES_TO_STRIP = [
'electron',
'chrome-sandbox',
'libffmpeg.so',
'libGLESv2.so',
'libEGL.so',

View File

@@ -52,7 +52,8 @@ function uploadToGitHub () {
octokit.repos.listAssetsForRelease({
owner: 'electron',
repo: targetRepo,
release_id: releaseId
release_id: releaseId,
per_page: 100
}).then(assets => {
console.log('Got list of assets for existing release:')
console.log(JSON.stringify(assets.data, null, ' '))

View File

@@ -1172,23 +1172,51 @@ describe('BrowserWindow module', () => {
})
describe('BrowserWindow.setOpacity(opacity)', () => {
it('make window with initial opacity', () => {
w.destroy()
w = new BrowserWindow({
show: false,
width: 400,
height: 400,
opacity: 0.5
describe('Windows and Mac', () => {
before(function () {
if (process.platform === 'linux') {
this.skip()
}
})
assert.strictEqual(w.getOpacity(), 0.5)
})
it('allows setting the opacity', () => {
assert.doesNotThrow(() => {
w.setOpacity(0.0)
assert.strictEqual(w.getOpacity(), 0.0)
w.setOpacity(0.5)
it('makes a window with initial opacity', () => {
w.destroy()
w = new BrowserWindow({ show: false, opacity: 0.5 })
assert.strictEqual(w.getOpacity(), 0.5)
w.setOpacity(1.0)
})
it('allows setting the opacity', () => {
assert.doesNotThrow(() => {
w.setOpacity(0.0)
assert.strictEqual(w.getOpacity(), 0.0)
w.setOpacity(0.5)
assert.strictEqual(w.getOpacity(), 0.5)
w.setOpacity(1.0)
assert.strictEqual(w.getOpacity(), 1.0)
})
})
it('clamps opacity to [0.0...1.0]', () => {
w.setOpacity(100)
assert.strictEqual(w.getOpacity(), 1.0)
w.setOpacity(-100)
assert.strictEqual(w.getOpacity(), 0.0)
})
})
describe('Linux', () => {
before(function () {
if (process.platform !== 'linux') {
this.skip()
}
})
it('sets 1 regardless of parameter', () => {
w.destroy()
w = new BrowserWindow({ show: false, opacity: 0.5 })
w.setOpacity(0)
assert.strictEqual(w.getOpacity(), 1.0)
w.setOpacity(0.5)
assert.strictEqual(w.getOpacity(), 1.0)
})
})
@@ -2980,6 +3008,17 @@ describe('BrowserWindow module', () => {
w.setFullScreen(true)
})
it('does not crash when exiting simpleFullScreen', (done) => {
w.destroy()
w = new BrowserWindow()
w.setSimpleFullScreen(true)
setTimeout(() => {
w.setFullScreen(!w.isFullScreen())
done()
}, 1000)
})
it('should not be changed by setKiosk method', (done) => {
w.destroy()
w = new BrowserWindow()
@@ -3015,23 +3054,29 @@ describe('BrowserWindow module', () => {
})
describe('hasShadow state', () => {
// On Window there is no shadow by default and it can not be changed
// dynamically.
beforeEach(() => { w.destroy() })
it('returns a boolean on all platforms', () => {
w = new BrowserWindow({ show: false })
const hasShadow = w.hasShadow()
assert.strictEqual(typeof hasShadow, 'boolean')
})
it('can be changed with hasShadow option', () => {
w.destroy()
const hasShadow = process.platform !== 'darwin'
w = new BrowserWindow({ show: false, hasShadow: hasShadow })
w = new BrowserWindow({ show: false, hasShadow })
assert.strictEqual(w.hasShadow(), hasShadow)
})
it('can be changed with setHasShadow method', () => {
if (process.platform !== 'darwin') return
w = new BrowserWindow({ show: false })
assert.strictEqual(w.hasShadow(), true)
w.setHasShadow(false)
assert.strictEqual(w.hasShadow(), false)
w.setHasShadow(true)
assert.strictEqual(w.hasShadow(), true)
w.setHasShadow(false)
assert.strictEqual(w.hasShadow(), false)
})
})
})

View File

@@ -38,8 +38,9 @@ describe('WebContentsView', () => {
const appPath = path.join(__dirname, 'fixtures', 'api', 'leak-exit-webcontentsview.js')
const electronPath = remote.getGlobal('process').execPath
const appProcess = ChildProcess.spawn(electronPath, [appPath])
const [code] = await emittedOnce(appProcess, 'close')
const [code, message] = await emittedOnce(appProcess, 'close')
expect(code).to.equal(0)
expect(message).to.be.null()
})
})
})

View File

@@ -3,5 +3,8 @@ app.on('ready', function () {
const web = webContents.create({})
new WebContentsView(web) // eslint-disable-line
process.nextTick(() => app.quit())
process.nextTick(() => {
console.log('Quitting app')
app.quit()
})
})

View File

@@ -2,6 +2,7 @@ resources:
containers:
- container: arm32v7-test-container
image: electronbuilds/arm32v7:0.0.2
options: --shm-size 128m
jobs:
- job: Test_Arm32v7

View File

@@ -1,9 +1,8 @@
resources:
containers:
- container: arm64v8-test-container
image: electronbuilds/arm64v8:0.0.4
env:
RUN_NATIVE_MKSNAPSHOT: true
image: electronbuilds/arm64v8:0.0.5
options: --shm-size 128m
jobs:
- job: Test_Arm64