feat: Upgrade to Chromium 71.0.3578.98 (#15966)

This commit is contained in:
Robo 2019-01-12 06:30:43 +05:30 committed by Jeremy Apthorp
parent 92ddfd0d4c
commit 52fe92d02e
204 changed files with 2291 additions and 1760 deletions

View file

@ -77,18 +77,10 @@
auto* inspectable_web_contents =
inspectableWebContentsView_->inspectable_web_contents();
auto* webContents = inspectable_web_contents->GetWebContents();
auto* devToolsWebContents =
inspectable_web_contents->GetDevToolsWebContents();
auto devToolsView = devToolsWebContents->GetNativeView();
if (visible && devtools_docked_) {
webContents->SetAllowOtherViews(true);
devToolsWebContents->SetAllowOtherViews(true);
} else if (!inspectable_web_contents->IsGuest()) {
webContents->SetAllowOtherViews(false);
}
devtools_visible_ = visible;
if (devtools_docked_) {
if (visible) {

View file

@ -9,6 +9,8 @@
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/accelerators/platform_accelerator_cocoa.h"
@ -124,7 +126,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
isMenuOpen_ = NO;
model_->MenuWillClose();
if (!closeCallback.is_null()) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, closeCallback);
base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI}, closeCallback);
}
}
}
@ -335,7 +337,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Post async task so that itemSelected runs before the close callback
// deletes the controller from the map which deallocates it
if (!closeCallback.is_null()) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, closeCallback);
base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI}, closeCallback);
}
}
}

View file

