Commit 3f71138d authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision a106f0ab (#464641)

- Remove CefWindowInfo.transparent_painting_enabled. Set
  CefBrowserSettings.background_color to an opaque or transparent
  value instead.
parent 2f6475c0
......@@ -140,9 +140,6 @@ assert(!enable_print_preview)
# Enable support for Widevine CDM.
assert(enable_widevine)
# Disable support for plugin installation.
assert(!enable_plugin_installation)
if (is_clang) {
# Don't use the chrome style plugin.
assert(!clang_use_chrome_plugins)
......@@ -595,6 +592,9 @@ static_library("libcef_static") {
# we include Blink headers.
"//third_party/WebKit/public/platform",
"//third_party/WebKit/public/web",
# Crashpad code uses paths relative to this directory.
"//third_party/crashpad/crashpad",
]
public_deps = [
......@@ -753,8 +753,8 @@ static_library("libcef_static") {
]
deps += [
"//build/config/freetype",
"//build/linux:fontconfig",
"//build/linux:freetype2",
]
}
......
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': '939b32ee5ba05c396eef3fd992822fcca9a2e262',
'chromium_checkout': 'a106f0abbf69dad349d4aaf4bcc4f5d376dd2377',
}
......@@ -81,7 +81,6 @@ struct CefWindowInfoTraits {
target->height = src->height;
target->parent_window = src->parent_window;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
target->transparent_painting_enabled = src->transparent_painting_enabled;
target->window = src->window;
}
};
......@@ -114,15 +113,14 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
// monitor info and to act as the parent window for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent window may not function
// correctly. If |transparent| is true a transparent background color will be
// used (RGBA=0x00000000). If |transparent| is false the background will be
// white and opaque. In order to create windowless browsers the
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;
parent_window = parent;
transparent_painting_enabled = transparent;
}
};
......
......@@ -87,7 +87,6 @@ struct CefWindowInfoTraits {
target->hidden = src->hidden;
target->parent_view = src->parent_view;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
target->transparent_painting_enabled = src->transparent_painting_enabled;
target->view = src->view;
}
};
......@@ -121,15 +120,14 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
// monitor info and to act as the parent view for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent view may not function
// correctly. If |transparent| is true a transparent background color will be
// used (RGBA=0x00000000). If |transparent| is false the background will be
// white and opaque. In order to create windowless browsers the
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = true;
parent_view = parent;
transparent_painting_enabled = transparent;
}
};
......
......@@ -401,10 +401,14 @@ typedef struct _cef_settings_t {
int enable_net_security_expiration;
///
// Opaque background color used for accelerated content. By default the
// background color will be white. Only the RGB compontents of the specified
// value will be used. The alpha component must greater than 0 to enable use
// of the background color but will be otherwise ignored.
// Background color used for the browser before a document is loaded and when
// no document color is specified. The alpha component must be either fully
// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully
// opaque then the RGB components will be used as the background color. If the
// alpha component is fully transparent for a windowed browser then the
// default value of opaque white be used. If the alpha component is fully
// transparent for a windowless (off-screen) browser then transparent painting
// will be enabled.
///
cef_color_t background_color;
......@@ -652,11 +656,14 @@ typedef struct _cef_browser_settings_t {
cef_state_t webgl;
///
// Opaque background color used for the browser before a document is loaded
// and when no document color is specified. By default the background color
// will be the same as CefSettings.background_color. Only the RGB compontents
// of the specified value will be used. The alpha component must greater than
// 0 to enable use of the background color but will be otherwise ignored.
// Background color used for the browser before a document is loaded and when
// no document color is specified. The alpha component must be either fully
// opaque (0xFF) or fully transparent (0x00). If the alpha component is fully
// opaque then the RGB components will be used as the background color. If the
// alpha component is fully transparent for a windowed browser then the
// CefSettings.background_color value will be used. If the alpha component is
// fully transparent for a windowless (off-screen) browser then transparent
// painting will be enabled.
///
cef_color_t background_color;
......
......@@ -92,17 +92,11 @@ typedef struct _cef_window_info_t {
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;
///
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
///
int transparent_painting_enabled;
///
// Pointer for the new browser window. Only used with windowed rendering.
///
......
......@@ -102,17 +102,11 @@ typedef struct _cef_window_info_t {
// monitor will be used and some functionality that requires a parent view
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;
///
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
///
int transparent_painting_enabled;
///
// NSView pointer for the new browser view. Only used with windowed rendering.
///
......
......@@ -82,17 +82,11 @@ typedef struct _cef_window_info_t {
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
int windowless_rendering_enabled;
///
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
///
int transparent_painting_enabled;
///
// Handle for the new browser window. Only used with windowed rendering.
///
......
......@@ -88,7 +88,6 @@ struct CefWindowInfoTraits {
target->height = src->height;
target->parent_window = src->parent_window;
target->menu = src->menu;
target->transparent_painting_enabled = src->transparent_painting_enabled;
target->windowless_rendering_enabled = src->windowless_rendering_enabled;
target->window = src->window;
}
......@@ -140,15 +139,14 @@ class CefWindowInfo : public CefStructBase<CefWindowInfoTraits> {
// monitor info and to act as the parent window for dialogs, context menus,
// etc. If |parent| is not provided then the main screen monitor will be used
// and some functionality that requires a parent window may not function
// correctly. If |transparent| is true a transparent background color will be
// used (RGBA=0x00000000). If |transparent| is false the background will be
// white and opaque. In order to create windowless browsers the
// correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
// Transparent painting is enabled by default but can be disabled by setting
// CefBrowserSettings.background_color to an opaque value.
///
void SetAsWindowless(CefWindowHandle parent, bool transparent) {
void SetAsWindowless(CefWindowHandle parent) {
windowless_rendering_enabled = TRUE;
parent_window = parent;
transparent_painting_enabled = transparent;
}
};
......
......@@ -28,6 +28,15 @@ CefBrowserContext::~CefBrowserContext() {
void CefBrowserContext::Initialize() {
content::BrowserContext::Initialize(this, GetPath());
resource_context_.reset(
new CefResourceContext(IsOffTheRecord(), GetHandler()));
// This must be called before creating any services to avoid hitting
// DependencyManager::AssertContextWasntDestroyed when creating/destroying
// multiple browser contexts (due to pointer address reuse).
BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
this);
const bool extensions_enabled = extensions::ExtensionsEnabled();
if (extensions_enabled) {
// Create the custom ExtensionSystem first because other KeyedServices
......@@ -41,22 +50,18 @@ void CefBrowserContext::Initialize() {
} else {
extension_system_->InitForRegularProfile(true);
}
resource_context_->set_extensions_info_map(extension_system_->info_map());
}
}
resource_context_.reset(new CefResourceContext(
IsOffTheRecord(),
extensions_enabled ? extension_system_->info_map() : NULL,
GetHandler()));
BrowserContextDependencyManager::GetInstance()->CreateBrowserContextServices(
this);
void CefBrowserContext::PostInitialize() {
// Spell checking support and possibly other subsystems retrieve the
// PrefService associated with a BrowserContext via UserPrefs::Get().
PrefService* pref_service = GetPrefs();
DCHECK(pref_service);
user_prefs::UserPrefs::Set(this, pref_service);
const bool extensions_enabled = extensions::ExtensionsEnabled();
if (extensions_enabled && !is_proxy_)
extension_system_->Init();
}
......
......@@ -187,6 +187,9 @@ class CefBrowserContext : public ChromeProfileStub {
protected:
~CefBrowserContext() override;
// Must be called after all services have been initialized.
void PostInitialize();
// Must be called before the child object destructor has completed.
void Shutdown();
......
......@@ -85,6 +85,8 @@ class ImplManager {
CefBrowserContextImpl* GetImplForContext(
const content::BrowserContext* context) {
CEF_REQUIRE_UIT();
if (!context)
return NULL;
const CefBrowserContext* cef_context =
static_cast<const CefBrowserContext*>(context);
......@@ -141,7 +143,14 @@ class ImplManager {
DISALLOW_COPY_AND_ASSIGN(ImplManager);
};
base::LazyInstance<ImplManager> g_manager = LAZY_INSTANCE_INITIALIZER;
#if DCHECK_IS_ON()
// Because of DCHECK()s in the object destructor.
base::LazyInstance<ImplManager>::DestructorAtExit g_manager =
LAZY_INSTANCE_INITIALIZER;
#else
base::LazyInstance<ImplManager>::Leaky g_manager =
LAZY_INSTANCE_INITIALIZER;
#endif
} // namespace
......@@ -259,9 +268,16 @@ void CefBrowserContextImpl::Initialize() {
CefString(&CefContext::Get()->settings().accept_language_list);
}
// Initialize preferences.
// Initialize a temporary PrefService object that may be referenced during
// BrowserContextServices initialization.
pref_service_ = browser_prefs::CreatePrefService(
this, cache_path_, !!settings_.persist_user_preferences);
this, base::FilePath(), false, true);
CefBrowserContext::Initialize();
// Initialize the real PrefService object.
pref_service_ = browser_prefs::CreatePrefService(
this, cache_path_, !!settings_.persist_user_preferences, false);
// Initialize visited links management.
base::FilePath visited_link_path;
......@@ -275,13 +291,13 @@ void CefBrowserContextImpl::Initialize() {
visitedlink_listener_->CreateListenerForContext(this);
visitedlink_master_->Init();
CefBrowserContext::Initialize();
// Initialize proxy configuration tracker.
pref_proxy_config_tracker_.reset(
ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
GetPrefs()));
CefBrowserContext::PostInitialize();
// Create the CefURLRequestContextGetterImpl via an indirect call to
// CreateRequestContext. Triggers a call to CefURLRequestContextGetterImpl::
// GetURLRequestContext() on the IO thread which creates the
......
......@@ -82,6 +82,8 @@ void CefBrowserContextProxy::Initialize() {
// This object's CefResourceContext needs to proxy some UserData requests to
// the parent object's CefResourceContext.
resource_context()->set_parent(parent_->resource_context());
CefBrowserContext::PostInitialize();
}
base::SupportsUserData::Data*
......@@ -182,6 +184,11 @@ net::URLRequestContextGetter*
return nullptr;
}
void CefBrowserContextProxy::RegisterInProcessServices(
StaticServiceMap* services) {
parent_->RegisterInProcessServices(services);
}
PrefService* CefBrowserContextProxy::GetPrefs() {
return parent_->GetPrefs();
}
......
......@@ -54,6 +54,7 @@ class CefBrowserContextProxy : public CefBrowserContext {
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors)
override;
void RegisterInProcessServices(StaticServiceMap* services) override;
// Profile methods.
PrefService* GetPrefs() override;
......
......@@ -50,6 +50,7 @@
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_url_parameters.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
......@@ -70,6 +71,8 @@
#include "components/spellcheck/browser/spellcheck_platform.h"
#endif
using content::KeyboardEventProcessingResult;
namespace {
// Associates a CefBrowserHostImpl instance with a WebContents. This object will
......@@ -782,8 +785,8 @@ void CefBrowserHostImpl::Find(int identifier, const CefString& searchText,
blink::WebFindOptions options;
options.forward = forward;
options.matchCase = matchCase;
options.findNext = findNext;
options.match_case = matchCase;
options.find_next = findNext;
web_contents()->Find(identifier, searchText, options);
} else {
CEF_POST_TASK(CEF_UIT,
......@@ -1038,8 +1041,8 @@ void CefBrowserHostImpl::SendKeyEvent(const CefKeyEvent& event) {
return;
content::NativeWebKeyboardEvent web_event(
blink::WebInputEvent::Undefined,
blink::WebInputEvent::NoModifiers,
blink::WebInputEvent::kUndefined,
blink::WebInputEvent::kNoModifiers,
ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
platform_delegate_->TranslateKeyEvent(web_event, event);
platform_delegate_->SendKeyEvent(web_event);
......@@ -1724,6 +1727,12 @@ void CefBrowserHostImpl::HandleExternalProtocol(const GURL& url) {
}
}
SkColor CefBrowserHostImpl::GetBackgroundColor() const {
// Don't use |platform_delegate_| because it's not thread-safe.
return CefContext::Get()->GetBackgroundColor(&settings_,
is_windowless_ ? STATE_ENABLED : STATE_DISABLED);
}
int CefBrowserHostImpl::browser_id() const {
return browser_info_->browser_id();
}
......@@ -1785,8 +1794,8 @@ bool CefBrowserHostImpl::IsFullscreenForTabOrPending(
blink::WebDisplayMode CefBrowserHostImpl::GetDisplayMode(
const content::WebContents* web_contents) const {
return is_fullscreen_ ? blink::WebDisplayModeFullscreen :
blink::WebDisplayModeBrowser;
return is_fullscreen_ ? blink::kWebDisplayModeFullscreen :
blink::kWebDisplayModeBrowser;
}
void CefBrowserHostImpl::FindReply(
......@@ -2170,29 +2179,29 @@ content::WebContents* CefBrowserHostImpl::GetActionableWebContents() {
return web_contents();
}
bool CefBrowserHostImpl::PreHandleKeyboardEvent(
KeyboardEventProcessingResult CefBrowserHostImpl::PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut) {
if (!platform_delegate_)
return false;
if (client_.get()) {
const content::NativeWebKeyboardEvent& event) {
if (platform_delegate_ && client_.get()) {
CefRefPtr<CefKeyboardHandler> handler = client_->GetKeyboardHandler();
if (handler.get()) {
CefKeyEvent cef_event;
if (!browser_util::GetCefKeyEvent(event, cef_event))
return false;
cef_event.focus_on_editable_field = focus_on_editable_field_;
if (browser_util::GetCefKeyEvent(event, cef_event)) {
cef_event.focus_on_editable_field = focus_on_editable_field_;
CefEventHandle event_handle = platform_delegate_->GetEventHandle(event);
return handler->OnPreKeyEvent(this, cef_event, event_handle,
is_keyboard_shortcut);
CefEventHandle event_handle = platform_delegate_->GetEventHandle(event);
bool is_keyboard_shortcut = false;
bool result = handler->OnPreKeyEvent(this, cef_event, event_handle,
&is_keyboard_shortcut);
if (result)
return KeyboardEventProcessingResult::HANDLED;
else if (is_keyboard_shortcut)
return KeyboardEventProcessingResult::NOT_HANDLED_IS_SHORTCUT;
}
}
}
return false;
return KeyboardEventProcessingResult::NOT_HANDLED;
}
void CefBrowserHostImpl::HandleKeyboardEvent(
......@@ -2527,7 +2536,7 @@ void CefBrowserHostImpl::DidFinishNavigation(
// Don't call OnLoadStart for same page navigations (fragments,
// history state).
if (!navigation_handle->IsSamePage())
if (!navigation_handle->IsSameDocument())
OnLoadStart(frame, navigation_handle->GetPageTransition());
if (is_main_frame)
......
......@@ -339,6 +339,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
// Thread safe accessors.
const CefBrowserSettings& settings() const { return settings_; }
SkColor GetBackgroundColor() const;
CefRefPtr<CefClient> client() const { return client_; }
scoped_refptr<CefBrowserInfo> browser_info() const { return browser_info_; }
int browser_id() const;
......@@ -391,10 +392,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool reverse) override;
bool HandleContextMenu(
const content::ContextMenuParams& params) override;
bool PreHandleKeyboardEvent(
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut) override;
const content::NativeWebKeyboardEvent& event) override;
void HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
......
......@@ -207,28 +207,28 @@ int CefBrowserPlatformDelegate::TranslateModifiers(uint32 cef_modifiers) {
int webkit_modifiers = 0;
// Set modifiers based on key state.
if (cef_modifiers & EVENTFLAG_SHIFT_DOWN)
webkit_modifiers |= blink::WebInputEvent::ShiftKey;
webkit_modifiers |= blink::WebInputEvent::kShiftKey;
if (cef_modifiers & EVENTFLAG_CONTROL_DOWN)
webkit_modifiers |= blink::WebInputEvent::ControlKey;
webkit_modifiers |= blink::WebInputEvent::kControlKey;
if (cef_modifiers & EVENTFLAG_ALT_DOWN)
webkit_modifiers |= blink::WebInputEvent::AltKey;
webkit_modifiers |= blink::WebInputEvent::kAltKey;
if (cef_modifiers & EVENTFLAG_COMMAND_DOWN)
webkit_modifiers |= blink::WebInputEvent::MetaKey;
webkit_modifiers |= blink::WebInputEvent::kMetaKey;
if (cef_modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
webkit_modifiers |= blink::WebInputEvent::LeftButtonDown;
webkit_modifiers |= blink::WebInputEvent::kLeftButtonDown;
if (cef_modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON)
webkit_modifiers |= blink::WebInputEvent::MiddleButtonDown;
webkit_modifiers |= blink::WebInputEvent::kMiddleButtonDown;
if (cef_modifiers & EVENTFLAG_RIGHT_MOUSE_BUTTON)
webkit_modifiers |= blink::WebInputEvent::RightButtonDown;
webkit_modifiers |= blink::WebInputEvent::kRightButtonDown;
if (cef_modifiers & EVENTFLAG_CAPS_LOCK_ON)
webkit_modifiers |= blink::WebInputEvent::CapsLockOn;
webkit_modifiers |= blink::WebInputEvent::kCapsLockOn;
if (cef_modifiers & EVENTFLAG_NUM_LOCK_ON)
webkit_modifiers |= blink::WebInputEvent::NumLockOn;
webkit_modifiers |= blink::WebInputEvent::kNumLockOn;
if (cef_modifiers & EVENTFLAG_IS_LEFT)
webkit_modifiers |= blink::WebInputEvent::IsLeft;
webkit_modifiers |= blink::WebInputEvent::kIsLeft;
if (cef_modifiers & EVENTFLAG_IS_RIGHT)
webkit_modifiers |= blink::WebInputEvent::IsRight;
webkit_modifiers |= blink::WebInputEvent::kIsRight;
if (cef_modifiers & EVENTFLAG_IS_KEY_PAD)
webkit_modifiers |= blink::WebInputEvent::IsKeyPad;
webkit_modifiers |= blink::WebInputEvent::kIsKeyPad;
return webkit_modifiers;
}
......@@ -134,6 +134,13 @@ class CefBrowserPlatformDelegate {
CefBrowserHostImpl* new_browser,
bool is_devtools);
// Returns the background color for the browser. The alpha component will be
// either SK_AlphaTRANSPARENT or SK_AlphaOPAQUE (e.g. fully transparent or
// fully opaque). SK_AlphaOPAQUE will always be returned for windowed
// browsers. SK_ColorTRANSPARENT may be returned for windowless browsers to
// enable transparency.
virtual SkColor GetBackgroundColor() const = 0;
// Notify the window that it was resized.
virtual void WasResized() = 0;
......
......@@ -6,6 +6,8 @@
#include <utility>
#include "libcef/browser/context.h"
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
......@@ -29,28 +31,31 @@
namespace {
std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
const CefWindowInfo& window_info) {
const CefWindowInfo& window_info,
SkColor background_color) {
#if defined(OS_WIN)
return base::WrapUnique(new CefBrowserPlatformDelegateNativeWin(window_info));
return base::MakeUnique<CefBrowserPlatformDelegateNativeWin>(
window_info, background_color);
#elif defined(OS_MACOSX)
return base::WrapUnique(new CefBrowserPlatformDelegateNativeMac(window_info));
return base::MakeUnique<CefBrowserPlatformDelegateNativeMac>(
window_info, background_color);
#elif defined(OS_LINUX)
return base::WrapUnique(
new CefBrowserPlatformDelegateNativeLinux(window_info));
return base::MakeUnique<CefBrowserPlatformDelegateNativeLinux>(
window_info, background_color);
#endif
}
std::unique_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate) {
#if defined(OS_WIN)
return base::WrapUnique(
new CefBrowserPlatformDelegateOsrWin(std::move(native_delegate)));
return base::MakeUnique<CefBrowserPlatformDelegateOsrWin>(
std::move(native_delegate));
#elif defined(OS_MACOSX)
return base::WrapUnique(
new CefBrowserPlatformDelegateOsrMac(std::move(native_delegate)));
return base::MakeUnique<CefBrowserPlatformDelegateOsrMac>(
std::move(native_delegate));
#elif defined(OS_LINUX)
return base::WrapUnique(
new CefBrowserPlatformDelegateOsrLinux(std::move(native_delegate)));
return base::MakeUnique<CefBrowserPlatformDelegateOsrLinux>(
std::move(native_delegate));
#endif
}
......@@ -59,24 +64,30 @@ std::unique_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
// static
std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
CefBrowserHostImpl::CreateParams& create_params) {
const bool is_windowless =
create_params.window_info &&
create_params.window_info->windowless_rendering_enabled &&
create_params.client &&
create_params.client->GetRenderHandler().get();
const SkColor background_color = CefContext::Get()->GetBackgroundColor(
&create_params.settings, is_windowless ? STATE_ENABLED : STATE_DISABLED);
if (create_params.window_info) {
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(*create_params.window_info.get());
if (create_params.window_info->windowless_rendering_enabled &&
create_params.client &&
create_params.client->GetRenderHandler().get()) {
CreateNativeDelegate(*create_params.window_info.get(),
background_color);
if (is_windowless)
return CreateOSRDelegate(std::move(native_delegate));
}
return std::move(native_delegate);
}
#if defined(USE_AURA)
else {
// CefWindowInfo is not used in this case.
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(CefWindowInfo());
return base::WrapUnique(new CefBrowserPlatformDelegateViews(
CreateNativeDelegate(CefWindowInfo(), background_color);
return base::MakeUnique<CefBrowserPlatformDelegateViews>(
std::move(native_delegate),
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get())));
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get()));
}
#endif // defined(USE_AURA)
......
......@@ -10,17 +10,17 @@ namespace browser_util {
bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event,
CefKeyEvent& cef_event) {
switch (event.type()) {
case blink::WebKeyboardEvent::RawKeyDown:
switch (event.GetType()) {
case blink::WebKeyboardEvent::kRawKeyDown:
cef_event.type = KEYEVENT_RAWKEYDOWN;
break;
case blink::WebKeyboardEvent::KeyDown:
case blink::WebKeyboardEvent::kKeyDown:
cef_event.type = KEYEVENT_KEYDOWN;
break;
case blink::WebKeyboardEvent::KeyUp:
case blink::WebKeyboardEvent::kKeyUp: