mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
34 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
90ba67d8ea | ||
|
f5be340d57 | ||
|
37d988bda8 | ||
|
e2f626dcf8 | ||
|
dad7c0a6af | ||
|
7c94121cbb | ||
|
61abe4a841 | ||
|
e29124d62f | ||
|
f1f4e9fbea | ||
|
086447f605 | ||
|
7cf8c6ff5c | ||
|
33d0fc3657 | ||
|
6779696971 | ||
|
558e60afba | ||
|
48b9fd38ab | ||
|
8a351d1d42 | ||
|
da5b00c3dd | ||
|
51ba965d4e | ||
|
1fbc5c4393 | ||
|
6ee1922b2c | ||
|
1658648fe1 | ||
|
ee28b94e1e | ||
|
daac89badd | ||
|
a11780730b | ||
|
c90cd8da3f | ||
|
c9d0a7f7a5 | ||
|
f73d23d847 | ||
|
976502eab1 | ||
|
aa727705b8 | ||
|
b1517ab47d | ||
|
b4e81659a4 | ||
|
aca12b004c | ||
|
a7837aa070 | ||
|
4786cb735e |
@@ -7,5 +7,5 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': '2b3ae3b8090361f8af5a611712fc1a5ab2de53cb',
|
||||
'chromium_checkout': 'refs/tags/52.0.2743.116',
|
||||
}
|
||||
|
17
cef.gyp
17
cef.gyp
@@ -968,6 +968,7 @@
|
||||
'<(DEPTH)/components/components.gyp:data_use_measurement_core',
|
||||
'<(DEPTH)/components/components.gyp:devtools_discovery',
|
||||
'<(DEPTH)/components/components.gyp:devtools_http_handler',
|
||||
'<(DEPTH)/components/components.gyp:google_core_browser',
|
||||
'<(DEPTH)/components/components.gyp:keyed_service_content',
|
||||
'<(DEPTH)/components/components.gyp:keyed_service_core',
|
||||
'<(DEPTH)/components/components.gyp:navigation_interception',
|
||||
@@ -1505,6 +1506,9 @@
|
||||
# Include sources for permissions support.
|
||||
'<(DEPTH)/chrome/browser/permissions/permission_request_id.h',
|
||||
'<(DEPTH)/chrome/browser/permissions/permission_request_id.cc',
|
||||
# Include sources for SafeSearch support.
|
||||
'<(DEPTH)/chrome/browser/net/safe_search_util.cc',
|
||||
'<(DEPTH)/chrome/browser/net/safe_search_util.h',
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
@@ -2090,6 +2094,19 @@
|
||||
},
|
||||
},
|
||||
}],
|
||||
[ '(OS=="linux" or OS=="freebsd" or OS=="openbsd") and asan==0 and use_allocator=="none"', {
|
||||
'link_settings': {
|
||||
'configurations': {
|
||||
'Release': {
|
||||
'ldflags': [
|
||||
# Only export necessary symbols from libcef.so.
|
||||
# Don't do this in Debug builds because it causes the resulting application to crash.
|
||||
'-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/cef/libcef_dll/libcef.lst',
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
}],
|
||||
],
|
||||
}],
|
||||
}], # OS!="mac"
|
||||
|
@@ -81,11 +81,15 @@ endmacro()
|
||||
|
||||
# Determine the target output directory based on platform and generator.
|
||||
macro(SET_CEF_TARGET_OUT_DIR)
|
||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
|
||||
# Ninja does not create a subdirectory named after the configuration.
|
||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
elseif(OS_LINUX)
|
||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR
|
||||
${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||
# By default Ninja and Make builds don't create a subdirectory named after
|
||||
# the configuration.
|
||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# Output binaries (executables, libraries) to the correct directory.
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
|
||||
else()
|
||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
|
||||
endif()
|
||||
@@ -256,13 +260,13 @@ endif(OS_MACOSX)
|
||||
if(OS_WINDOWS)
|
||||
|
||||
# Add custom manifest files to an executable target.
|
||||
macro(ADD_WINDOWS_MANIFEST manifest_path target)
|
||||
macro(ADD_WINDOWS_MANIFEST manifest_path target extension)
|
||||
add_custom_command(
|
||||
TARGET ${target}
|
||||
POST_BUILD
|
||||
COMMAND "mt.exe" -nologo
|
||||
-manifest \"${manifest_path}/${target}.exe.manifest\" \"${manifest_path}/compatibility.manifest\"
|
||||
-outputresource:"${CEF_TARGET_OUT_DIR}/${target}.exe"\;\#1
|
||||
-manifest \"${manifest_path}/${target}.${extension}.manifest\" \"${manifest_path}/compatibility.manifest\"
|
||||
-outputresource:"${CEF_TARGET_OUT_DIR}/${target}.${extension}"\;\#1
|
||||
COMMENT "Adding manifest..."
|
||||
)
|
||||
endmacro()
|
||||
|
@@ -383,12 +383,6 @@ if(OS_WINDOWS)
|
||||
natives_blob.bin
|
||||
snapshot_blob.bin
|
||||
)
|
||||
if(PROJECT_ARCH STREQUAL "x86")
|
||||
# Only used on 32-bit platforms.
|
||||
list(APPEND CEF_BINARY_FILES
|
||||
wow_helper.exe
|
||||
)
|
||||
endif()
|
||||
|
||||
# List of CEF resource files.
|
||||
set(CEF_RESOURCE_FILES
|
||||
|
@@ -448,10 +448,13 @@ typedef struct _cef_browser_host_t {
|
||||
int clearSelection);
|
||||
|
||||
///
|
||||
// Open developer tools in its own window. If |inspect_element_at| is non-
|
||||
// NULL the element at the specified (x,y) location will be inspected. The
|
||||
// |windowInfo| parameter will be ignored if this browser is wrapped in a
|
||||
// cef_browser_view_t.
|
||||
// Open developer tools (DevTools) in its own browser. The DevTools browser
|
||||
// will remain associated with this browser. If the DevTools browser is
|
||||
// already open then it will be focused, in which case the |windowInfo|,
|
||||
// |client| and |settings| parameters will be ignored. If |inspect_element_at|
|
||||
// is non-NULL then the element at the specified (x,y) location will be
|
||||
// inspected. The |windowInfo| parameter will be ignored if this browser is
|
||||
// wrapped in a cef_browser_view_t.
|
||||
///
|
||||
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self,
|
||||
const struct _cef_window_info_t* windowInfo,
|
||||
@@ -460,11 +463,16 @@ typedef struct _cef_browser_host_t {
|
||||
const cef_point_t* inspect_element_at);
|
||||
|
||||
///
|
||||
// Explicitly close the developer tools window if one exists for this browser
|
||||
// instance.
|
||||
// Explicitly close the associated DevTools browser, if any.
|
||||
///
|
||||
void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Returns true (1) if this browser currently has an associated DevTools
|
||||
// browser. Must be called on the browser process UI thread.
|
||||
///
|
||||
int (CEF_CALLBACK *has_dev_tools)(struct _cef_browser_host_t* self);
|
||||
|
||||
///
|
||||
// Retrieve a snapshot of current navigation entries as values sent to the
|
||||
// specified visitor. If |current_only| is true (1) only the current
|
||||
|
@@ -72,14 +72,17 @@ typedef struct _cef_load_handler_t {
|
||||
///
|
||||
// Called when the browser begins loading a frame. The |frame| value will
|
||||
// never be NULL -- call the is_main() function to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This
|
||||
// function will always be called for all frames irrespective of whether the
|
||||
// request completes successfully. For notification of overall browser load
|
||||
// status use OnLoadingStateChange instead.
|
||||
// main frame. |transition_type| provides information about the source of the
|
||||
// navigation and an accurate value is only available in the browser process.
|
||||
// Multiple frames may be loading at the same time. Sub-frames may start or
|
||||
// continue loading after the main frame load has ended. This function will
|
||||
// always be called for all frames irrespective of whether the request
|
||||
// completes successfully. For notification of overall browser load status use
|
||||
// OnLoadingStateChange instead.
|
||||
///
|
||||
void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self,
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame);
|
||||
struct _cef_browser_t* browser, struct _cef_frame_t* frame,
|
||||
cef_transition_type_t transition_type);
|
||||
|
||||
///
|
||||
// Called when the browser is done loading a frame. The |frame| value will
|
||||
|
@@ -279,7 +279,7 @@ CEF_EXPORT cef_request_context_t* cef_request_context_create_context(
|
||||
// Creates a new context object that shares storage with |other| and uses an
|
||||
// optional |handler|.
|
||||
///
|
||||
CEF_EXPORT cef_request_context_t* create_context_shared(
|
||||
CEF_EXPORT cef_request_context_t* cef_create_context_shared(
|
||||
cef_request_context_t* other,
|
||||
struct _cef_request_context_handler_t* handler);
|
||||
|
||||
|
@@ -490,24 +490,34 @@ class CefBrowserHost : public virtual CefBase {
|
||||
virtual void StopFinding(bool clearSelection) =0;
|
||||
|
||||
///
|
||||
// Open developer tools in its own window. If |inspect_element_at| is non-
|
||||
// empty the element at the specified (x,y) location will be inspected. The
|
||||
// |windowInfo| parameter will be ignored if this browser is wrapped in a
|
||||
// CefBrowserView.
|
||||
// Open developer tools (DevTools) in its own browser. The DevTools browser
|
||||
// will remain associated with this browser. If the DevTools browser is
|
||||
// already open then it will be focused, in which case the |windowInfo|,
|
||||
// |client| and |settings| parameters will be ignored. If |inspect_element_at|
|
||||
// is non-empty then the element at the specified (x,y) location will be
|
||||
// inspected. The |windowInfo| parameter will be ignored if this browser is
|
||||
// wrapped in a CefBrowserView.
|
||||
///
|
||||
/*--cef(optional_param=inspect_element_at)--*/
|
||||
/*--cef(optional_param=windowInfo,optional_param=client,
|
||||
optional_param=settings,optional_param=inspect_element_at)--*/
|
||||
virtual void ShowDevTools(const CefWindowInfo& windowInfo,
|
||||
CefRefPtr<CefClient> client,
|
||||
const CefBrowserSettings& settings,
|
||||
const CefPoint& inspect_element_at) =0;
|
||||
|
||||
///
|
||||
// Explicitly close the developer tools window if one exists for this browser
|
||||
// instance.
|
||||
// Explicitly close the associated DevTools browser, if any.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void CloseDevTools() =0;
|
||||
|
||||
///
|
||||
// Returns true if this browser currently has an associated DevTools browser.
|
||||
// Must be called on the browser process UI thread.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool HasDevTools() =0;
|
||||
|
||||
///
|
||||
// Retrieve a snapshot of current navigation entries as values sent to the
|
||||
// specified visitor. If |current_only| is true only the current navigation
|
||||
|
@@ -51,6 +51,7 @@
|
||||
class CefLoadHandler : public virtual CefBase {
|
||||
public:
|
||||
typedef cef_errorcode_t ErrorCode;
|
||||
typedef cef_transition_type_t TransitionType;
|
||||
|
||||
///
|
||||
// Called when the loading state has changed. This callback will be executed
|
||||
@@ -68,15 +69,18 @@ class CefLoadHandler : public virtual CefBase {
|
||||
///
|
||||
// Called when the browser begins loading a frame. The |frame| value will
|
||||
// never be empty -- call the IsMain() method to check if this frame is the
|
||||
// main frame. Multiple frames may be loading at the same time. Sub-frames may
|
||||
// start or continue loading after the main frame load has ended. This method
|
||||
// will always be called for all frames irrespective of whether the request
|
||||
// main frame. |transition_type| provides information about the source of the
|
||||
// navigation and an accurate value is only available in the browser process.
|
||||
// Multiple frames may be loading at the same time. Sub-frames may start or
|
||||
// continue loading after the main frame load has ended. This method will
|
||||
// always be called for all frames irrespective of whether the request
|
||||
// completes successfully. For notification of overall browser load status use
|
||||
// OnLoadingStateChange instead.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) {}
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) {}
|
||||
|
||||
///
|
||||
// Called when the browser is done loading a frame. The |frame| value will
|
||||
|
@@ -104,7 +104,7 @@ class CefRequestContext : public virtual CefBase {
|
||||
// Creates a new context object that shares storage with |other| and uses an
|
||||
// optional |handler|.
|
||||
///
|
||||
/*--cef(capi_name=create_context_shared,optional_param=handler)--*/
|
||||
/*--cef(capi_name=cef_create_context_shared,optional_param=handler)--*/
|
||||
static CefRefPtr<CefRequestContext> CreateContext(
|
||||
CefRefPtr<CefRequestContext> other,
|
||||
CefRefPtr<CefRequestContextHandler> handler);
|
||||
|
@@ -209,12 +209,14 @@ CefBrowserContextImpl::~CefBrowserContextImpl() {
|
||||
|
||||
pref_proxy_config_tracker_->DetachFromPrefService();
|
||||
|
||||
if (host_content_settings_map_.get())
|
||||
if (url_request_getter_)
|
||||
url_request_getter_->ShutdownOnUIThread();
|
||||
if (host_content_settings_map_)
|
||||
host_content_settings_map_->ShutdownOnUIThread();
|
||||
|
||||
// Delete the download manager delegate here because otherwise we'll crash
|
||||
// when it's accessed from the content::BrowserContext destructor.
|
||||
if (download_manager_delegate_.get())
|
||||
if (download_manager_delegate_)
|
||||
download_manager_delegate_.reset(NULL);
|
||||
|
||||
g_manager.Get().RemoveImpl(this, cache_path_);
|
||||
|
@@ -596,7 +596,7 @@ void CefBrowserHostImpl::SetFocus(bool focus) {
|
||||
|
||||
if (focus)
|
||||
OnSetFocus(FOCUS_SOURCE_SYSTEM);
|
||||
else
|
||||
else if (platform_delegate_)
|
||||
platform_delegate_->SendFocusEvent(false);
|
||||
}
|
||||
|
||||
@@ -805,6 +805,10 @@ void CefBrowserHostImpl::ShowDevTools(
|
||||
return;
|
||||
|
||||
if (devtools_frontend_) {
|
||||
if (!inspect_element_at.IsEmpty()) {
|
||||
devtools_frontend_->InspectElementAt(inspect_element_at.x,
|
||||
inspect_element_at.y);
|
||||
}
|
||||
devtools_frontend_->Focus();
|
||||
return;
|
||||
}
|
||||
@@ -832,6 +836,15 @@ void CefBrowserHostImpl::CloseDevTools() {
|
||||
}
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::HasDevTools() {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
NOTREACHED() << "called on invalid thread";
|
||||
return false;
|
||||
}
|
||||
|
||||
return (devtools_frontend_ != nullptr);
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::GetNavigationEntries(
|
||||
CefRefPtr<CefNavigationEntryVisitor> visitor,
|
||||
bool current_only) {
|
||||
@@ -926,7 +939,7 @@ void CefBrowserHostImpl::WasResized() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->WasResized();
|
||||
@@ -944,7 +957,7 @@ void CefBrowserHostImpl::WasHidden(bool hidden) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->WasHidden(hidden);
|
||||
@@ -962,7 +975,7 @@ void CefBrowserHostImpl::NotifyScreenInfoChanged() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->NotifyScreenInfoChanged();
|
||||
@@ -980,7 +993,7 @@ void CefBrowserHostImpl::Invalidate(PaintElementType type) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->Invalidate(type);
|
||||
@@ -993,7 +1006,7 @@ void CefBrowserHostImpl::SendKeyEvent(const CefKeyEvent& event) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
content::NativeWebKeyboardEvent web_event;
|
||||
@@ -1010,7 +1023,7 @@ void CefBrowserHostImpl::SendMouseClickEvent(const CefMouseEvent& event,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
blink::WebMouseEvent web_event;
|
||||
@@ -1028,7 +1041,7 @@ void CefBrowserHostImpl::SendMouseMoveEvent(const CefMouseEvent& event,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
blink::WebMouseEvent web_event;
|
||||
@@ -1045,7 +1058,7 @@ void CefBrowserHostImpl::SendMouseWheelEvent(const CefMouseEvent& event,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
blink::WebMouseWheelEvent web_event;
|
||||
@@ -1064,7 +1077,7 @@ void CefBrowserHostImpl::SendCaptureLostEvent() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->SendCaptureLostEvent();
|
||||
@@ -1078,7 +1091,7 @@ void CefBrowserHostImpl::NotifyMoveOrResizeStarted() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->NotifyMoveOrResizeStarted();
|
||||
@@ -1104,7 +1117,9 @@ void CefBrowserHostImpl::SetWindowlessFrameRate(int frame_rate) {
|
||||
}
|
||||
|
||||
settings_.windowless_frame_rate = frame_rate;
|
||||
platform_delegate_->SetWindowlessFrameRate(frame_rate);
|
||||
|
||||
if (platform_delegate_)
|
||||
platform_delegate_->SetWindowlessFrameRate(frame_rate);
|
||||
}
|
||||
|
||||
// CefBrowser methods.
|
||||
@@ -1407,12 +1422,14 @@ void CefBrowserHostImpl::DestroyBrowser() {
|
||||
#if defined(USE_AURA)
|
||||
views::Widget* CefBrowserHostImpl::GetWindowWidget() const {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!platform_delegate_)
|
||||
return nullptr;
|
||||
return platform_delegate_->GetWindowWidget();
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserView> CefBrowserHostImpl::GetBrowserView() const {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (IsViewsHosted())
|
||||
if (IsViewsHosted() && platform_delegate_)
|
||||
return platform_delegate_->GetBrowserView();
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1651,7 +1668,8 @@ void CefBrowserHostImpl::ViewText(const std::string& text) {
|
||||
return;
|
||||
}
|
||||
|
||||
platform_delegate_->ViewText(text);
|
||||
if (platform_delegate_)
|
||||
platform_delegate_->ViewText(text);
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::HandleExternalProtocol(const GURL& url) {
|
||||
@@ -1664,7 +1682,7 @@ void CefBrowserHostImpl::HandleExternalProtocol(const GURL& url) {
|
||||
handler->OnProtocolExecution(this, url.spec(), allow_os_execution);
|
||||
}
|
||||
|
||||
if (allow_os_execution)
|
||||
if (allow_os_execution && platform_delegate_)
|
||||
platform_delegate_->HandleExternalProtocol(url);
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
@@ -1694,7 +1712,8 @@ void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) {
|
||||
}
|
||||
}
|
||||
|
||||
platform_delegate_->SendFocusEvent(true);
|
||||
if (platform_delegate_)
|
||||
platform_delegate_->SendFocusEvent(true);
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::OnSetFocus, this, source));
|
||||
@@ -1766,7 +1785,7 @@ CefTextInputContext CefBrowserHostImpl::GetNSTextInputContext() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return nullptr;
|
||||
|
||||
return platform_delegate_->GetNSTextInputContext();
|
||||
@@ -1788,7 +1807,7 @@ void CefBrowserHostImpl::HandleKeyEventBeforeTextInputClient(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->HandleKeyEventBeforeTextInputClient(keyEvent);
|
||||
@@ -1808,7 +1827,7 @@ void CefBrowserHostImpl::HandleKeyEventAfterTextInputClient(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
return platform_delegate_->HandleKeyEventAfterTextInputClient(keyEvent);
|
||||
@@ -1835,7 +1854,7 @@ void CefBrowserHostImpl::DragTargetDragEnter(CefRefPtr<CefDragData> drag_data,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->DragTargetDragEnter(drag_data, event, allowed_ops);
|
||||
@@ -1855,7 +1874,7 @@ void CefBrowserHostImpl::DragTargetDragOver(const CefMouseEvent& event,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->DragTargetDragOver(event, allowed_ops);
|
||||
@@ -1873,7 +1892,7 @@ void CefBrowserHostImpl::DragTargetDragLeave() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->DragTargetDragLeave();
|
||||
@@ -1891,7 +1910,7 @@ void CefBrowserHostImpl::DragTargetDrop(const CefMouseEvent& event) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->DragTargetDrop(event);
|
||||
@@ -1909,6 +1928,9 @@ void CefBrowserHostImpl::DragSourceSystemDragEnded() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->DragSourceSystemDragEnded();
|
||||
}
|
||||
|
||||
@@ -1925,7 +1947,7 @@ void CefBrowserHostImpl::DragSourceEndedAt(
|
||||
return;
|
||||
}
|
||||
|
||||
if (!web_contents())
|
||||
if (!web_contents() || !platform_delegate_)
|
||||
return;
|
||||
|
||||
platform_delegate_->DragSourceEndedAt(x, y, op);
|
||||
@@ -2095,6 +2117,9 @@ bool CefBrowserHostImpl::PreHandleKeyboardEvent(
|
||||
content::WebContents* source,
|
||||
const content::NativeWebKeyboardEvent& event,
|
||||
bool* is_keyboard_shortcut) {
|
||||
if (!platform_delegate_)
|
||||
return false;
|
||||
|
||||
if (client_.get()) {
|
||||
CefRefPtr<CefKeyboardHandler> handler = client_->GetKeyboardHandler();
|
||||
if (handler.get()) {
|
||||
@@ -2120,6 +2145,9 @@ void CefBrowserHostImpl::HandleKeyboardEvent(
|
||||
if (event.skip_in_browser)
|
||||
return;
|
||||
|
||||
if (!platform_delegate_)
|
||||
return;
|
||||
|
||||
if (client_.get()) {
|
||||
CefRefPtr<CefKeyboardHandler> handler = client_->GetKeyboardHandler();
|
||||
if (handler.get()) {
|
||||
@@ -2221,7 +2249,7 @@ void CefBrowserHostImpl::DidNavigateMainFramePostCommit(
|
||||
content::JavaScriptDialogManager*
|
||||
CefBrowserHostImpl::GetJavaScriptDialogManager(
|
||||
content::WebContents* source) {
|
||||
if (!javascript_dialog_manager_.get()) {
|
||||
if (!javascript_dialog_manager_.get() && platform_delegate_) {
|
||||
javascript_dialog_manager_.reset(
|
||||
new CefJavaScriptDialogManager(this,
|
||||
platform_delegate_->CreateJavaScriptDialogRunner()));
|
||||
@@ -2240,7 +2268,7 @@ bool CefBrowserHostImpl::HandleContextMenu(
|
||||
content::WebContents* web_contents,
|
||||
const content::ContextMenuParams& params) {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!menu_manager_.get()) {
|
||||
if (!menu_manager_.get() && platform_delegate_) {
|
||||
menu_manager_.reset(
|
||||
new CefMenuManager(this,
|
||||
platform_delegate_->CreateMenuRunner()));
|
||||
@@ -2252,7 +2280,8 @@ void CefBrowserHostImpl::UpdatePreferredSize(content::WebContents* source,
|
||||
const gfx::Size& pref_size) {
|
||||
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX))
|
||||
CEF_REQUIRE_UIT();
|
||||
platform_delegate_->SizeTo(pref_size.width(), pref_size.height());
|
||||
if (platform_delegate_)
|
||||
platform_delegate_->SizeTo(pref_size.width(), pref_size.height());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2918,7 +2947,7 @@ void CefBrowserHostImpl::SetFocusedFrame(int64 frame_id) {
|
||||
|
||||
gfx::Point CefBrowserHostImpl::GetScreenPoint(const gfx::Point& view) const {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (platform_delegate_.get())
|
||||
if (platform_delegate_)
|
||||
return platform_delegate_->GetScreenPoint(view);
|
||||
return gfx::Point();
|
||||
}
|
||||
@@ -2941,7 +2970,8 @@ void CefBrowserHostImpl::OnLoadStart(CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefLoadHandler> handler = client_->GetLoadHandler();
|
||||
if (handler.get()) {
|
||||
// Notify the handler that loading has started.
|
||||
handler->OnLoadStart(this, frame);
|
||||
handler->OnLoadStart(this, frame,
|
||||
static_cast<cef_transition_type_t>(transition_type));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3003,7 +3033,7 @@ void CefBrowserHostImpl::OnDevToolsWebContentsDestroyed() {
|
||||
|
||||
void CefBrowserHostImpl::EnsureFileDialogManager() {
|
||||
CEF_REQUIRE_UIT();
|
||||
if (!file_dialog_manager_.get()) {
|
||||
if (!file_dialog_manager_.get() && platform_delegate_) {
|
||||
file_dialog_manager_.reset(
|
||||
new CefFileDialogManager(this,
|
||||
platform_delegate_->CreateFileDialogRunner()));
|
||||
|
@@ -180,6 +180,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
const CefBrowserSettings& settings,
|
||||
const CefPoint& inspect_element_at) override;
|
||||
void CloseDevTools() override;
|
||||
bool HasDevTools() override;
|
||||
void GetNavigationEntries(
|
||||
CefRefPtr<CefNavigationEntryVisitor> visitor,
|
||||
bool current_only) override;
|
||||
|
@@ -5,91 +5,16 @@
|
||||
#include "libcef/browser/component_updater/cef_component_updater_configurator.h"
|
||||
#include "include/cef_version.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/version.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
|
||||
#include "components/component_updater/configurator_impl.h"
|
||||
#include "components/update_client/component_patcher_operation.h"
|
||||
#include "components/component_updater/component_updater_switches.h"
|
||||
#include "components/component_updater/component_updater_url_constants.h"
|
||||
#include "components/update_client/configurator.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "net/url_request/url_request_context_getter.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/win/win_util.h"
|
||||
#endif // OS_WIN
|
||||
|
||||
using update_client::Configurator;
|
||||
|
||||
namespace component_updater {
|
||||
|
||||
namespace {
|
||||
|
||||
// Default time constants.
|
||||
const int kDelayOneMinute = 60;
|
||||
const int kDelayOneHour = kDelayOneMinute * 60;
|
||||
|
||||
// Debug values you can pass to --component-updater=value1,value2.
|
||||
// Speed up component checking.
|
||||
const char kSwitchFastUpdate[] = "fast-update";
|
||||
|
||||
// Add "testrequest=1" attribute to the update check request.
|
||||
const char kSwitchRequestParam[] = "test-request";
|
||||
|
||||
// Disables pings. Pings are the requests sent to the update server that report
|
||||
// the success or the failure of component install or update attempts.
|
||||
extern const char kSwitchDisablePings[] = "disable-pings";
|
||||
|
||||
// Sets the URL for updates.
|
||||
const char kSwitchUrlSource[] = "url-source";
|
||||
|
||||
// Disables differential updates.
|
||||
const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates";
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Disables background downloads.
|
||||
const char kSwitchDisableBackgroundDownloads[] = "disable-background-downloads";
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
// Returns true if and only if |test| is contained in |vec|.
|
||||
bool HasSwitchValue(const std::vector<std::string>& vec, const char* test) {
|
||||
if (vec.empty())
|
||||
return 0;
|
||||
return (std::find(vec.begin(), vec.end(), test) != vec.end());
|
||||
}
|
||||
|
||||
// If there is an element of |vec| of the form |test|=.*, returns the right-
|
||||
// hand side of that assignment. Otherwise, returns an empty string.
|
||||
// The right-hand side may contain additional '=' characters, allowing for
|
||||
// further nesting of switch arguments.
|
||||
std::string GetSwitchArgument(const std::vector<std::string>& vec,
|
||||
const char* test) {
|
||||
if (vec.empty())
|
||||
return std::string();
|
||||
for (std::vector<std::string>::const_iterator it = vec.begin();
|
||||
it != vec.end();
|
||||
++it) {
|
||||
const std::size_t found = it->find("=");
|
||||
if (found != std::string::npos) {
|
||||
if (it->substr(0, found) == test) {
|
||||
return it->substr(found + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
class CefConfigurator : public Configurator {
|
||||
class CefConfigurator : public update_client::Configurator {
|
||||
public:
|
||||
CefConfigurator(const base::CommandLine* cmdline,
|
||||
net::URLRequestContextGetter* url_request_getter,
|
||||
@@ -124,134 +49,68 @@ class CefConfigurator : public Configurator {
|
||||
|
||||
~CefConfigurator() override {}
|
||||
|
||||
net::URLRequestContextGetter* url_request_getter_;
|
||||
ConfiguratorImpl configurator_impl_;
|
||||
PrefService* pref_service_;
|
||||
std::string extra_info_;
|
||||
GURL url_source_override_;
|
||||
bool fast_update_;
|
||||
bool pings_enabled_;
|
||||
bool deltas_enabled_;
|
||||
bool background_downloads_enabled_;
|
||||
};
|
||||
|
||||
CefConfigurator::CefConfigurator(
|
||||
const base::CommandLine* cmdline,
|
||||
net::URLRequestContextGetter* url_request_getter,
|
||||
PrefService* pref_service)
|
||||
: url_request_getter_(url_request_getter),
|
||||
pref_service_(pref_service),
|
||||
fast_update_(false),
|
||||
pings_enabled_(false),
|
||||
deltas_enabled_(false),
|
||||
background_downloads_enabled_(false) {
|
||||
// Parse comma-delimited debug flags.
|
||||
std::vector<std::string> switch_values = base::SplitString(
|
||||
cmdline->GetSwitchValueASCII(switches::kComponentUpdater),
|
||||
",", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||
fast_update_ = HasSwitchValue(switch_values, kSwitchFastUpdate);
|
||||
pings_enabled_ = !HasSwitchValue(switch_values, kSwitchDisablePings);
|
||||
deltas_enabled_ = !HasSwitchValue(switch_values, kSwitchDisableDeltaUpdates);
|
||||
|
||||
// TODO(dberger): Pull this (and possibly the various hard-coded
|
||||
// delay params in this file) from cef settings.
|
||||
fast_update_ = true;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
background_downloads_enabled_ =
|
||||
!HasSwitchValue(switch_values, kSwitchDisableBackgroundDownloads);
|
||||
#else
|
||||
background_downloads_enabled_ = false;
|
||||
#endif
|
||||
|
||||
const std::string switch_url_source =
|
||||
GetSwitchArgument(switch_values, kSwitchUrlSource);
|
||||
if (!switch_url_source.empty()) {
|
||||
url_source_override_ = GURL(switch_url_source);
|
||||
DCHECK(url_source_override_.is_valid());
|
||||
}
|
||||
|
||||
if (HasSwitchValue(switch_values, kSwitchRequestParam))
|
||||
extra_info_ += "testrequest=\"1\"";
|
||||
: configurator_impl_(cmdline, url_request_getter, false),
|
||||
pref_service_(pref_service) {
|
||||
}
|
||||
|
||||
int CefConfigurator::InitialDelay() const {
|
||||
return fast_update_ ? 10 : (6 * kDelayOneMinute);
|
||||
return configurator_impl_.InitialDelay();
|
||||
}
|
||||
|
||||
int CefConfigurator::NextCheckDelay() const {
|
||||
return fast_update_ ? 60 : (6 * kDelayOneHour);
|
||||
return configurator_impl_.NextCheckDelay();
|
||||
}
|
||||
|
||||
int CefConfigurator::StepDelay() const {
|
||||
return fast_update_ ? 1 : 1;
|
||||
return configurator_impl_.StepDelay();
|
||||
}
|
||||
|
||||
int CefConfigurator::OnDemandDelay() const {
|
||||
return fast_update_ ? 2 : (30 * kDelayOneMinute);
|
||||
return configurator_impl_.OnDemandDelay();
|
||||
}
|
||||
|
||||
int CefConfigurator::UpdateDelay() const {
|
||||
return fast_update_ ? 10 : (15 * kDelayOneMinute);
|
||||
return configurator_impl_.UpdateDelay();
|
||||
}
|
||||
|
||||
std::vector<GURL> CefConfigurator::UpdateUrl() const {
|
||||
std::vector<GURL> urls;
|
||||
if (url_source_override_.is_valid()) {
|
||||
urls.push_back(GURL(url_source_override_));
|
||||
} else {
|
||||
urls.push_back(GURL(kUpdaterDefaultUrl));
|
||||
}
|
||||
return urls;
|
||||
return configurator_impl_.UpdateUrl();
|
||||
}
|
||||
|
||||
std::vector<GURL> CefConfigurator::PingUrl() const {
|
||||
return pings_enabled_ ? UpdateUrl() : std::vector<GURL>();
|
||||
return configurator_impl_.PingUrl();
|
||||
}
|
||||
|
||||
base::Version CefConfigurator::GetBrowserVersion() const {
|
||||
return base::Version(base::StringPrintf("%d.%d.%d.%d",
|
||||
CHROME_VERSION_MAJOR,
|
||||
CHROME_VERSION_MINOR,
|
||||
CHROME_VERSION_BUILD,
|
||||
CHROME_VERSION_PATCH));
|
||||
return configurator_impl_.GetBrowserVersion();
|
||||
}
|
||||
|
||||
std::string CefConfigurator::GetChannel() const {
|
||||
return "";
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string CefConfigurator::GetBrand() const {
|
||||
return "";
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string CefConfigurator::GetLang() const {
|
||||
return "";
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string CefConfigurator::GetOSLongName() const {
|
||||
#if defined(OS_WIN)
|
||||
return "Windows";
|
||||
#elif defined(OS_MACOSX)
|
||||
return "Mac OS X";
|
||||
#elif defined(OS_CHROMEOS)
|
||||
return "Chromium OS";
|
||||
#elif defined(OS_ANDROID)
|
||||
return "Android";
|
||||
#elif defined(OS_LINUX)
|
||||
return "Linux";
|
||||
#elif defined(OS_FREEBSD)
|
||||
return "FreeBSD";
|
||||
#elif defined(OS_OPENBSD)
|
||||
return "OpenBSD";
|
||||
#elif defined(OS_SOLARIS)
|
||||
return "Solaris";
|
||||
#else
|
||||
return "Unknown";
|
||||
#endif
|
||||
return configurator_impl_.GetOSLongName();
|
||||
}
|
||||
|
||||
std::string CefConfigurator::ExtraRequestParams() const {
|
||||
return extra_info_;
|
||||
return configurator_impl_.ExtraRequestParams();
|
||||
}
|
||||
|
||||
std::string CefConfigurator::GetDownloadPreference() const {
|
||||
@@ -259,32 +118,36 @@ std::string CefConfigurator::GetDownloadPreference() const {
|
||||
}
|
||||
|
||||
net::URLRequestContextGetter* CefConfigurator::RequestContext() const {
|
||||
return url_request_getter_;
|
||||
return configurator_impl_.RequestContext();
|
||||
}
|
||||
|
||||
scoped_refptr<update_client::OutOfProcessPatcher>
|
||||
CefConfigurator::CreateOutOfProcessPatcher() const {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool CefConfigurator::DeltasEnabled() const {
|
||||
return deltas_enabled_;
|
||||
return configurator_impl_.DeltasEnabled();
|
||||
}
|
||||
|
||||
bool CefConfigurator::UseBackgroundDownloader() const {
|
||||
return background_downloads_enabled_;
|
||||
return configurator_impl_.UseBackgroundDownloader();
|
||||
}
|
||||
|
||||
bool CefConfigurator::UseCupSigning() const {
|
||||
return true;
|
||||
return configurator_impl_.UseCupSigning();
|
||||
}
|
||||
|
||||
// Returns a task runner to run blocking tasks. The task runner continues to run
|
||||
// after the browser shuts down, until the OS terminates the process. This
|
||||
// imposes certain requirements for the code using the task runner, such as
|
||||
// not accessing any global browser state while the code is running.
|
||||
scoped_refptr<base::SequencedTaskRunner>
|
||||
CefConfigurator::GetSequencedTaskRunner() const {
|
||||
return content::BrowserThread::GetBlockingPool()
|
||||
->GetSequencedTaskRunnerWithShutdownBehavior(
|
||||
base::SequencedWorkerPool::GetSequenceToken(),
|
||||
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
|
||||
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
|
||||
}
|
||||
|
||||
PrefService* CefConfigurator::GetPrefService() const {
|
||||
|
@@ -123,38 +123,28 @@ CefDevToolsFrontend* CefDevToolsFrontend::Show(
|
||||
CefBrowserHostImpl::Create(create_params);
|
||||
|
||||
content::WebContents* inspected_contents = inspected_browser->web_contents();
|
||||
if (!inspect_element_at.IsEmpty()) {
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host =
|
||||
content::DevToolsAgentHost::GetOrCreateFor(inspected_contents);
|
||||
agent_host->InspectElement(inspect_element_at.x, inspect_element_at.y);
|
||||
}
|
||||
|
||||
// CefDevToolsFrontend will delete itself when the frontend WebContents is
|
||||
// destroyed.
|
||||
CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend(
|
||||
static_cast<CefBrowserHostImpl*>(frontend_browser.get()),
|
||||
inspected_contents);
|
||||
inspected_contents, inspect_element_at);
|
||||
|
||||
// Need to load the URL after creating the DevTools objects.
|
||||
CefDevToolsDelegate* delegate =
|
||||
CefContentBrowserClient::Get()->devtools_delegate();
|
||||
frontend_browser->GetMainFrame()->LoadURL(delegate->GetChromeDevToolsURL());
|
||||
|
||||
devtools_frontend->Activate();
|
||||
devtools_frontend->Focus();
|
||||
|
||||
return devtools_frontend;
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::Activate() {
|
||||
frontend_browser_->ActivateContents(web_contents());
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::Focus() {
|
||||
web_contents()->Focus();
|
||||
frontend_browser_->SetFocus(true);
|
||||
}
|
||||
|
||||
void CefDevToolsFrontend::InspectElementAt(int x, int y) {
|
||||
if (inspect_element_at_.x != x || inspect_element_at_.y != y)
|
||||
inspect_element_at_.Set(x, y);
|
||||
if (agent_host_)
|
||||
agent_host_->InspectElement(x, y);
|
||||
}
|
||||
@@ -174,10 +164,12 @@ void CefDevToolsFrontend::DisconnectFromTarget() {
|
||||
|
||||
CefDevToolsFrontend::CefDevToolsFrontend(
|
||||
CefRefPtr<CefBrowserHostImpl> frontend_browser,
|
||||
content::WebContents* inspected_contents)
|
||||
content::WebContents* inspected_contents,
|
||||
const CefPoint& inspect_element_at)
|
||||
: WebContentsObserver(frontend_browser->web_contents()),
|
||||
frontend_browser_(frontend_browser),
|
||||
inspected_contents_(inspected_contents),
|
||||
inspect_element_at_(inspect_element_at),
|
||||
weak_factory_(this) {
|
||||
}
|
||||
|
||||
@@ -206,6 +198,9 @@ void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
|
||||
if (agent_host != agent_host_) {
|
||||
agent_host_ = agent_host;
|
||||
agent_host_->AttachClient(this);
|
||||
|
||||
if (!inspect_element_at_.IsEmpty())
|
||||
InspectElementAt(inspect_element_at_.x, inspect_element_at_.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,6 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
const CefBrowserSettings& settings,
|
||||
const CefPoint& inspect_element_at);
|
||||
|
||||
void Activate();
|
||||
void Focus();
|
||||
void InspectElementAt(int x, int y);
|
||||
void Close();
|
||||
@@ -54,7 +53,8 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
|
||||
private:
|
||||
CefDevToolsFrontend(CefRefPtr<CefBrowserHostImpl> frontend_browser,
|
||||
content::WebContents* inspected_contents);
|
||||
content::WebContents* inspected_contents,
|
||||
const CefPoint& inspect_element_at);
|
||||
~CefDevToolsFrontend() override;
|
||||
|
||||
// content::DevToolsAgentHostClient implementation.
|
||||
@@ -79,6 +79,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> frontend_browser_;
|
||||
content::WebContents* inspected_contents_;
|
||||
CefPoint inspect_element_at_;
|
||||
scoped_refptr<content::DevToolsAgentHost> agent_host_;
|
||||
std::unique_ptr<content::DevToolsFrontendHost> frontend_host_;
|
||||
using PendingRequestsMap = std::map<const net::URLFetcher*, int>;
|
||||
|
@@ -232,7 +232,8 @@ void CefBrowserPlatformDelegateNativeLinux::ViewText(const std::string& text) {
|
||||
std::string openCommand("xdg-open ");
|
||||
openCommand += newName;
|
||||
|
||||
system(openCommand.c_str());
|
||||
int result = system(openCommand.c_str());
|
||||
ALLOW_UNUSED_LOCAL(result);
|
||||
}
|
||||
|
||||
void CefBrowserPlatformDelegateNativeLinux::HandleKeyboardEvent(
|
||||
|
@@ -92,18 +92,6 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
// Called when we are activated (when we gain focus).
|
||||
- (void)windowDidBecomeKey:(NSNotification*)notification {
|
||||
if (browser_)
|
||||
browser_->SetFocus(true);
|
||||
}
|
||||
|
||||
// Called when we are deactivated (when we lose focus).
|
||||
- (void)windowDidResignKey:(NSNotification*)notification {
|
||||
if (browser_)
|
||||
browser_->SetFocus(false);
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(id)window {
|
||||
if (browser_ && !browser_->TryCloseBrowser()) {
|
||||
// Cancel the close.
|
||||
@@ -217,12 +205,12 @@ bool CefBrowserPlatformDelegateNativeMac::CreateHostWindow() {
|
||||
|
||||
parentView = [newWnd contentView];
|
||||
window_info_.parent_view = parentView;
|
||||
}
|
||||
|
||||
// Make the content view for the window have a layer. This will make all
|
||||
// sub-views have layers. This is necessary to ensure correct layer
|
||||
// ordering of all child views and their layers.
|
||||
[[[parentView window] contentView] setWantsLayer:YES];
|
||||
// Make the content view for the window have a layer. This will make all
|
||||
// sub-views have layers. This is necessary to ensure correct layer
|
||||
// ordering of all child views and their layers.
|
||||
[parentView setWantsLayer:YES];
|
||||
}
|
||||
|
||||
host_window_created_ = true;
|
||||
|
||||
|
@@ -235,8 +235,8 @@ namespace {
|
||||
void RunOpenFileDialog(
|
||||
const CefFileDialogRunner::FileChooserParams& params,
|
||||
NSView* view,
|
||||
int* filter_index,
|
||||
std::vector<base::FilePath>* files) {
|
||||
int filter_index,
|
||||
CefFileDialogRunner::RunFileChooserCallback callback) {
|
||||
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
|
||||
|
||||
base::string16 title;
|
||||
@@ -277,8 +277,8 @@ void RunOpenFileDialog(
|
||||
// Add the file filter control.
|
||||
filter_delegate =
|
||||
[[CefFilterDelegate alloc] initWithPanel:openPanel
|
||||
andAcceptFilters:params.accept_types
|
||||
andFilterIndex:*filter_index];
|
||||
andAcceptFilters:params.accept_types
|
||||
andFilterIndex:filter_index];
|
||||
}
|
||||
|
||||
// Further panel configuration.
|
||||
@@ -294,28 +294,27 @@ void RunOpenFileDialog(
|
||||
// Show panel.
|
||||
[openPanel beginSheetModalForWindow:[view window]
|
||||
completionHandler:^(NSInteger returnCode) {
|
||||
[NSApp stopModalWithCode:returnCode];
|
||||
}];
|
||||
NSInteger result = [NSApp runModalForWindow:[view window]];
|
||||
if (result == NSFileHandlingPanelOKButton) {
|
||||
NSArray *urls = [openPanel URLs];
|
||||
int i, count = [urls count];
|
||||
for (i=0; i<count; i++) {
|
||||
NSURL* url = [urls objectAtIndex:i];
|
||||
if ([url isFileURL])
|
||||
files->push_back(base::FilePath(base::SysNSStringToUTF8([url path])));
|
||||
int filter_index_to_use =
|
||||
(filter_delegate != nil) ? [filter_delegate filter] : filter_index;
|
||||
if (returnCode == NSFileHandlingPanelOKButton) {
|
||||
std::vector<base::FilePath> files;
|
||||
files.reserve(openPanel.URLs.count);
|
||||
for (NSURL* url in openPanel.URLs) {
|
||||
if (url.isFileURL)
|
||||
files.push_back(base::FilePath(url.path.UTF8String));
|
||||
}
|
||||
callback.Run(filter_index_to_use, files);
|
||||
} else {
|
||||
callback.Run(filter_index_to_use, std::vector<base::FilePath>());
|
||||
}
|
||||
}
|
||||
|
||||
if (filter_delegate != nil)
|
||||
*filter_index = [filter_delegate filter];
|
||||
}];
|
||||
}
|
||||
|
||||
bool RunSaveFileDialog(
|
||||
void RunSaveFileDialog(
|
||||
const CefFileDialogRunner::FileChooserParams& params,
|
||||
NSView* view,
|
||||
int* filter_index,
|
||||
base::FilePath* file) {
|
||||
int filter_index,
|
||||
CefFileDialogRunner::RunFileChooserCallback callback) {
|
||||
NSSavePanel* savePanel = [NSSavePanel savePanel];
|
||||
|
||||
base::string16 title;
|
||||
@@ -349,32 +348,27 @@ bool RunSaveFileDialog(
|
||||
// Add the file filter control.
|
||||
filter_delegate =
|
||||
[[CefFilterDelegate alloc] initWithPanel:savePanel
|
||||
andAcceptFilters:params.accept_types
|
||||
andFilterIndex:*filter_index];
|
||||
andAcceptFilters:params.accept_types
|
||||
andFilterIndex:filter_index];
|
||||
}
|
||||
|
||||
[savePanel setAllowsOtherFileTypes:YES];
|
||||
[savePanel setShowsHiddenFiles:!params.hidereadonly];
|
||||
|
||||
bool success = false;
|
||||
|
||||
// Show panel.
|
||||
[savePanel beginSheetModalForWindow:[view window]
|
||||
[savePanel beginSheetModalForWindow:view.window
|
||||
completionHandler:^(NSInteger resultCode) {
|
||||
[NSApp stopModalWithCode:resultCode];
|
||||
int filter_index_to_use =
|
||||
(filter_delegate != nil) ? [filter_delegate filter] : filter_index;
|
||||
if (resultCode == NSFileHandlingPanelOKButton) {
|
||||
NSURL* url = savePanel.URL;
|
||||
const char* path = url.path.UTF8String;
|
||||
std::vector<base::FilePath> files(1, base::FilePath(path));
|
||||
callback.Run(filter_index_to_use, files);
|
||||
} else {
|
||||
callback.Run(filter_index_to_use, std::vector<base::FilePath>());
|
||||
}
|
||||
}];
|
||||
NSInteger result = [NSApp runModalForWindow:[view window]];
|
||||
if (result == NSFileHandlingPanelOKButton) {
|
||||
NSURL* url = [savePanel URL];
|
||||
NSString* path = [url path];
|
||||
*file = base::FilePath([path UTF8String]);
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (filter_delegate != nil)
|
||||
*filter_index = [filter_delegate filter];
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -385,22 +379,16 @@ CefFileDialogRunnerMac::CefFileDialogRunnerMac() {
|
||||
void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser,
|
||||
const FileChooserParams& params,
|
||||
RunFileChooserCallback callback) {
|
||||
std::vector<base::FilePath> files;
|
||||
int filter_index = params.selected_accept_filter;
|
||||
NSView* owner = browser->GetWindowHandle();
|
||||
|
||||
if (params.mode == content::FileChooserParams::Open ||
|
||||
params.mode == content::FileChooserParams::OpenMultiple ||
|
||||
params.mode == content::FileChooserParams::UploadFolder) {
|
||||
RunOpenFileDialog(params, owner, &filter_index, &files);
|
||||
RunOpenFileDialog(params, owner, filter_index, callback);
|
||||
} else if (params.mode == content::FileChooserParams::Save) {
|
||||
base::FilePath file;
|
||||
if (RunSaveFileDialog(params, owner, &filter_index, &file)) {
|
||||
files.push_back(file);
|
||||
}
|
||||
RunSaveFileDialog(params, owner, filter_index, callback);
|
||||
} else {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
callback.Run(filter_index, files);
|
||||
}
|
||||
|
@@ -258,16 +258,15 @@ class NativeMenuWin::MenuHostWindow {
|
||||
gfx::Image icon;
|
||||
if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) {
|
||||
// We currently don't support items with both icons and checkboxes.
|
||||
const gfx::ImageSkia* skia_icon = icon.ToImageSkia();
|
||||
const gfx::ImageSkia skia_icon = icon.AsImageSkia();
|
||||
DCHECK(type != ui::MenuModel::TYPE_CHECK);
|
||||
gfx::Canvas canvas(
|
||||
skia_icon->GetRepresentation(1.0f),
|
||||
false);
|
||||
gfx::Canvas canvas(skia_icon.size(), 1.0f, false);
|
||||
canvas.DrawImageInt(skia_icon, 0, 0);
|
||||
skia::DrawToNativeContext(
|
||||
canvas.sk_canvas(), dc,
|
||||
draw_item_struct->rcItem.left + kItemLeftMargin,
|
||||
draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom -
|
||||
draw_item_struct->rcItem.top - skia_icon->height()) / 2, NULL);
|
||||
draw_item_struct->rcItem.top - skia_icon.height()) / 2, NULL);
|
||||
} else if (type == ui::MenuModel::TYPE_CHECK &&
|
||||
data->native_menu_win->model_->IsItemCheckedAt(
|
||||
data->model_index)) {
|
||||
|
@@ -18,6 +18,9 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "chrome/browser/net/safe_search_util.h"
|
||||
#include "components/prefs/pref_member.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "net/filter/filter.h"
|
||||
@@ -38,10 +41,12 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
CefRefPtr<CefRequestImpl> cef_request,
|
||||
GURL* new_url,
|
||||
net::URLRequest* url_request,
|
||||
bool force_google_safesearch,
|
||||
const CallbackType& callback)
|
||||
: cef_request_(cef_request),
|
||||
new_url_(new_url),
|
||||
url_request_(url_request),
|
||||
force_google_safesearch_(force_google_safesearch),
|
||||
callback_(callback) {
|
||||
DCHECK(new_url);
|
||||
DCHECK(url_request_);
|
||||
@@ -54,11 +59,13 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
if (!callback_.is_null()) {
|
||||
// The callback is still pending. Cancel it now.
|
||||
if (CEF_CURRENTLY_ON_IOT()) {
|
||||
RunNow(cef_request_, new_url_, url_request_, callback_, false);
|
||||
RunNow(cef_request_, new_url_, url_request_, callback_,
|
||||
force_google_safesearch_, false);
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_IOT,
|
||||
base::Bind(&CefBeforeResourceLoadCallbackImpl::RunNow,
|
||||
cef_request_, new_url_, url_request_, callback_, false));
|
||||
cef_request_, new_url_, url_request_, callback_,
|
||||
force_google_safesearch_, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +84,8 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
void ContinueNow(bool allow) {
|
||||
CEF_REQUIRE_IOT();
|
||||
if (!callback_.is_null()) {
|
||||
RunNow(cef_request_, new_url_, url_request_, callback_, allow);
|
||||
RunNow(cef_request_, new_url_, url_request_, callback_,
|
||||
force_google_safesearch_, allow);
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
@@ -115,6 +123,7 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
GURL* new_url,
|
||||
net::URLRequest* request,
|
||||
const CallbackType& callback,
|
||||
bool force_google_safesearch,
|
||||
bool allow) {
|
||||
CEF_REQUIRE_IOT();
|
||||
|
||||
@@ -139,8 +148,12 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
request->RemoveUserData(UserDataKey());
|
||||
|
||||
// Only execute the callback if the request has not been canceled.
|
||||
if (request->status().status() != net::URLRequestStatus::CANCELED)
|
||||
if (request->status().status() != net::URLRequestStatus::CANCELED) {
|
||||
if (force_google_safesearch && allow && new_url->is_empty())
|
||||
safe_search_util::ForceGoogleSafeSearch(request, new_url);
|
||||
|
||||
callback.Run(allow ? net::OK : net::ERR_ABORTED);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void* UserDataKey() {
|
||||
@@ -151,6 +164,7 @@ class CefBeforeResourceLoadCallbackImpl : public CefRequestCallback {
|
||||
const GURL old_url_;
|
||||
GURL* new_url_;
|
||||
net::URLRequest* url_request_;
|
||||
bool force_google_safesearch_;
|
||||
CallbackType callback_;
|
||||
|
||||
// The user data key.
|
||||
@@ -224,7 +238,8 @@ class CefAuthCallbackImpl : public CefAuthCallback {
|
||||
|
||||
} // namespace
|
||||
|
||||
CefNetworkDelegate::CefNetworkDelegate() {
|
||||
CefNetworkDelegate::CefNetworkDelegate()
|
||||
: force_google_safesearch_(nullptr) {
|
||||
}
|
||||
|
||||
CefNetworkDelegate::~CefNetworkDelegate() {
|
||||
@@ -255,6 +270,9 @@ int CefNetworkDelegate::OnBeforeURLRequest(
|
||||
net::URLRequest* request,
|
||||
const net::CompletionCallback& callback,
|
||||
GURL* new_url) {
|
||||
const bool force_google_safesearch =
|
||||
(force_google_safesearch_ && force_google_safesearch_->GetValue());
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForRequest(request);
|
||||
if (browser.get()) {
|
||||
@@ -279,6 +297,7 @@ int CefNetworkDelegate::OnBeforeURLRequest(
|
||||
|
||||
CefRefPtr<CefBeforeResourceLoadCallbackImpl> callbackImpl(
|
||||
new CefBeforeResourceLoadCallbackImpl(requestPtr, new_url, request,
|
||||
force_google_safesearch,
|
||||
callback));
|
||||
|
||||
// Give the client an opportunity to evaluate the request.
|
||||
@@ -298,6 +317,9 @@ int CefNetworkDelegate::OnBeforeURLRequest(
|
||||
}
|
||||
}
|
||||
|
||||
if (force_google_safesearch && new_url->is_empty())
|
||||
safe_search_util::ForceGoogleSafeSearch(request, new_url);
|
||||
|
||||
// Continue the request immediately.
|
||||
return net::OK;
|
||||
}
|
||||
|
@@ -9,6 +9,9 @@
|
||||
#include "base/macros.h"
|
||||
#include "net/base/network_delegate_impl.h"
|
||||
|
||||
template<class T> class PrefMember;
|
||||
typedef PrefMember<bool> BooleanPrefMember;
|
||||
|
||||
// Used for intercepting resource requests, redirects and responses. The single
|
||||
// instance of this class is managed by CefURLRequestContextGetter.
|
||||
class CefNetworkDelegate : public net::NetworkDelegateImpl {
|
||||
@@ -21,6 +24,11 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
|
||||
static bool AreExperimentalCookieFeaturesEnabled();
|
||||
static bool AreStrictSecureCookiesEnabled();
|
||||
|
||||
void set_force_google_safesearch(
|
||||
BooleanPrefMember* force_google_safesearch) {
|
||||
force_google_safesearch_ = force_google_safesearch;
|
||||
}
|
||||
|
||||
private:
|
||||
// net::NetworkDelegate methods.
|
||||
int OnBeforeURLRequest(net::URLRequest* request,
|
||||
@@ -39,6 +47,9 @@ class CefNetworkDelegate : public net::NetworkDelegateImpl {
|
||||
net::Filter* SetupFilter(net::URLRequest* request,
|
||||
net::Filter* filter_list) override;
|
||||
|
||||
// Weak, owned by our owner (CefURLRequestContextGetterImpl).
|
||||
BooleanPrefMember* force_google_safesearch_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefNetworkDelegate);
|
||||
};
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/net/proxy_service_factory.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
@@ -120,6 +121,19 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
|
||||
|
||||
std::swap(protocol_handlers_, *protocol_handlers);
|
||||
|
||||
auto io_thread_proxy =
|
||||
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
|
||||
|
||||
quick_check_enabled_.Init(prefs::kQuickCheckEnabled, pref_service);
|
||||
quick_check_enabled_.MoveToThread(io_thread_proxy);
|
||||
|
||||
pac_https_url_stripping_enabled_.Init(prefs::kPacHttpsUrlStrippingEnabled,
|
||||
pref_service);
|
||||
pac_https_url_stripping_enabled_.MoveToThread(io_thread_proxy);
|
||||
|
||||
force_google_safesearch_.Init(prefs::kForceGoogleSafeSearch, pref_service);
|
||||
force_google_safesearch_.MoveToThread(io_thread_proxy);
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||
gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName);
|
||||
#endif
|
||||
@@ -134,6 +148,27 @@ CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() {
|
||||
storage_->set_proxy_service(NULL);
|
||||
}
|
||||
|
||||
// static
|
||||
void CefURLRequestContextGetterImpl::RegisterPrefs(
|
||||
PrefRegistrySimple* registry) {
|
||||
// Based on IOThread::RegisterPrefs.
|
||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||
registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string());
|
||||
#endif
|
||||
registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kPacHttpsUrlStrippingEnabled, true);
|
||||
|
||||
// Based on ProfileImpl::RegisterProfilePrefs.
|
||||
registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false);
|
||||
}
|
||||
|
||||
void CefURLRequestContextGetterImpl::ShutdownOnUIThread() {
|
||||
CEF_REQUIRE_UIT();
|
||||
quick_check_enabled_.Destroy();
|
||||
pac_https_url_stripping_enabled_.Destroy();
|
||||
force_google_safesearch_.Destroy();
|
||||
}
|
||||
|
||||
net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
||||
CEF_REQUIRE_IOT();
|
||||
|
||||
@@ -152,7 +187,10 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
||||
SetCookieStoragePath(cache_path,
|
||||
settings_.persist_session_cookies ? true : false);
|
||||
|
||||
storage_->set_network_delegate(base::WrapUnique(new CefNetworkDelegate));
|
||||
std::unique_ptr<CefNetworkDelegate> network_delegate(
|
||||
new CefNetworkDelegate());
|
||||
network_delegate->set_force_google_safesearch(&force_google_safesearch_);
|
||||
storage_->set_network_delegate(std::move(network_delegate));
|
||||
|
||||
storage_->set_channel_id_service(base::WrapUnique(
|
||||
new net::ChannelIDService(
|
||||
@@ -177,7 +215,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
||||
url_request_context_->network_delegate(),
|
||||
std::move(proxy_config_service_),
|
||||
*command_line,
|
||||
true);
|
||||
quick_check_enabled_.GetValue(),
|
||||
pac_https_url_stripping_enabled_.GetValue());
|
||||
storage_->set_proxy_service(std::move(system_proxy_service));
|
||||
|
||||
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
|
||||
@@ -202,11 +241,14 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
|
||||
storage_->set_http_server_properties(base::WrapUnique(
|
||||
new net::HttpServerPropertiesImpl));
|
||||
|
||||
base::FilePath http_cache_path;
|
||||
if (!cache_path.empty())
|
||||
http_cache_path = cache_path.Append(FILE_PATH_LITERAL("Cache"));
|
||||
std::unique_ptr<net::HttpCache::DefaultBackend> main_backend(
|
||||
new net::HttpCache::DefaultBackend(
|
||||
cache_path.empty() ? net::MEMORY_CACHE : net::DISK_CACHE,
|
||||
net::CACHE_BACKEND_DEFAULT,
|
||||
cache_path,
|
||||
http_cache_path,
|
||||
0,
|
||||
BrowserThread::GetMessageLoopProxyForThread(
|
||||
BrowserThread::CACHE)));
|
||||
|
@@ -17,9 +17,11 @@
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "components/prefs/pref_member.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "net/url_request/url_request_job_factory.h"
|
||||
|
||||
class PrefRegistrySimple;
|
||||
class PrefService;
|
||||
|
||||
namespace base {
|
||||
@@ -52,6 +54,12 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
|
||||
content::URLRequestInterceptorScopedVector request_interceptors);
|
||||
~CefURLRequestContextGetterImpl() override;
|
||||
|
||||
// Register preferences. Called from browser_prefs::CreatePrefService().
|
||||
static void RegisterPrefs(PrefRegistrySimple* registry);
|
||||
|
||||
// Called when the BrowserContextImpl is destroyed.
|
||||
void ShutdownOnUIThread();
|
||||
|
||||
// net::URLRequestContextGetter implementation.
|
||||
net::URLRequestContext* GetURLRequestContext() override;
|
||||
scoped_refptr<base::SingleThreadTaskRunner>
|
||||
@@ -102,6 +110,12 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
|
||||
|
||||
std::vector<CefRefPtr<CefRequestContextHandler> > handler_list_;
|
||||
|
||||
BooleanPrefMember quick_check_enabled_;
|
||||
BooleanPrefMember pac_https_url_stripping_enabled_;
|
||||
|
||||
// Member variables which are pointed to by the various context objects.
|
||||
mutable BooleanPrefMember force_google_safesearch_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CefURLRequestContextGetterImpl);
|
||||
};
|
||||
|
||||
|
@@ -1085,6 +1085,10 @@ void CefRenderWidgetHostViewOSR::SetBeginFrameSource(
|
||||
// See https://codereview.chromium.org/1841083007.
|
||||
}
|
||||
|
||||
bool CefRenderWidgetHostViewOSR::IsAutoResizeEnabled() const {
|
||||
return render_widget_host_->auto_resize_enabled();
|
||||
}
|
||||
|
||||
bool CefRenderWidgetHostViewOSR::InstallTransparency() {
|
||||
if (transparent_) {
|
||||
SetBackgroundColor(SkColor());
|
||||
@@ -1137,13 +1141,7 @@ void CefRenderWidgetHostViewOSR::Invalidate(
|
||||
const gfx::Rect& bounds_in_pixels = gfx::Rect(GetPhysicalBackingSize());
|
||||
|
||||
if (software_output_device_) {
|
||||
if (IsFramePending()) {
|
||||
// Include the invalidated region in the next frame generated.
|
||||
software_output_device_->Invalidate(bounds_in_pixels);
|
||||
} else {
|
||||
// Call OnPaint immediately.
|
||||
software_output_device_->OnPaint(bounds_in_pixels);
|
||||
}
|
||||
software_output_device_->OnPaint(bounds_in_pixels);
|
||||
} else if (copy_frame_generator_.get()) {
|
||||
copy_frame_generator_->GenerateCopyFrame(true, bounds_in_pixels);
|
||||
}
|
||||
@@ -1377,18 +1375,7 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer() {
|
||||
|
||||
root_layer_->SetBounds(gfx::Rect(size));
|
||||
compositor_->SetScaleAndSize(scale_factor_, size_in_pixels);
|
||||
}
|
||||
|
||||
bool CefRenderWidgetHostViewOSR::IsFramePending() {
|
||||
if (!IsShowing())
|
||||
return false;
|
||||
|
||||
if (begin_frame_timer_.get())
|
||||
return begin_frame_timer_->IsActive();
|
||||
else if (copy_frame_generator_.get())
|
||||
return copy_frame_generator_->frame_pending();
|
||||
|
||||
return false;
|
||||
PlatformResizeCompositorWidget(size_in_pixels);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::OnBeginFrameTimerTick() {
|
||||
|
@@ -220,6 +220,7 @@ class CefRenderWidgetHostViewOSR
|
||||
const base::TimeTicks& timebase,
|
||||
const base::TimeDelta& interval) override;
|
||||
void SetBeginFrameSource(cc::BeginFrameSource* source) override;
|
||||
bool IsAutoResizeEnabled() const override;
|
||||
|
||||
bool InstallTransparency();
|
||||
|
||||
@@ -282,9 +283,6 @@ class CefRenderWidgetHostViewOSR
|
||||
void SetDeviceScaleFactor();
|
||||
void ResizeRootLayer();
|
||||
|
||||
// Returns a best guess whether a frame is currently pending.
|
||||
bool IsFramePending();
|
||||
|
||||
// Called by CefBeginFrameTimer to send a BeginFrame request.
|
||||
void OnBeginFrameTimerTick();
|
||||
void SendBeginFrame(base::TimeTicks frame_time,
|
||||
@@ -317,6 +315,7 @@ class CefRenderWidgetHostViewOSR
|
||||
#endif // defined(OS_MACOSX)
|
||||
|
||||
void PlatformCreateCompositorWidget();
|
||||
void PlatformResizeCompositorWidget(const gfx::Size& size);
|
||||
void PlatformDestroyCompositorWidget();
|
||||
|
||||
#if defined(USE_AURA)
|
||||
|
@@ -123,6 +123,9 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
|
||||
compositor_widget_ = window_->xwindow();
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size&) {
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
|
||||
DCHECK(window_);
|
||||
window_->Close();
|
||||
|
@@ -318,6 +318,9 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
|
||||
browser_compositor_->Unsuspend();
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size&) {
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
|
||||
DCHECK(window_);
|
||||
|
||||
|
@@ -149,6 +149,12 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
|
||||
compositor_widget_ = window_->hwnd();
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(const gfx::Size& size) {
|
||||
DCHECK(window_);
|
||||
SetWindowPos(window_->hwnd(), NULL, 0, 0, size.width(), size.height(),
|
||||
SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW);
|
||||
}
|
||||
|
||||
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
|
||||
window_.reset(NULL);
|
||||
compositor_widget_ = gfx::kNullAcceleratedWidget;
|
||||
|
@@ -5,6 +5,7 @@
|
||||
#include "libcef/browser/prefs/browser_prefs.h"
|
||||
|
||||
#include "libcef/browser/media_capture_devices_dispatcher.h"
|
||||
#include "libcef/browser/net/url_request_context_getter_impl.h"
|
||||
#include "libcef/browser/prefs/renderer_prefs.h"
|
||||
#include "libcef/common/cef_switches.h"
|
||||
|
||||
@@ -126,6 +127,7 @@ std::unique_ptr<PrefService> CreatePrefService(const base::FilePath& pref_path)
|
||||
PrefProxyConfigTrackerImpl::RegisterPrefs(registry.get());
|
||||
extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get());
|
||||
HostContentSettingsMap::RegisterProfilePrefs(registry.get());
|
||||
CefURLRequestContextGetterImpl::RegisterPrefs(registry.get());
|
||||
renderer_prefs::RegisterProfilePrefs(registry.get());
|
||||
update_client::RegisterPrefs(registry.get());
|
||||
|
||||
@@ -160,12 +162,6 @@ std::unique_ptr<PrefService> CreatePrefService(const base::FilePath& pref_path)
|
||||
registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false);
|
||||
registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, false);
|
||||
|
||||
// Network preferences.
|
||||
// Based on IOThread::RegisterPrefs.
|
||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||
registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string());
|
||||
#endif
|
||||
|
||||
if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) {
|
||||
// Preferences used with unit tests.
|
||||
registry->RegisterBooleanPref("test.bool", true);
|
||||
|
@@ -87,10 +87,12 @@ bool CefResourceDispatcherHostDelegate::HandleExternalProtocol(
|
||||
bool has_user_gesture) {
|
||||
if (CEF_CURRENTLY_ON_UIT()) {
|
||||
content::WebContents* web_contents = web_contents_getter.Run();
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
if (browser.get())
|
||||
browser->HandleExternalProtocol(url);
|
||||
if (web_contents) {
|
||||
CefRefPtr<CefBrowserHostImpl> browser =
|
||||
CefBrowserHostImpl::GetBrowserForContents(web_contents);
|
||||
if (browser.get())
|
||||
browser->HandleExternalProtocol(url);
|
||||
}
|
||||
} else {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(base::IgnoreResult(&CefResourceDispatcherHostDelegate::
|
||||
|
@@ -200,7 +200,7 @@ display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
|
||||
find_bounds);
|
||||
}
|
||||
#endif
|
||||
return display::Screen::GetScreen()->GetDisplayMatching(bounds);
|
||||
return display::Screen::GetScreen()->GetDisplayMatching(find_bounds);
|
||||
}
|
||||
|
||||
void ConvertPointFromPixels(gfx::Point* point,
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "chrome/common/chrome_constants.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "components/component_updater/component_updater_paths.h"
|
||||
#include "components/content_settings/core/common/content_settings_pattern.h"
|
||||
#include "content/public/browser/browser_main_runner.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
@@ -559,21 +560,23 @@ void CefMainDelegate::PreSandboxStartup() {
|
||||
false, // May not be an absolute path.
|
||||
true); // Create if necessary.
|
||||
|
||||
const base::FilePath& resources_path = GetResourcesFilePath();
|
||||
|
||||
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||
const base::FilePath& widevine_plugin_path =
|
||||
GetResourcesFilePath().AppendASCII(kWidevineCdmAdapterFileName);
|
||||
resources_path.AppendASCII(kWidevineCdmAdapterFileName);
|
||||
if (base::PathExists(widevine_plugin_path)) {
|
||||
PathService::Override(chrome::FILE_WIDEVINE_CDM_ADAPTER,
|
||||
widevine_plugin_path);
|
||||
}
|
||||
#if defined(WIDEVINE_CDM_IS_COMPONENT)
|
||||
if (command_line->HasSwitch(switches::kEnableWidevineCdm)) {
|
||||
PathService::Override(
|
||||
chrome::DIR_COMPONENT_WIDEVINE_CDM,
|
||||
user_data_path.Append(FILE_PATH_LITERAL("WidevineCDM")));
|
||||
}
|
||||
#endif // defined(WIDEVINE_CDM_IS_COMPONENT)
|
||||
#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
|
||||
|
||||
// Paths to find pre-installed components.
|
||||
PathService::Override(chrome::DIR_COMPONENTS, resources_path);
|
||||
|
||||
// Register paths to be used by the component updater.
|
||||
component_updater::RegisterPathProvider(chrome::DIR_COMPONENTS,
|
||||
chrome::DIR_USER_DATA);
|
||||
}
|
||||
|
||||
if (command_line->HasSwitch(switches::kDisablePackLoading))
|
||||
|
@@ -85,7 +85,8 @@ scoped_refptr<base::SequencedTaskRunner>
|
||||
break;
|
||||
};
|
||||
|
||||
if (id >= 0 && CefContentClient::Get()->browser() &&
|
||||
if (id >= 0 && CefContentClient::Get() &&
|
||||
CefContentClient::Get()->browser() &&
|
||||
BrowserThread::IsMessageLoopValid(static_cast<BrowserThread::ID>(id))) {
|
||||
// Don't use BrowserThread::GetMessageLoopProxyForThread because it returns
|
||||
// a new MessageLoopProxy object for each call and makes pointer equality
|
||||
|
@@ -689,7 +689,7 @@ void CefBrowserImpl::OnLoadStart(blink::WebLocalFrame* frame) {
|
||||
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
|
||||
if (load_handler.get()) {
|
||||
CefRefPtr<CefFrameImpl> cef_frame = GetWebFrameImpl(frame);
|
||||
load_handler->OnLoadStart(this, cef_frame.get());
|
||||
load_handler->OnLoadStart(this, cef_frame.get(), TT_EXPLICIT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -425,19 +425,7 @@ void CEF_CALLBACK browser_host_show_dev_tools(struct _cef_browser_host_t* self,
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: windowInfo; type: struct_byref_const
|
||||
DCHECK(windowInfo);
|
||||
if (!windowInfo)
|
||||
return;
|
||||
// Verify param: client; type: refptr_diff
|
||||
DCHECK(client);
|
||||
if (!client)
|
||||
return;
|
||||
// Verify param: settings; type: struct_byref_const
|
||||
DCHECK(settings);
|
||||
if (!settings)
|
||||
return;
|
||||
// Unverified params: inspect_element_at
|
||||
// Unverified params: windowInfo, client, settings, inspect_element_at
|
||||
|
||||
// Translate param: windowInfo; type: struct_byref_const
|
||||
CefWindowInfo windowInfoObj;
|
||||
@@ -471,6 +459,20 @@ void CEF_CALLBACK browser_host_close_dev_tools(
|
||||
CefBrowserHostCppToC::Get(self)->CloseDevTools();
|
||||
}
|
||||
|
||||
int CEF_CALLBACK browser_host_has_dev_tools(struct _cef_browser_host_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefBrowserHostCppToC::Get(self)->HasDevTools();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK browser_host_get_navigation_entries(
|
||||
struct _cef_browser_host_t* self, cef_navigation_entry_visitor_t* visitor,
|
||||
int current_only) {
|
||||
@@ -962,6 +964,7 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
|
||||
GetStruct()->stop_finding = browser_host_stop_finding;
|
||||
GetStruct()->show_dev_tools = browser_host_show_dev_tools;
|
||||
GetStruct()->close_dev_tools = browser_host_close_dev_tools;
|
||||
GetStruct()->has_dev_tools = browser_host_has_dev_tools;
|
||||
GetStruct()->get_navigation_entries = browser_host_get_navigation_entries;
|
||||
GetStruct()->set_mouse_cursor_change_disabled =
|
||||
browser_host_set_mouse_cursor_change_disabled;
|
||||
|
@@ -41,7 +41,8 @@ void CEF_CALLBACK load_handler_on_loading_state_change(
|
||||
}
|
||||
|
||||
void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self,
|
||||
cef_browser_t* browser, cef_frame_t* frame) {
|
||||
cef_browser_t* browser, cef_frame_t* frame,
|
||||
cef_transition_type_t transition_type) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
@@ -59,7 +60,8 @@ void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self,
|
||||
// Execute
|
||||
CefLoadHandlerCppToC::Get(self)->OnLoadStart(
|
||||
CefBrowserCToCpp::Wrap(browser),
|
||||
CefFrameCToCpp::Wrap(frame));
|
||||
CefFrameCToCpp::Wrap(frame),
|
||||
transition_type);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self,
|
||||
|
@@ -58,7 +58,7 @@ CEF_EXPORT cef_request_context_t* cef_request_context_create_context(
|
||||
return CefRequestContextCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
CEF_EXPORT cef_request_context_t* create_context_shared(
|
||||
CEF_EXPORT cef_request_context_t* cef_create_context_shared(
|
||||
cef_request_context_t* other,
|
||||
struct _cef_request_context_handler_t* handler) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
@@ -375,11 +375,7 @@ void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo,
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: client; type: refptr_diff
|
||||
DCHECK(client.get());
|
||||
if (!client.get())
|
||||
return;
|
||||
// Unverified params: inspect_element_at
|
||||
// Unverified params: windowInfo, client, settings, inspect_element_at
|
||||
|
||||
// Execute
|
||||
_struct->show_dev_tools(_struct,
|
||||
@@ -400,6 +396,20 @@ void CefBrowserHostCToCpp::CloseDevTools() {
|
||||
_struct->close_dev_tools(_struct);
|
||||
}
|
||||
|
||||
bool CefBrowserHostCToCpp::HasDevTools() {
|
||||
cef_browser_host_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, has_dev_tools))
|
||||
return false;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->has_dev_tools(_struct);
|
||||
|
||||
// Return type: bool
|
||||
return _retval?true:false;
|
||||
}
|
||||
|
||||
void CefBrowserHostCToCpp::GetNavigationEntries(
|
||||
CefRefPtr<CefNavigationEntryVisitor> visitor, bool current_only) {
|
||||
cef_browser_host_t* _struct = GetStruct();
|
||||
|
@@ -63,6 +63,7 @@ class CefBrowserHostCToCpp
|
||||
CefRefPtr<CefClient> client, const CefBrowserSettings& settings,
|
||||
const CefPoint& inspect_element_at) OVERRIDE;
|
||||
void CloseDevTools() OVERRIDE;
|
||||
bool HasDevTools() OVERRIDE;
|
||||
void GetNavigationEntries(CefRefPtr<CefNavigationEntryVisitor> visitor,
|
||||
bool current_only) OVERRIDE;
|
||||
void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE;
|
||||
|
@@ -39,7 +39,7 @@ void CefLoadHandlerCToCpp::OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
|
||||
}
|
||||
|
||||
void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) {
|
||||
CefRefPtr<CefFrame> frame, TransitionType transition_type) {
|
||||
cef_load_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_load_start))
|
||||
return;
|
||||
@@ -58,7 +58,8 @@ void CefLoadHandlerCToCpp::OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
// Execute
|
||||
_struct->on_load_start(_struct,
|
||||
CefBrowserCppToC::Wrap(browser),
|
||||
CefFrameCppToC::Wrap(frame));
|
||||
CefFrameCppToC::Wrap(frame),
|
||||
transition_type);
|
||||
}
|
||||
|
||||
void CefLoadHandlerCToCpp::OnLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||
|
@@ -33,8 +33,8 @@ class CefLoadHandlerCToCpp
|
||||
// CefLoadHandler methods.
|
||||
void OnLoadingStateChange(CefRefPtr<CefBrowser> browser, bool isLoading,
|
||||
bool canGoBack, bool canGoForward) override;
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override;
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override;
|
||||
void OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
int httpStatusCode) override;
|
||||
void OnLoadError(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
|
||||
|
@@ -61,7 +61,7 @@ CefRefPtr<CefRequestContext> CefRequestContext::CreateContext(
|
||||
// Unverified params: handler
|
||||
|
||||
// Execute
|
||||
cef_request_context_t* _retval = create_context_shared(
|
||||
cef_request_context_t* _retval = cef_create_context_shared(
|
||||
CefRequestContextCToCpp::Unwrap(other),
|
||||
CefRequestContextHandlerCppToC::Wrap(handler));
|
||||
|
||||
|
9
libcef_dll/libcef.lst
Normal file
9
libcef_dll/libcef.lst
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright 2016 The Chromium Embedded Framework Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
{
|
||||
/* Only export necessary symbols from libcef.so. */
|
||||
global: cef_*;
|
||||
local: *;
|
||||
};
|
@@ -33,6 +33,9 @@ patches = [
|
||||
{
|
||||
# Fix ninja output for localization directories on OS X.
|
||||
# https://bugs.chromium.org/p/gyp/issues/detail?id=331
|
||||
#
|
||||
# Write environment.* files with the correct SDK version on Windows.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=634788
|
||||
'name': 'gyp_331',
|
||||
'path': '../tools/gyp/pylib/',
|
||||
},
|
||||
@@ -248,4 +251,11 @@ patches = [
|
||||
'name': 'render_view_host_impl_1392',
|
||||
'path': '../content/browser/renderer_host/',
|
||||
},
|
||||
{
|
||||
# Fix crash when scrolling to the bottom of an iframe with
|
||||
# --root-layer-scrolls
|
||||
# https://codereview.chromium.org/2150153002
|
||||
'name': 'viewport_2150153002',
|
||||
'path': '../',
|
||||
},
|
||||
]
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
|
||||
index 54d6c4c..4a5268d 100644
|
||||
index 839f8ff..b65a1b4 100644
|
||||
--- render_widget_host_view_guest.cc
|
||||
+++ render_widget_host_view_guest.cc
|
||||
@@ -212,6 +212,9 @@ void RenderWidgetHostViewGuest::Destroy() {
|
||||
@@ -243,6 +243,9 @@ void RenderWidgetHostViewGuest::Destroy() {
|
||||
}
|
||||
|
||||
gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git common.gypi common.gypi
|
||||
index 3724f2f..5eb9cde 100644
|
||||
index 2850490..a00882f 100644
|
||||
--- common.gypi
|
||||
+++ common.gypi
|
||||
@@ -9,6 +9,9 @@
|
||||
|
@@ -39,10 +39,10 @@ index d96adc9..348ae16 100644
|
||||
// built in media player for the given |url|. Defaults to false.
|
||||
virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
|
||||
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
|
||||
index 4ff6aaa..4309775 100644
|
||||
index 400a60c..2c9fe67 100644
|
||||
--- renderer/render_frame_impl.cc
|
||||
+++ renderer/render_frame_impl.cc
|
||||
@@ -4771,7 +4771,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
|
||||
@@ -4779,7 +4779,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
|
||||
(pending_navigation_params_ &&
|
||||
!pending_navigation_params_->request_params.redirects.empty());
|
||||
|
||||
@@ -50,7 +50,7 @@ index 4ff6aaa..4309775 100644
|
||||
// The handlenavigation API is deprecated and will be removed once
|
||||
// crbug.com/325351 is resolved.
|
||||
if (GetContentClient()->renderer()->HandleNavigation(
|
||||
@@ -4780,7 +4779,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
|
||||
@@ -4788,7 +4787,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
|
||||
is_redirect)) {
|
||||
return blink::WebNavigationPolicyIgnore;
|
||||
}
|
||||
|
@@ -1,3 +1,26 @@
|
||||
diff --git gyp/MSVSVersion.py gyp/MSVSVersion.py
|
||||
index edaf6ee..c213df8 100644
|
||||
--- gyp/MSVSVersion.py
|
||||
+++ gyp/MSVSVersion.py
|
||||
@@ -92,7 +92,8 @@ class VisualStudioVersion(object):
|
||||
# VS2013 and later, non-Express have a x64-x86 cross that we want
|
||||
# to prefer.
|
||||
return [os.path.normpath(
|
||||
- os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86']
|
||||
+ os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86', \
|
||||
+ '10.0.10586.0']
|
||||
# Otherwise, the standard x86 compiler.
|
||||
return [os.path.normpath(
|
||||
os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))]
|
||||
@@ -106,7 +107,7 @@ class VisualStudioVersion(object):
|
||||
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
|
||||
arg = 'amd64'
|
||||
return [os.path.normpath(
|
||||
- os.path.join(self.path, 'VC/vcvarsall.bat')), arg]
|
||||
+ os.path.join(self.path, 'VC/vcvarsall.bat')), arg, '10.0.10586.0']
|
||||
|
||||
def SetupScript(self, target_arch):
|
||||
script_data = self._SetupScriptInternal(target_arch)
|
||||
diff --git gyp/generator/ninja.py gyp/generator/ninja.py
|
||||
index 9cfc706..932dc86 100644
|
||||
--- gyp/generator/ninja.py
|
||||
|
@@ -35,10 +35,10 @@ index 54b8ed4..160991f 100644
|
||||
bool inert_visual_viewport;
|
||||
bool record_whole_document;
|
||||
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
|
||||
index 71c52a3..cef247f 100644
|
||||
index c6c6a49..3b57491 100644
|
||||
--- renderer/render_view_impl.cc
|
||||
+++ renderer/render_view_impl.cc
|
||||
@@ -1475,6 +1475,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
|
||||
@@ -1478,6 +1478,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
|
||||
blink::WebView* web_view,
|
||||
CompositorDependencies* compositor_deps) {
|
||||
ApplyWebPreferences(prefs, web_view);
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
|
||||
index 86481a9..e2e56c0 100644
|
||||
index bc7ed53..b673bd4 100644
|
||||
--- render_widget_host_view_mac.mm
|
||||
+++ render_widget_host_view_mac.mm
|
||||
@@ -572,9 +572,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
|
||||
@@ -577,9 +577,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
|
||||
// Paint this view host with |background_color_| when there is no content
|
||||
// ready to draw.
|
||||
background_layer_.reset([[CALayer alloc] init]);
|
||||
|
24
patch/patches/viewport_2150153002.patch
Normal file
24
patch/patches/viewport_2150153002.patch
Normal file
@@ -0,0 +1,24 @@
|
||||
diff --git cc/layers/viewport.cc cc/layers/viewport.cc
|
||||
index d80d40c..30984592 100644
|
||||
--- cc/layers/viewport.cc
|
||||
+++ cc/layers/viewport.cc
|
||||
@@ -36,6 +36,9 @@ Viewport::ScrollResult Viewport::ScrollBy(const gfx::Vector2dF& delta,
|
||||
const gfx::Point& viewport_point,
|
||||
bool is_direct_manipulation,
|
||||
bool affect_top_controls) {
|
||||
+ if (!OuterScrollLayer())
|
||||
+ return ScrollResult();
|
||||
+
|
||||
gfx::Vector2dF content_delta = delta;
|
||||
|
||||
if (affect_top_controls && ShouldTopControlsConsumeScroll(delta))
|
||||
@@ -74,6 +77,9 @@ bool Viewport::ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta,
|
||||
}
|
||||
|
||||
gfx::Vector2dF Viewport::ScrollAnimated(const gfx::Vector2dF& delta) {
|
||||
+ if (!OuterScrollLayer())
|
||||
+ return gfx::Vector2dF(0, 0);
|
||||
+
|
||||
ScrollTree& scroll_tree =
|
||||
host_impl_->active_tree()->property_trees()->scroll_tree;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index c33e325c..04ad7d9 100644
|
||||
index 8737a71..6bf3224 100644
|
||||
--- content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -695,6 +695,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
|
||||
@@ -685,6 +685,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -473,7 +473,7 @@ index b843416..8b81a51 100644
|
||||
}
|
||||
case Widget::InitParams::TYPE_CONTROL:
|
||||
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
|
||||
index 921b838..954d426 100644
|
||||
index 3d77ea4..aaefc0a 100644
|
||||
--- ui/views/win/hwnd_message_handler.cc
|
||||
+++ ui/views/win/hwnd_message_handler.cc
|
||||
@@ -852,6 +852,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
|
||||
index ab5b0e7..c977d57 100644
|
||||
index 3d0bf95..e58379a 100644
|
||||
--- Source/web/ChromeClientImpl.cpp
|
||||
+++ Source/web/ChromeClientImpl.cpp
|
||||
@@ -880,7 +880,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
|
||||
@@ -883,7 +883,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
|
||||
PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select)
|
||||
{
|
||||
notifyPopupOpeningObservers();
|
||||
@@ -12,7 +12,7 @@ index ab5b0e7..c977d57 100644
|
||||
|
||||
DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
|
||||
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
|
||||
index 218f70f..24824fd 100644
|
||||
index 8f60abf..910ba9a 100644
|
||||
--- Source/web/WebViewImpl.cpp
|
||||
+++ Source/web/WebViewImpl.cpp
|
||||
@@ -415,6 +415,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
|
||||
|
@@ -246,7 +246,7 @@ if(OS_WINDOWS)
|
||||
endif()
|
||||
|
||||
# Add the custom manifest files to the executable.
|
||||
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}/resources/win" "${CEF_TARGET}")
|
||||
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}/resources/win" "${CEF_TARGET}" "exe")
|
||||
|
||||
# Copy CEF binary and resource files to the target output directory.
|
||||
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
|
||||
|
@@ -60,10 +60,12 @@ void BrowserWindowStdMac::ShowPopup(ClientWindowHandle parent_handle,
|
||||
|
||||
void BrowserWindowStdMac::Show() {
|
||||
REQUIRE_MAIN_THREAD();
|
||||
// Nothing to do here. Chromium internally handles window show/hide.
|
||||
}
|
||||
|
||||
void BrowserWindowStdMac::Hide() {
|
||||
REQUIRE_MAIN_THREAD();
|
||||
// Nothing to do here. Chromium internally handles window show/hide.
|
||||
}
|
||||
|
||||
void BrowserWindowStdMac::SetBounds(int x, int y, size_t width, size_t height) {
|
||||
@@ -73,9 +75,7 @@ void BrowserWindowStdMac::SetBounds(int x, int y, size_t width, size_t height) {
|
||||
|
||||
void BrowserWindowStdMac::SetFocus(bool focus) {
|
||||
REQUIRE_MAIN_THREAD();
|
||||
|
||||
if (browser_)
|
||||
browser_->GetHost()->SetFocus(focus);
|
||||
// Nothing to do here. Chromium internally handles window focus assignment.
|
||||
}
|
||||
|
||||
ClientWindowHandle BrowserWindowStdMac::GetWindowHandle() const {
|
||||
|
@@ -356,9 +356,12 @@ bool ClientHandler::OnDragEnter(CefRefPtr<CefBrowser> browser,
|
||||
CefDragHandler::DragOperationsMask mask) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
// Forbid dragging of link URLs.
|
||||
if (mask & DRAG_OPERATION_LINK)
|
||||
// Forbid dragging of URLs and files.
|
||||
if ((mask & DRAG_OPERATION_LINK) && !dragData->IsFragment()) {
|
||||
test_runner::Alert(
|
||||
browser, "cefclient blocks dragging of URLs and files");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -687,14 +690,33 @@ int ClientHandler::GetBrowserCount() const {
|
||||
|
||||
void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser,
|
||||
const CefPoint& inspect_element_at) {
|
||||
if (!CefCurrentlyOn(TID_UI)) {
|
||||
// Execute this method on the UI thread.
|
||||
CefPostTask(TID_UI, base::Bind(&ClientHandler::ShowDevTools, this, browser,
|
||||
inspect_element_at));
|
||||
return;
|
||||
}
|
||||
|
||||
CefWindowInfo windowInfo;
|
||||
CefRefPtr<CefClient> client;
|
||||
CefBrowserSettings settings;
|
||||
|
||||
if (CreatePopupWindow(browser, true, CefPopupFeatures(), windowInfo, client,
|
||||
settings)) {
|
||||
browser->GetHost()->ShowDevTools(windowInfo, client, settings,
|
||||
inspect_element_at);
|
||||
CefRefPtr<CefBrowserHost> host = browser->GetHost();
|
||||
|
||||
// Test if the DevTools browser already exists.
|
||||
bool has_devtools = host->HasDevTools();
|
||||
if (!has_devtools) {
|
||||
// Create a new RootWindow for the DevTools browser that will be created
|
||||
// by ShowDevTools().
|
||||
has_devtools = CreatePopupWindow(browser, true, CefPopupFeatures(),
|
||||
windowInfo, client, settings);
|
||||
}
|
||||
|
||||
if (has_devtools) {
|
||||
// Create the DevTools browser if it doesn't already exist.
|
||||
// Otherwise, focus the existing DevTools browser and inspect the element
|
||||
// at |inspect_element_at| if non-empty.
|
||||
host->ShowDevTools(windowInfo, client, settings, inspect_element_at);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -150,6 +150,12 @@ void RootWindowGtk::Show(ShowMode mode) {
|
||||
MinimizeWindow(GTK_WINDOW(window_));
|
||||
else if (mode == ShowMaximized)
|
||||
MaximizeWindow(GTK_WINDOW(window_));
|
||||
|
||||
// Flush the display to make sure the underlying X11 window gets created
|
||||
// immediately.
|
||||
GdkWindow* gdk_window = gtk_widget_get_window(window_);
|
||||
GdkDisplay* display = gdk_window_get_display(gdk_window);
|
||||
gdk_display_flush(display);
|
||||
}
|
||||
|
||||
void RootWindowGtk::Hide() {
|
||||
|
@@ -468,7 +468,8 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) {
|
||||
styleMask:(NSTitledWindowMask |
|
||||
NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask |
|
||||
NSResizableWindowMask )
|
||||
NSResizableWindowMask |
|
||||
NSUnifiedTitleAndToolbarWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
[window_ setTitle:@"cefclient"];
|
||||
@@ -494,6 +495,13 @@ void RootWindowMac::CreateRootWindow(const CefBrowserSettings& settings) {
|
||||
NSView* contentView = [window_ contentView];
|
||||
NSRect contentBounds = [contentView bounds];
|
||||
|
||||
if (!with_osr_) {
|
||||
// Make the content view for the window have a layer. This will make all
|
||||
// sub-views have layers. This is necessary to ensure correct layer
|
||||
// ordering of all child views and their layers.
|
||||
[contentView setWantsLayer:YES];
|
||||
}
|
||||
|
||||
if (with_controls_) {
|
||||
// Create the buttons.
|
||||
NSRect button_rect = contentBounds;
|
||||
|
@@ -157,7 +157,7 @@ if(OS_WINDOWS)
|
||||
endif()
|
||||
|
||||
# Add the custom manifest files to the executable.
|
||||
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_TARGET}")
|
||||
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_TARGET}" "exe")
|
||||
|
||||
# Copy binary and resource files to the target output directory.
|
||||
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
|
||||
|
@@ -355,7 +355,8 @@ class FrameNavRendererTest : public ClientAppRenderer::Delegate,
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
CreateExpectationsIfNecessary();
|
||||
EXPECT_TRUE(expectations_->OnLoadStart(browser, frame)) << "nav = " << nav_;
|
||||
}
|
||||
@@ -522,7 +523,8 @@ class FrameNavTestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
EXPECT_TRUE(expectations_->OnLoadStart(browser, frame)) << "nav = " << nav_;
|
||||
}
|
||||
|
||||
|
@@ -145,7 +145,8 @@ class HistoryNavRendererTest : public ClientAppRenderer::Delegate,
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
const NavListItem& item = kHNavList[nav_];
|
||||
|
||||
got_load_start_.yes();
|
||||
@@ -153,6 +154,8 @@ class HistoryNavRendererTest : public ClientAppRenderer::Delegate,
|
||||
const std::string& url = frame->GetURL();
|
||||
EXPECT_STREQ(item.target, url.c_str());
|
||||
|
||||
EXPECT_EQ(TT_EXPLICIT, transition_type);
|
||||
|
||||
EXPECT_EQ(item.can_go_back, browser->CanGoBack());
|
||||
EXPECT_EQ(item.can_go_forward, browser->CanGoForward());
|
||||
}
|
||||
@@ -487,7 +490,8 @@ class HistoryNavTestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
if(browser->IsPopup() || !frame->IsMain())
|
||||
return;
|
||||
|
||||
@@ -495,6 +499,11 @@ class HistoryNavTestHandler : public TestHandler {
|
||||
|
||||
got_load_start_[nav_].yes();
|
||||
|
||||
if (item.action == NA_LOAD)
|
||||
EXPECT_EQ(TT_EXPLICIT, transition_type);
|
||||
else if (item.action == NA_BACK || item.action == NA_FORWARD)
|
||||
EXPECT_EQ(TT_EXPLICIT | TT_FORWARD_BACK_FLAG, transition_type);
|
||||
|
||||
std::string url1 = browser->GetMainFrame()->GetURL();
|
||||
std::string url2 = frame->GetURL();
|
||||
if (url1 == item.target && url2 == item.target)
|
||||
@@ -713,7 +722,12 @@ class RedirectSchemeHandler : public CefResourceHandler {
|
||||
|
||||
class RedirectSchemeHandlerFactory : public CefSchemeHandlerFactory {
|
||||
public:
|
||||
RedirectSchemeHandlerFactory() {}
|
||||
RedirectSchemeHandlerFactory() {
|
||||
g_got_nav1_request = false;
|
||||
g_got_nav3_request = false;
|
||||
g_got_nav4_request = false;
|
||||
g_got_invalid_request = false;
|
||||
}
|
||||
|
||||
CefRefPtr<CefResourceHandler> Create(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
@@ -788,10 +802,13 @@ class RedirectTestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
// Should only be called for the final loaded URL.
|
||||
std::string url = frame->GetURL();
|
||||
|
||||
EXPECT_EQ(TT_EXPLICIT, transition_type);
|
||||
|
||||
if (url == kRNav4) {
|
||||
got_nav4_load_start_.yes();
|
||||
} else {
|
||||
@@ -829,6 +846,41 @@ class RedirectTestHandler : public TestHandler {
|
||||
IMPLEMENT_REFCOUNTING(RedirectTestHandler);
|
||||
};
|
||||
|
||||
// Like above but destroy the WebContents while the redirect is in-progress.
|
||||
class RedirectDestroyTestHandler : public TestHandler {
|
||||
public:
|
||||
RedirectDestroyTestHandler() {}
|
||||
|
||||
void RunTest() override {
|
||||
// Create the browser.
|
||||
CreateBrowser(kRNav1);
|
||||
|
||||
// Time out the test after a reasonable period of time.
|
||||
SetTestTimeout();
|
||||
}
|
||||
|
||||
void OnResourceRedirect(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefString& new_url) override {
|
||||
const std::string& old_url = request->GetURL();
|
||||
if (old_url == kRNav1 && new_url == kRNav2) {
|
||||
// Called due to the nav1 redirect response.
|
||||
got_nav1_redirect_.yes();
|
||||
|
||||
new_url = "about:blank";
|
||||
|
||||
// Destroy the test (and the underlying WebContents) while the redirect
|
||||
// is still pending.
|
||||
DestroyTest();
|
||||
}
|
||||
}
|
||||
|
||||
TrackCallback got_nav1_redirect_;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(RedirectDestroyTestHandler);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
// Verify frame names and identifiers.
|
||||
@@ -864,6 +916,28 @@ TEST(NavigationTest, Redirect) {
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
||||
// Verify that destroying the WebContents while the redirect is in-progress does
|
||||
// not result in a crash.
|
||||
TEST(NavigationTest, RedirectDestroy) {
|
||||
CefRegisterSchemeHandlerFactory("http", "tests",
|
||||
new RedirectSchemeHandlerFactory());
|
||||
WaitForIOThread();
|
||||
|
||||
CefRefPtr<RedirectDestroyTestHandler> handler =
|
||||
new RedirectDestroyTestHandler();
|
||||
handler->ExecuteTest();
|
||||
|
||||
CefClearSchemeHandlerFactories();
|
||||
WaitForIOThread();
|
||||
|
||||
ASSERT_TRUE(handler->got_nav1_redirect_);
|
||||
ASSERT_TRUE(g_got_nav1_request);
|
||||
ASSERT_FALSE(g_got_nav3_request);
|
||||
ASSERT_FALSE(g_got_nav4_request);
|
||||
ASSERT_FALSE(g_got_invalid_request);
|
||||
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -1136,7 +1210,8 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
EXPECT_TRUE(got_render_thread_created_);
|
||||
EXPECT_TRUE(got_webkit_initialized_);
|
||||
|
||||
@@ -1347,10 +1422,13 @@ class OrderNavTestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
if (browser->IsPopup()) {
|
||||
EXPECT_EQ(TT_LINK, transition_type);
|
||||
state_popup_.OnLoadStart(browser, frame);
|
||||
} else {
|
||||
EXPECT_EQ(TT_EXPLICIT, transition_type);
|
||||
state_main_.OnLoadStart(browser, frame);
|
||||
}
|
||||
}
|
||||
@@ -1790,10 +1868,16 @@ class LoadNavTestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
EXPECT_GT(browser_id_current_, 0);
|
||||
EXPECT_EQ(browser_id_current_, browser->GetIdentifier());
|
||||
|
||||
if (mode_ == LOAD || frame->GetURL() == kLoadNav1)
|
||||
EXPECT_EQ(TT_EXPLICIT, transition_type);
|
||||
else
|
||||
EXPECT_EQ(TT_LINK, transition_type);
|
||||
|
||||
got_load_start_.yes();
|
||||
}
|
||||
|
||||
@@ -2071,7 +2155,8 @@ class PopupNavTestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
const std::string& url = frame->GetURL();
|
||||
if (url == kPopupNavPageUrl) {
|
||||
EXPECT_FALSE(got_load_start_);
|
||||
@@ -2498,7 +2583,8 @@ class BrowseNavTestHandler : public TestHandler {
|
||||
}
|
||||
|
||||
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame) override {
|
||||
CefRefPtr<CefFrame> frame,
|
||||
TransitionType transition_type) override {
|
||||
const std::string& url = frame->GetURL();
|
||||
EXPECT_STREQ(kBrowseNavPageUrl, url.c_str());
|
||||
EXPECT_EQ(GetBrowserId(), browser->GetIdentifier());
|
||||
|
@@ -1,7 +1,7 @@
|
||||
CONTENTS
|
||||
--------
|
||||
|
||||
Release Contains a release build of the cefclient sample application.
|
||||
Release Contains a release build of the sample application.
|
||||
|
||||
|
||||
USAGE
|
||||
|
@@ -62,8 +62,3 @@ run but any related functionality may become broken or disabled.
|
||||
* libGLESv2.dll
|
||||
Without these files HTML5 accelerated content like 2D canvas, 3D CSS and WebGL
|
||||
will not function.
|
||||
|
||||
* Windows Vista 64-bit sandbox support (32-bit distributions only)
|
||||
* wow_helper.exe
|
||||
Without this file the 32-bit build of CEF will not run on 64-bit Vista
|
||||
machines with the sandbox enabled.
|
||||
|
@@ -133,7 +133,11 @@ def create_readme():
|
||||
'the LICENSING section of this document for licensing terms and conditions.'
|
||||
elif mode == 'client':
|
||||
distrib_type = 'Client'
|
||||
distrib_desc = 'This distribution contains a release build of the cefclient sample application\n' \
|
||||
if platform == 'linux':
|
||||
client_app = 'cefsimple'
|
||||
else:
|
||||
client_app = 'cefclient'
|
||||
distrib_desc = 'This distribution contains a release build of the ' + client_app + ' sample application\n' \
|
||||
'for the ' + platform_str + ' platform. Please see the LICENSING section of this document for\n' \
|
||||
'licensing terms and conditions.'
|
||||
|
||||
@@ -263,7 +267,7 @@ parser.add_option('--minimal',
|
||||
help='include only release build binary files')
|
||||
parser.add_option('--client',
|
||||
action='store_true', dest='client', default=False,
|
||||
help='include only the cefclient application')
|
||||
help='include only the sample application')
|
||||
parser.add_option('-q', '--quiet',
|
||||
action='store_true', dest='quiet', default=False,
|
||||
help='do not output detailed status information')
|
||||
@@ -486,8 +490,6 @@ if platform == 'windows':
|
||||
'snapshot_blob.bin',
|
||||
'widevinecdmadapter.dll',
|
||||
]
|
||||
if not options.x64build:
|
||||
binaries.append('wow_helper.exe')
|
||||
|
||||
out_dir = os.path.join(src_dir, 'out')
|
||||
libcef_dll_file = 'libcef.dll.lib'
|
||||
@@ -704,7 +706,7 @@ elif platform == 'linux':
|
||||
lib_dst_dir = os.path.join(dst_dir, lib_dir_name)
|
||||
make_dir(lib_dst_dir, options.quiet)
|
||||
copy_file(libcef_path, lib_dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cefclient'), dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'cefsimple'), dst_dir, options.quiet)
|
||||
else:
|
||||
copy_file(libcef_path, dst_dir, options.quiet)
|
||||
copy_file(os.path.join(build_dir, 'chrome_sandbox'), os.path.join(dst_dir, 'chrome-sandbox'), options.quiet)
|
||||
@@ -718,7 +720,6 @@ elif platform == 'linux':
|
||||
build_dir = valid_build_dir
|
||||
if mode == 'client':
|
||||
dst_dir = os.path.join(output_dir, 'Release')
|
||||
copy_dir(os.path.join(build_dir, 'files'), os.path.join(dst_dir, 'files'), options.quiet)
|
||||
else:
|
||||
dst_dir = os.path.join(output_dir, 'Resources')
|
||||
make_dir(dst_dir, options.quiet)
|
||||
|
@@ -22,6 +22,7 @@ if "%ARGSOK%" == "F" (
|
||||
:: In case vcvars is already provided via the environment.
|
||||
set vcvars="%CEF_VCVARS%"
|
||||
if exist %vcvars% goto found_vcvars
|
||||
if %vcvars% == "none" goto found_vcvars
|
||||
|
||||
if "%1" == "win64" goto check_win64
|
||||
|
||||
@@ -47,7 +48,7 @@ goto end
|
||||
:found_vcvars
|
||||
echo vcvars:
|
||||
echo %vcvars%
|
||||
call %vcvars%
|
||||
if not %vcvars% == "none" call %vcvars%
|
||||
|
||||
echo PATH:
|
||||
echo %PATH%
|
||||
|
Reference in New Issue
Block a user