@ -6,8 +6,8 @@
#define ATOM_BROWSER_UI_COCOA_ATOM_NS_WINDOW_H_
#include "atom/browser/ui/cocoa/event_dispatching_window.h"
#include "ui/views/cocoa/native_widget_mac_nswindow.h"
#include "ui/views/widget/native_widget_mac.h"
#include "ui/views_bridge_mac/native_widget_mac_nswindow.h"
namespace atom {

View file

@ -7,7 +7,7 @@
#include <Quartz/Quartz.h>
#include "ui/views/cocoa/views_nswindow_delegate.h"
#include "ui/views_bridge_mac/views_nswindow_delegate.h"
namespace atom {
class NativeWindowMac;

View file

@ -9,8 +9,8 @@
#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.h"
#include "ui/views/widget/native_widget_mac.h"
#include "ui/views_bridge_mac/bridged_native_widget_impl.h"
@implementation AtomNSWindowDelegate
@ -21,9 +21,8 @@
// on the fly.
// TODO(zcbenz): Add interface in NativeWidgetMac to allow overriding creating
// window delegate.
views::BridgedNativeWidget* bridged_view =
views::NativeWidgetMac::GetBridgeForNativeWindow(
shell->GetNativeWindow());
auto* bridged_view = views::BridgedNativeWidgetImpl::GetFromNativeWindow(
shell->GetNativeWindow());
if ((self = [super initWithBridgedNativeWidget:bridged_view])) {
shell_ = shell;
is_zooming_ = false;
@ -248,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.
views::BridgedNativeWidget* bridged_view =
views::NativeWidgetMac::GetBridgeForNativeWindow(
shell_->GetNativeWindow());
auto* bridged_view = views::BridgedNativeWidgetImpl::GetFromNativeWindow(
shell_->GetNativeWindow());
bridged_view->OnWindowWillClose();
}

View file

@ -22,7 +22,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
#include "content/shell/grit/shell_resources.h"
#include "electron/grit/electron_resources.h"
#include "net/base/net_errors.h"
#include "net/socket/stream_socket.h"
#include "net/socket/tcp_server_socket.h"

View file

@ -4,6 +4,7 @@
#include "atom/browser/ui/devtools_ui.h"
#include <memory>
#include <string>
#include "base/memory/ref_counted_memory.h"
@ -56,6 +57,7 @@ std::string GetMimeTypeForPath(const std::string& path) {
class BundledDataSource : public content::URLDataSource {
public:
BundledDataSource() {}
~BundledDataSource() override {}
// content::URLDataSource implementation.
std::string GetSource() const override { return kChromeUIDevToolsHost; }
@ -104,7 +106,6 @@ class BundledDataSource : public content::URLDataSource {
}
private:
~BundledDataSource() override {}
DISALLOW_COPY_AND_ASSIGN(BundledDataSource);
};
@ -114,7 +115,8 @@ DevToolsUI::DevToolsUI(content::BrowserContext* browser_context,
content::WebUI* web_ui)
: WebUIController(web_ui) {
web_ui->SetBindings(0);
content::URLDataSource::Add(browser_context, new BundledDataSource());
content::URLDataSource::Add(browser_context,
std::make_unique<BundledDataSource>());
}
} // namespace atom

View file

@ -11,8 +11,8 @@
#include "base/callback.h"
#include "base/files/file_util.h"
#include "base/strings/string_util.h"
#include "chrome/browser/ui/libgtkui/gtk_signal.h"
#include "chrome/browser/ui/libgtkui/gtk_util.h"
#include "ui/base/glib/glib_signal.h"
#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
namespace file_dialog {
@ -147,7 +147,11 @@ class FileChooserDialog {
return paths;
}
CHROMEGTK_CALLBACK_1(FileChooserDialog, void, OnFileDialogResponse, int);
CHROMEG_CALLBACK_1(FileChooserDialog,
void,
OnFileDialogResponse,
GtkWidget*,
int);
GtkWidget* dialog() const { return dialog_; }

View file

@ -20,12 +20,15 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/values.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
@ -175,8 +178,8 @@ int ResponseWriter::Write(net::IOBuffer* buffer,
base::Value* id = new base::Value(stream_id_);
base::Value* chunk_value = new base::Value(chunk);
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::PostTaskWithTraits(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&InspectableWebContentsImpl::CallClientFunction, bindings_,
"DevToolsAPI.streamWrite", base::Owned(id),
base::Owned(chunk_value), nullptr));
@ -426,7 +429,7 @@ void InspectableWebContentsImpl::ActivateWindow() {
}
void InspectableWebContentsImpl::CloseWindow() {
GetDevToolsWebContents()->DispatchBeforeUnload();
GetDevToolsWebContents()->DispatchBeforeUnload(false /* auto_cancel */);
}
void InspectableWebContentsImpl::LoadCompleted() {
@ -801,19 +804,20 @@ content::ColorChooser* InspectableWebContentsImpl::OpenColorChooser(
void InspectableWebContentsImpl::RunFileChooser(
content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) {
std::unique_ptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) {
auto* delegate = web_contents_->GetDelegate();
if (delegate)
delegate->RunFileChooser(render_frame_host, params);
delegate->RunFileChooser(render_frame_host, std::move(listener), params);
}
void InspectableWebContentsImpl::EnumerateDirectory(
content::WebContents* source,
int request_id,
std::unique_ptr<content::FileSelectListener> listener,
const base::FilePath& path) {
auto* delegate = web_contents_->GetDelegate();
if (delegate)
delegate->EnumerateDirectory(source, request_id, path);
delegate->EnumerateDirectory(source, std::move(listener), path);
}
void InspectableWebContentsImpl::OnWebContentsFocused(

View file

@ -191,9 +191,10 @@ class InspectableWebContentsImpl
const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions)
override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) override;
std::unique_ptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
void EnumerateDirectory(content::WebContents* source,
int request_id,
std::unique_ptr<content::FileSelectListener> listener,
const base::FilePath& path) override;
// net::URLFetcherDelegate:

View file

@ -13,9 +13,9 @@
#include "base/callback.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/libgtkui/gtk_signal.h"
#include "chrome/browser/ui/libgtkui/gtk_util.h"
#include "chrome/browser/ui/libgtkui/skia_utils_gtk.h"
#include "ui/base/glib/glib_signal.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
@ -168,8 +168,8 @@ class GtkMessageBox : public NativeWindowObserver {
parent_ = nullptr;
}
CHROMEGTK_CALLBACK_1(GtkMessageBox, void, OnResponseDialog, int);
CHROMEGTK_CALLBACK_0(GtkMessageBox, void, OnCheckboxToggled);
CHROMEG_CALLBACK_1(GtkMessageBox, void, OnResponseDialog, GtkWidget*, int);
CHROMEG_CALLBACK_0(GtkMessageBox, void, OnCheckboxToggled, GtkWidget*);
private:
atom::UnresponsiveSuppressor unresponsive_suppressor_;

View file

@ -17,8 +17,10 @@
#include "base/callback.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/threading/thread.h"
#include "base/win/scoped_gdi_object.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "ui/gfx/icon_util.h"
#include "ui/gfx/image/image_skia.h"
@ -222,9 +224,8 @@ void RunMessageBoxInNewThread(base::Thread* thread,
int result = ShowTaskDialogUTF8(parent, type, buttons, default_id, cancel_id,
options, title, message, detail,
checkbox_label, &checkbox_checked, icon);
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(callback, result, checkbox_checked));
base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI},
base::Bind(callback, result, checkbox_checked));
content::BrowserThread::DeleteSoon(content::BrowserThread::UI, FROM_HERE,
thread);
}

View file

@ -201,7 +201,7 @@ void AutofillPopupView::DrawAutofillEntry(gfx::Canvas* canvas,
canvas->DrawStringRectWithFlags(
popup_->GetLabelAt(index), popup_->GetLabelFontListForRow(index),
GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_ResultsTableNormalDimmedText),
ui::NativeTheme::kColorId_ResultsTableDimmedText),
gfx::Rect(label_x_align_left, entry_rect.y(), label_width,
entry_rect.height()),
text_align);

