chore: bump chromium to 28254008f9e7a2aea5d4426906bfd (master) (#22025)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Electron Bot 2020-02-05 23:05:30 -08:00 committed by GitHub
parent c8fe25e109
commit 42a9d72ce1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 142 additions and 132 deletions

View file

@ -767,17 +767,18 @@ void SetSpellCheckerDictionaryDownloadURL(gin_helper::ErrorThrower thrower,
}
bool Session::AddWordToSpellCheckerDictionary(const std::string& word) {
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
if (spellcheck::UseBrowserSpellChecker()) {
spellcheck_platform::AddWord(base::UTF8ToUTF16(word));
}
#endif
SpellcheckService* spellcheck =
SpellcheckService* service =
SpellcheckServiceFactory::GetForContext(browser_context_.get());
if (!spellcheck)
if (!service)
return false;
return spellcheck->GetCustomDictionary()->AddWord(word);
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
if (spellcheck::UseBrowserSpellChecker()) {
spellcheck_platform::AddWord(service->platform_spell_checker(),
base::UTF8ToUTF16(word));
}
#endif
return service->GetCustomDictionary()->AddWord(word);
}
#endif

View file

@ -38,30 +38,30 @@ struct Converter<URLPattern> {
};
template <>
struct Converter<content::ResourceType> {
struct Converter<blink::mojom::ResourceType> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
content::ResourceType type) {
blink::mojom::ResourceType type) {
const char* result;
switch (type) {
case content::ResourceType::kMainFrame:
case blink::mojom::ResourceType::kMainFrame:
result = "mainFrame";
break;
case content::ResourceType::kSubFrame:
case blink::mojom::ResourceType::kSubFrame:
result = "subFrame";
break;
case content::ResourceType::kStylesheet:
case blink::mojom::ResourceType::kStylesheet:
result = "stylesheet";
break;
case content::ResourceType::kScript:
case blink::mojom::ResourceType::kScript:
result = "script";
break;
case content::ResourceType::kImage:
case blink::mojom::ResourceType::kImage:
result = "image";
break;
case content::ResourceType::kObject:
case blink::mojom::ResourceType::kObject:
result = "object";
break;
case content::ResourceType::kXhr:
case blink::mojom::ResourceType::kXhr:
result = "xhr";
break;
default:

View file

@ -77,6 +77,11 @@ void BrowserProcessImpl::ApplyProxyModeFromCommandLine(
}
}
BuildState* BrowserProcessImpl::GetBuildState() {
NOTIMPLEMENTED();
return nullptr;
}
void BrowserProcessImpl::PostEarlyInitialization() {
// Mock user prefs, as we only need to track changes for a
// in memory pref store. There are no persistent preferences

View file

@ -38,6 +38,7 @@ class BrowserProcessImpl : public BrowserProcess {
static void ApplyProxyModeFromCommandLine(ValueMapPrefStore* pref_store);
BuildState* GetBuildState() override;
void PostEarlyInitialization();
void PreCreateThreads();
void PostDestroyThreads() {}

View file

@ -143,7 +143,7 @@ void ElectronExtensionsBrowserClient::LoadResourceFromResourceBundle(
namespace {
bool AllowCrossRendererResourceLoad(const GURL& url,
content::ResourceType resource_type,
blink::mojom::ResourceType resource_type,
ui::PageTransition page_transition,
int child_id,
bool is_incognito,
@ -174,7 +174,7 @@ bool AllowCrossRendererResourceLoad(const GURL& url,
bool ElectronExtensionsBrowserClient::AllowCrossRendererResourceLoad(
const GURL& url,
content::ResourceType resource_type,
blink::mojom::ResourceType resource_type,
ui::PageTransition page_transition,
int child_id,
bool is_incognito,

View file

@ -14,6 +14,7 @@
#include "build/build_config.h"
#include "extensions/browser/extensions_browser_client.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
class PrefService;
@ -70,7 +71,7 @@ class ElectronExtensionsBrowserClient
bool send_cors_header) override;
bool AllowCrossRendererResourceLoad(
const GURL& url,
content::ResourceType resource_type,
blink::mojom::ResourceType resource_type,
ui::PageTransition page_transition,
int child_id,
bool is_incognito,

View file

@ -3,8 +3,6 @@
// found in the LICENSE file.
#include "shell/browser/ui/x/window_state_watcher.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/x11.h"
#include "ui/gfx/x/x11_atom_cache.h"
@ -12,22 +10,22 @@ namespace electron {
WindowStateWatcher::WindowStateWatcher(NativeWindowViews* window)
: window_(window), widget_(window->GetAcceleratedWidget()) {
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
ui::X11EventSource::GetInstance()->AddXEventObserver(this);
}
WindowStateWatcher::~WindowStateWatcher() {
ui::PlatformEventSource::GetInstance()->RemovePlatformEventObserver(this);
ui::X11EventSource::GetInstance()->RemoveXEventObserver(this);
}
void WindowStateWatcher::WillProcessEvent(const ui::PlatformEvent& event) {
if (IsWindowStateEvent(event)) {
void WindowStateWatcher::WillProcessXEvent(XEvent* xev) {
if (IsWindowStateEvent(xev)) {
was_minimized_ = window_->IsMinimized();
was_maximized_ = window_->IsMaximized();
}
}
void WindowStateWatcher::DidProcessEvent(const ui::PlatformEvent& event) {
if (IsWindowStateEvent(event)) {
void WindowStateWatcher::DidProcessXEvent(XEvent* xev) {
if (IsWindowStateEvent(xev)) {
bool is_minimized = window_->IsMinimized();
bool is_maximized = window_->IsMaximized();
bool is_fullscreen = window_->IsFullscreen();
@ -55,10 +53,10 @@ void WindowStateWatcher::DidProcessEvent(const ui::PlatformEvent& event) {
}
}
bool WindowStateWatcher::IsWindowStateEvent(const ui::PlatformEvent& event) {
::Atom changed_atom = event->xproperty.atom;
bool WindowStateWatcher::IsWindowStateEvent(XEvent* xev) {
::Atom changed_atom = xev->xproperty.atom;
return (changed_atom == gfx::GetAtom("_NET_WM_STATE") &&
event->type == PropertyNotify && event->xproperty.window == widget_);
xev->type == PropertyNotify && xev->xproperty.window == widget_);
}
} // namespace electron

View file

@ -5,24 +5,24 @@
#ifndef SHELL_BROWSER_UI_X_WINDOW_STATE_WATCHER_H_
#define SHELL_BROWSER_UI_X_WINDOW_STATE_WATCHER_H_
#include "ui/events/platform/platform_event_observer.h"
#include "ui/events/platform/x11/x11_event_source.h"
#include "shell/browser/native_window_views.h"
namespace electron {
class WindowStateWatcher : public ui::PlatformEventObserver {
class WindowStateWatcher : public ui::XEventObserver {
public:
explicit WindowStateWatcher(NativeWindowViews* window);
~WindowStateWatcher() override;
protected:
// ui::PlatformEventObserver:
void WillProcessEvent(const ui::PlatformEvent& event) override;
void DidProcessEvent(const ui::PlatformEvent& event) override;
// ui::XEventObserver:
void WillProcessXEvent(XEvent* xev) override;
void DidProcessXEvent(XEvent* xev) override;
private:
bool IsWindowStateEvent(const ui::PlatformEvent& event);
bool IsWindowStateEvent(XEvent* xev);
NativeWindowViews* window_;
gfx::AcceleratedWidget widget_;