View file

@ -6,6 +6,8 @@
#include "atom/browser/ui/views/menu_bar.h"
#include "atom/browser/ui/views/menu_model_adapter.h"
#include "base/task/post_task.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "ui/views/controls/button/menu_button.h"
#include "ui/views/controls/menu/menu_item_view.h"
@ -130,8 +132,8 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu(
button_to_open_ = button;
// Switching menu asyncnously to avoid crash.
if (!switch_in_progress) {
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::PostTaskWithTraits(
FROM_HERE, {content::BrowserThread::UI},
base::Bind(&views::MenuRunner::Cancel,
base::Unretained(menu_runner_.get())));
}

View file

@ -14,12 +14,14 @@
#include "atom/common/api/api_messages.h"
#include "atom/common/atom_constants.h"
#include "base/sequenced_task_runner_helpers.h"
#include "base/task/post_task.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/loader/resource_request_info_impl.h"
#include "content/browser/loader/stream_resource_handler.h"
#include "content/browser/resource_context_impl.h"
#include "content/browser/streams/stream.h"
#include "content/browser/streams/stream_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
@ -183,8 +185,8 @@ class PdfViewerUI::ResourceRequester
new net::HttpResponseHeaders(headers->raw_headers());
stream_info_->mime_type = mime_type;
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::UI},
base::Bind(&CallMigrationCallback<StreamResponseCallback>,
base::Passed(&stream_response_cb_),
base::Passed(&stream_info_)));
@ -243,8 +245,8 @@ void PdfViewerUI::RenderFrameCreated(content::RenderFrameHost* rfh) {
auto callback =
base::BindOnce(&PdfViewerUI::OnPdfStreamCreated, base::Unretained(this));
resource_requester_ = new ResourceRequester(std::move(callback));
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::IO},
base::Bind(&ResourceRequester::StartRequest, resource_requester_,
GURL(src_), GURL(kPdfViewerUIOrigin), render_process_id,
render_view_id, render_frame_id, resource_context));