Update to Chromium revision 318e6f54 (#400326)

This commit is contained in:
Marshall Greenblatt 2016-06-20 18:59:23 -04:00
parent 66425def4a
commit 05ee60b7b4
78 changed files with 679 additions and 442 deletions

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': '2b3ae3b8090361f8af5a611712fc1a5ab2de53cb', 'chromium_checkout': '318e6f543c58eeeac93b122030041139da7e1e6a',
} }

View File

@ -972,6 +972,7 @@
'<(DEPTH)/components/components.gyp:keyed_service_content', '<(DEPTH)/components/components.gyp:keyed_service_content',
'<(DEPTH)/components/components.gyp:keyed_service_core', '<(DEPTH)/components/components.gyp:keyed_service_core',
'<(DEPTH)/components/components.gyp:navigation_interception', '<(DEPTH)/components/components.gyp:navigation_interception',
'<(DEPTH)/components/components.gyp:network_session_configurator_switches',
'<(DEPTH)/components/components.gyp:pdf_browser', '<(DEPTH)/components/components.gyp:pdf_browser',
'<(DEPTH)/components/components.gyp:pdf_renderer', '<(DEPTH)/components/components.gyp:pdf_renderer',
'<(DEPTH)/components/components.gyp:plugins_renderer', '<(DEPTH)/components/components.gyp:plugins_renderer',
@ -1018,7 +1019,7 @@
'<(DEPTH)/skia/skia.gyp:skia', '<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/storage/storage_browser.gyp:storage', '<(DEPTH)/storage/storage_browser.gyp:storage',
'<(DEPTH)/sync/sync.gyp:sync', '<(DEPTH)/sync/sync.gyp:sync',
'<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_platform_impl', '<(DEPTH)/third_party/cld_2/cld_2.gyp:cld_2',
'<(DEPTH)/third_party/hunspell/hunspell.gyp:hunspell', '<(DEPTH)/third_party/hunspell/hunspell.gyp:hunspell',
'<(DEPTH)/third_party/libxml/libxml.gyp:libxml', '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',

View File

@ -29,9 +29,9 @@
#include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/guest_view/browser/guest_view_manager.h" #include "components/guest_view/browser/guest_view_manager.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/ui/zoom/zoom_event_manager.h"
#include "components/visitedlink/browser/visitedlink_event_listener.h" #include "components/visitedlink/browser/visitedlink_event_listener.h"
#include "components/visitedlink/browser/visitedlink_master.h" #include "components/visitedlink/browser/visitedlink_master.h"
#include "components/zoom/zoom_event_manager.h"
#include "content/public/browser/download_manager.h" #include "content/public/browser/download_manager.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h" #include "content/public/browser/storage_partition.h"
@ -343,7 +343,7 @@ std::unique_ptr<content::ZoomLevelDelegate>
return base::WrapUnique(new ChromeZoomLevelPrefs( return base::WrapUnique(new ChromeZoomLevelPrefs(
GetPrefs(), cache_path_, partition_path, GetPrefs(), cache_path_, partition_path,
ui_zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr()));
} }
bool CefBrowserContextImpl::IsOffTheRecord() const { bool CefBrowserContextImpl::IsOffTheRecord() const {

View File

@ -695,7 +695,8 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) {
return; return;
std::unique_ptr<content::DownloadUrlParameters> params( std::unique_ptr<content::DownloadUrlParameters> params(
content::DownloadUrlParameters::FromWebContents(web_contents(), gurl)); content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents(), gurl));
manager->DownloadUrl(std::move(params)); manager->DownloadUrl(std::move(params));
} }
@ -2243,10 +2244,10 @@ content::JavaScriptDialogManager*
} }
void CefBrowserHostImpl::RunFileChooser( void CefBrowserHostImpl::RunFileChooser(
content::WebContents* web_contents, content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) { const content::FileChooserParams& params) {
EnsureFileDialogManager(); EnsureFileDialogManager();
file_dialog_manager_->RunFileChooser(web_contents, params); file_dialog_manager_->RunFileChooser(render_frame_host, params);
} }
bool CefBrowserHostImpl::HandleContextMenu( bool CefBrowserHostImpl::HandleContextMenu(

View File

@ -404,7 +404,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::JavaScriptDialogManager* GetJavaScriptDialogManager(
content::WebContents* source) override; content::WebContents* source) override;
void RunFileChooser( void RunFileChooser(
content::WebContents* web_contents, content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) override; const content::FileChooserParams& params) override;
bool EmbedsFullscreenWidget() const override; bool EmbedsFullscreenWidget() const override;
void EnterFullscreenModeForTab(content::WebContents* web_contents, void EnterFullscreenModeForTab(content::WebContents* web_contents,

View File

@ -69,7 +69,6 @@ void CefBrowserMainParts::PreMainMessageLoopStart() {
if (!base::MessageLoop::current()) { if (!base::MessageLoop::current()) {
// Create the browser message loop. // Create the browser message loop.
message_loop_.reset(new CefBrowserMessageLoop()); message_loop_.reset(new CefBrowserMessageLoop());
message_loop_->set_thread_name("CrBrowserMain");
} }
} }

View File

@ -28,6 +28,7 @@
#include "chrome/browser/component_updater/widevine_cdm_component_installer.h" #include "chrome/browser/component_updater/widevine_cdm_component_installer.h"
#include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/printing/print_job_manager.h"
#include "components/component_updater/component_updater_service.h" #include "components/component_updater/component_updater_service.h"
#include "components/network_session_configurator/switches.h"
#include "components/update_client/configurator.h" #include "components/update_client/configurator.h"
#include "content/public/app/content_main.h" #include "content/public/app/content_main.h"
#include "content/public/app/content_main_runner.h" #include "content/public/app/content_main_runner.h"
@ -326,7 +327,9 @@ void CefContext::Shutdown() {
if (settings_.multi_threaded_message_loop) { if (settings_.multi_threaded_message_loop) {
// Events that will be used to signal when shutdown is complete. Start in // Events that will be used to signal when shutdown is complete. Start in
// non-signaled mode so that the event will block. // non-signaled mode so that the event will block.
base::WaitableEvent uithread_shutdown_event(false, false); base::WaitableEvent uithread_shutdown_event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
// Finish shutdown on the UI thread. // Finish shutdown on the UI thread.
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,

View File

@ -12,6 +12,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
#include "base/json/string_escape.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
@ -158,7 +159,7 @@ void CefDevToolsFrontend::Close() {
void CefDevToolsFrontend::DisconnectFromTarget() { void CefDevToolsFrontend::DisconnectFromTarget() {
if (!agent_host_) if (!agent_host_)
return; return;
agent_host_->DetachClient(); agent_host_->DetachClient(this);
agent_host_ = NULL; agent_host_ = NULL;
} }
@ -206,7 +207,7 @@ void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
void CefDevToolsFrontend::WebContentsDestroyed() { void CefDevToolsFrontend::WebContentsDestroyed() {
if (agent_host_) if (agent_host_)
agent_host_->DetachClient(); agent_host_->DetachClient(this);
delete this; delete this;
} }
@ -228,11 +229,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
dict->GetList("params", &params); dict->GetList("params", &params);
if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) { if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) {
if (!agent_host_ || !agent_host_->IsAttached())
return;
std::string protocol_message; std::string protocol_message;
if (!params->GetString(0, &protocol_message)) if (!params->GetString(0, &protocol_message))
return; return;
if (agent_host_) agent_host_->DispatchProtocolMessage(this, protocol_message);
agent_host_->DispatchProtocolMessage(protocol_message);
} else if (method == "loadCompleted") { } else if (method == "loadCompleted") {
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);")); base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"));
@ -298,18 +300,21 @@ void CefDevToolsFrontend::DispatchProtocolMessage(
content::DevToolsAgentHost* agent_host, content::DevToolsAgentHost* agent_host,
const std::string& message) { const std::string& message) {
if (message.length() < kMaxMessageChunkSize) { if (message.length() < kMaxMessageChunkSize) {
base::string16 javascript = base::UTF8ToUTF16( std::string param;
"DevToolsAPI.dispatchMessage(" + message + ");"); base::EscapeJSONString(message, true, &param);
std::string code = "DevToolsAPI.dispatchMessage(" + param + ");";
base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript); web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript);
return; return;
} }
base::FundamentalValue total_size(static_cast<int>(message.length())); size_t total_size = message.length();
for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) { for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
std::string param; std::string param;
base::JSONWriter::Write( base::EscapeJSONString(message.substr(pos, kMaxMessageChunkSize), true,
base::StringValue(message.substr(pos, kMaxMessageChunkSize)), &param); &param);
std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + ");"; std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," +
std::to_string(pos ? 0 : total_size) + ");";
base::string16 javascript = base::UTF8ToUTF16(code); base::string16 javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript); web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(javascript);
} }

View File

@ -122,17 +122,19 @@ void CefExtensionSystem::Init() {
// 5. A MimeHandlerViewGuest and CefMimeHandlerViewGuestDelegate is created in // 5. A MimeHandlerViewGuest and CefMimeHandlerViewGuestDelegate is created in
// the browser process. // the browser process.
// 6. MimeHandlerViewGuest navigates to the PDF extension URL. // 6. MimeHandlerViewGuest navigates to the PDF extension URL.
// 7. PDF extension resources are provided from bundle via // 7. Access to PDF extension resources is checked by
// CefExtensionsBrowserClient::AllowCrossRendererResourceLoad.
// 8. PDF extension resources are provided from bundle via
// CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob and // CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob and
// CefComponentExtensionResourceManager. // CefComponentExtensionResourceManager.
// 8. The PDF extension communicates via the chrome.mimeHandlerPrivate Mojo // 9. The PDF extension communicates via the chrome.mimeHandlerPrivate Mojo
// API which is implemented as described in // API which is implemented as described in
// libcef/common/extensions/api/README.txt. // libcef/common/extensions/api/README.txt.
// 9. The PDF extension requests a plugin to handle // 10.The PDF extension requests a plugin to handle
// kPDFPluginOutOfProcessMimeType which loads the PDF PPAPI plugin. // kPDFPluginOutOfProcessMimeType which loads the PDF PPAPI plugin.
// 10.Routing of print-related commands are handled by ChromePDFPrintClient // 11.Routing of print-related commands are handled by ChromePDFPrintClient
// and CefPrintWebViewHelperDelegate in the renderer process. // and CefPrintWebViewHelperDelegate in the renderer process.
// 11.The PDF extension is granted access to chrome://resources via // 12.The PDF extension is granted access to chrome://resources via
// CefExtensionWebContentsObserver::RenderViewCreated in the browser // CefExtensionWebContentsObserver::RenderViewCreated in the browser
// process. // process.
if (PdfExtensionEnabled()) { if (PdfExtensionEnabled()) {

View File

@ -27,6 +27,7 @@
#include "extensions/browser/extension_host_delegate.h" #include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/mojo/service_registration.h" #include "extensions/browser/mojo/service_registration.h"
#include "extensions/browser/url_request_util.h" #include "extensions/browser/url_request_util.h"
#include "extensions/common/constants.h"
using content::BrowserContext; using content::BrowserContext;
using content::BrowserThread; using content::BrowserThread;
@ -114,6 +115,13 @@ bool CefExtensionsBrowserClient::AllowCrossRendererResourceLoad(
bool is_incognito, bool is_incognito,
const Extension* extension, const Extension* extension,
InfoMap* extension_info_map) { InfoMap* extension_info_map) {
// TODO(cef): This bypasses additional checks added to
// AllowCrossRendererResourceLoad() in https://crrev.com/5cf9d45c. Figure out
// why permission is not being granted based on "web_accessible_resources"
// specified in the PDF extension manifest.json file.
if (extension->id() == extension_misc::kPdfExtensionId)
return true;
bool allowed = false; bool allowed = false;
if (url_request_util::AllowCrossRendererResourceLoad( if (url_request_util::AllowCrossRendererResourceLoad(
request, is_incognito, extension, extension_info_map, &allowed)) { request, is_incognito, extension, extension_info_map, &allowed)) {

View File

@ -12,7 +12,7 @@
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "base/threading/worker_pool.h" #include "base/threading/worker_pool.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/common/file_chooser_file_info.h" #include "content/public/common/file_chooser_file_info.h"
#include "net/base/directory_lister.h" #include "net/base/directory_lister.h"
@ -158,6 +158,7 @@ CefFileDialogManager::CefFileDialogManager(
browser_(browser), browser_(browser),
runner_(std::move(runner)), runner_(std::move(runner)),
file_chooser_pending_(false), file_chooser_pending_(false),
render_frame_host_(nullptr),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
DCHECK(web_contents()); DCHECK(web_contents());
} }
@ -217,40 +218,41 @@ void CefFileDialogManager::RunFileDialog(
} }
void CefFileDialogManager::RunFileChooser( void CefFileDialogManager::RunFileChooser(
content::WebContents* web_contents, content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) { const content::FileChooserParams& params) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
DCHECK_EQ(web_contents, this->web_contents()); DCHECK(render_frame_host);
content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost();
if (!render_view_host)
return;
CefFileDialogRunner::FileChooserParams cef_params; CefFileDialogRunner::FileChooserParams cef_params;
static_cast<content::FileChooserParams&>(cef_params) = params; static_cast<content::FileChooserParams&>(cef_params) = params;
if (lister_) { CefFileDialogRunner::RunFileChooserCallback callback;
// Cancel the previous upload folder run.
lister_->Cancel();
lister_.reset();
}
if (params.mode == content::FileChooserParams::UploadFolder) { if (params.mode == content::FileChooserParams::UploadFolder) {
RunFileChooser(cef_params, callback = base::Bind(
base::Bind( &CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback,
&CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback, weak_ptr_factory_.GetWeakPtr(), params.mode);
weak_ptr_factory_.GetWeakPtr(), params.mode)); } else {
return; callback = base::Bind(
&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode);
} }
RunFileChooser(cef_params, RunFileChooserInternal(render_frame_host, cef_params, callback);
base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback,
weak_ptr_factory_.GetWeakPtr(), params.mode));
} }
void CefFileDialogManager::RunFileChooser( void CefFileDialogManager::RunFileChooser(
const CefFileDialogRunner::FileChooserParams& params, const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback) { const CefFileDialogRunner::RunFileChooserCallback& callback) {
const CefFileDialogRunner::RunFileChooserCallback& host_callback =
base::Bind(&CefFileDialogManager::OnRunFileChooserCallback,
weak_ptr_factory_.GetWeakPtr(), callback);
RunFileChooserInternal(nullptr, params, host_callback);
}
void CefFileDialogManager::RunFileChooserInternal(
content::RenderFrameHost* render_frame_host,
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
if (file_chooser_pending_) { if (file_chooser_pending_) {
@ -260,11 +262,7 @@ void CefFileDialogManager::RunFileChooser(
} }
file_chooser_pending_ = true; file_chooser_pending_ = true;
render_frame_host_ = render_frame_host;
// Ensure that the |file_chooser_pending_| flag is cleared.
const CefFileDialogRunner::RunFileChooserCallback& host_callback =
base::Bind(&CefFileDialogManager::OnRunFileChooserCallback,
weak_ptr_factory_.GetWeakPtr(), callback);
bool handled = false; bool handled = false;
@ -304,7 +302,7 @@ void CefFileDialogManager::RunFileChooser(
accept_filters.push_back(*it); accept_filters.push_back(*it);
CefRefPtr<CefFileDialogCallbackImpl> callbackImpl( CefRefPtr<CefFileDialogCallbackImpl> callbackImpl(
new CefFileDialogCallbackImpl(host_callback)); new CefFileDialogCallbackImpl(callback));
handled = handler->OnFileDialog( handled = handler->OnFileDialog(
browser_, browser_,
static_cast<cef_file_dialog_mode_t>(mode), static_cast<cef_file_dialog_mode_t>(mode),
@ -327,10 +325,10 @@ void CefFileDialogManager::RunFileChooser(
if (!handled) { if (!handled) {
if (runner_.get()) { if (runner_.get()) {
runner_->Run(browser_, params, host_callback); runner_->Run(browser_, params, callback);
} else { } else {
LOG(WARNING) << "No file dialog runner available for this platform"; LOG(WARNING) << "No file dialog runner available for this platform";
host_callback.Run(0, std::vector<base::FilePath>()); callback.Run(0, std::vector<base::FilePath>());
} }
} }
} }
@ -341,7 +339,7 @@ void CefFileDialogManager::OnRunFileChooserCallback(
const std::vector<base::FilePath>& file_paths) { const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
file_chooser_pending_ = false; Cleanup();
// Execute the callback asynchronously. // Execute the callback asynchronously.
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
@ -375,17 +373,6 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback(
const std::vector<base::FilePath>& file_paths) { const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
if (lister_.get())
lister_.reset();
if (!web_contents())
return;
content::RenderViewHost* render_view_host =
web_contents()->GetRenderViewHost();
if (!render_view_host)
return;
// Convert FilePath list to SelectedFileInfo list. // Convert FilePath list to SelectedFileInfo list.
std::vector<content::FileChooserFileInfo> selected_files; std::vector<content::FileChooserFileInfo> selected_files;
for (size_t i = 0; i < file_paths.size(); ++i) { for (size_t i = 0; i < file_paths.size(); ++i) {
@ -395,5 +382,22 @@ void CefFileDialogManager::OnRunFileChooserDelegateCallback(
} }
// Notify our RenderViewHost in all cases. // Notify our RenderViewHost in all cases.
render_view_host->FilesSelectedInChooser(selected_files, mode); if (render_frame_host_)
render_frame_host_->FilesSelectedInChooser(selected_files, mode);
Cleanup();
}
void CefFileDialogManager::Cleanup() {
if (lister_)
lister_.reset();
render_frame_host_ = nullptr;
file_chooser_pending_ = false;
}
void CefFileDialogManager::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
if (render_frame_host == render_frame_host_)
render_frame_host_ = nullptr;
} }

View File

@ -48,8 +48,8 @@ class CefFileDialogManager : public content::WebContentsObserver {
// Called from CefBrowserHostImpl::RunFileChooser. // Called from CefBrowserHostImpl::RunFileChooser.
// See WebContentsDelegate::RunFileChooser documentation. // See WebContentsDelegate::RunFileChooser documentation.
void RunFileChooser( void RunFileChooser(
content::WebContents* web_contents, content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params); const content::FileChooserParams& params);
// Run the file chooser dialog specified by |params|. Only a single dialog may // Run the file chooser dialog specified by |params|. Only a single dialog may
// be pending at any given time. |callback| will be executed asynchronously // be pending at any given time. |callback| will be executed asynchronously
@ -59,7 +59,13 @@ class CefFileDialogManager : public content::WebContentsObserver {
const CefFileDialogRunner::RunFileChooserCallback& callback); const CefFileDialogRunner::RunFileChooserCallback& callback);
private: private:
// Used with RunFileChooser to clear the |file_chooser_pending_| flag. void RunFileChooserInternal(
content::RenderFrameHost* render_frame_host,
const CefFileDialogRunner::FileChooserParams& params,
const CefFileDialogRunner::RunFileChooserCallback& callback);
// Used with the RunFileChooser variant where the caller specifies a callback
// (no associated RenderFrameHost).
void OnRunFileChooserCallback( void OnRunFileChooserCallback(
const CefFileDialogRunner::RunFileChooserCallback& callback, const CefFileDialogRunner::RunFileChooserCallback& callback,
int selected_accept_filter, int selected_accept_filter,
@ -72,12 +78,20 @@ class CefFileDialogManager : public content::WebContentsObserver {
int selected_accept_filter, int selected_accept_filter,
const std::vector<base::FilePath>& file_paths); const std::vector<base::FilePath>& file_paths);
// Used with WebContentsDelegate::RunFileChooser to notify the WebContents. // Used with WebContentsDelegate::RunFileChooser to notify the
// RenderFrameHost.
void OnRunFileChooserDelegateCallback( void OnRunFileChooserDelegateCallback(
content::FileChooserParams::Mode mode, content::FileChooserParams::Mode mode,
int selected_accept_filter, int selected_accept_filter,
const std::vector<base::FilePath>& file_paths); const std::vector<base::FilePath>& file_paths);
// Clean up state associated with the last run.
void Cleanup();
// WebContentsObserver methods:
void RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) override;
// CefBrowserHostImpl pointer is guaranteed to outlive this object. // CefBrowserHostImpl pointer is guaranteed to outlive this object.
CefBrowserHostImpl* browser_; CefBrowserHostImpl* browser_;
@ -86,6 +100,9 @@ class CefFileDialogManager : public content::WebContentsObserver {
// True if a file chooser is currently pending. // True if a file chooser is currently pending.
bool file_chooser_pending_; bool file_chooser_pending_;
// RenderFrameHost associated with the pending file chooser. May be nullptr.
content::RenderFrameHost* render_frame_host_;
// Used for asynchronously listing directory contents. // Used for asynchronously listing directory contents.
std::unique_ptr<net::DirectoryLister> lister_; std::unique_ptr<net::DirectoryLister> lister_;

View File

@ -17,6 +17,7 @@
#include "libcef/browser/thread_util.h" #include "libcef/browser/thread_util.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h" #include "base/win/registry.h"
#include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/native_web_keyboard_event.h"

View File

@ -258,16 +258,15 @@ class NativeMenuWin::MenuHostWindow {
gfx::Image icon; gfx::Image icon;
if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) { if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) {
// We currently don't support items with both icons and checkboxes. // 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); DCHECK(type != ui::MenuModel::TYPE_CHECK);
gfx::Canvas canvas( gfx::Canvas canvas(skia_icon.size(), 1.0f, false);
skia_icon->GetRepresentation(1.0f), canvas.DrawImageInt(skia_icon, 0, 0);
false);
skia::DrawToNativeContext( skia::DrawToNativeContext(
canvas.sk_canvas(), dc, canvas.sk_canvas(), dc,
draw_item_struct->rcItem.left + kItemLeftMargin, draw_item_struct->rcItem.left + kItemLeftMargin,
draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - 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 && } else if (type == ui::MenuModel::TYPE_CHECK &&
data->native_menu_win->model_->IsItemCheckedAt( data->native_menu_win->model_->IsItemCheckedAt(
data->model_index)) { data->model_index)) {

View File

@ -287,15 +287,6 @@ void CefResourceRequestJob::GetLoadTimingInfo(
load_timing_info->receive_headers_end = receive_headers_end_; load_timing_info->receive_headers_end = receive_headers_end_;
} }
bool CefResourceRequestJob::GetResponseCookies(
std::vector<std::string>* cookies) {
CEF_REQUIRE_IOT();
cookies->clear();
FetchResponseCookies(cookies);
return true;
}
bool CefResourceRequestJob::IsRedirectResponse(GURL* location, bool CefResourceRequestJob::IsRedirectResponse(GURL* location,
int* http_status_code) { int* http_status_code) {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();

View File

@ -39,7 +39,6 @@ class CefResourceRequestJob : public net::URLRequestJob {
void GetResponseInfo(net::HttpResponseInfo* info) override; void GetResponseInfo(net::HttpResponseInfo* info) override;
void GetLoadTimingInfo( void GetLoadTimingInfo(
net::LoadTimingInfo* load_timing_info) const override; net::LoadTimingInfo* load_timing_info) const override;
bool GetResponseCookies(std::vector<std::string>* cookies) override;
bool IsRedirectResponse(GURL* location, int* http_status_code) bool IsRedirectResponse(GURL* location, int* http_status_code)
override; override;
bool GetMimeType(std::string* mime_type) const override; bool GetMimeType(std::string* mime_type) const override;

View File

@ -27,6 +27,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/net/proxy_service_factory.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h" #include "content/public/common/content_client.h"
@ -120,9 +121,18 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
std::swap(protocol_handlers_, *protocol_handlers); 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_.Init(prefs::kForceGoogleSafeSearch, pref_service);
force_google_safesearch_.MoveToThread( force_google_safesearch_.MoveToThread(io_thread_proxy);
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
#if defined(OS_POSIX) && !defined(OS_ANDROID) #if defined(OS_POSIX) && !defined(OS_ANDROID)
gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName); gsapi_library_name_ = pref_service->GetString(prefs::kGSSAPILibraryName);
@ -138,8 +148,24 @@ CefURLRequestContextGetterImpl::~CefURLRequestContextGetterImpl() {
storage_->set_proxy_service(NULL); 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() { void CefURLRequestContextGetterImpl::ShutdownOnUIThread() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
quick_check_enabled_.Destroy();
pac_https_url_stripping_enabled_.Destroy();
force_google_safesearch_.Destroy(); force_google_safesearch_.Destroy();
} }
@ -189,7 +215,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
url_request_context_->network_delegate(), url_request_context_->network_delegate(),
std::move(proxy_config_service_), std::move(proxy_config_service_),
*command_line, *command_line,
true); quick_check_enabled_.GetValue(),
pac_https_url_stripping_enabled_.GetValue());
storage_->set_proxy_service(std::move(system_proxy_service)); storage_->set_proxy_service(std::move(system_proxy_service));
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);

View File

@ -21,6 +21,7 @@
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "net/url_request/url_request_job_factory.h" #include "net/url_request/url_request_job_factory.h"
class PrefRegistrySimple;
class PrefService; class PrefService;
namespace base { namespace base {
@ -53,6 +54,9 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
content::URLRequestInterceptorScopedVector request_interceptors); content::URLRequestInterceptorScopedVector request_interceptors);
~CefURLRequestContextGetterImpl() override; ~CefURLRequestContextGetterImpl() override;
// Register preferences. Called from browser_prefs::CreatePrefService().
static void RegisterPrefs(PrefRegistrySimple* registry);
// Called when the BrowserContextImpl is destroyed. // Called when the BrowserContextImpl is destroyed.
void ShutdownOnUIThread(); void ShutdownOnUIThread();
@ -106,6 +110,9 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
std::vector<CefRefPtr<CefRequestContextHandler> > handler_list_; 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. // Member variables which are pointed to by the various context objects.
mutable BooleanPrefMember force_google_safesearch_; mutable BooleanPrefMember force_google_safesearch_;

View File

@ -217,16 +217,19 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter(
if (!rvh) if (!rvh)
return; return;
drag_data_ = drag_data;
CefDragDataImpl* data_impl = static_cast<CefDragDataImpl*>(drag_data.get()); CefDragDataImpl* data_impl = static_cast<CefDragDataImpl*>(drag_data.get());
base::AutoLock lock_scope(data_impl->lock()); base::AutoLock lock_scope(data_impl->lock());
const content::DropData& drop_data = data_impl->drop_data(); content::DropData* drop_data = data_impl->drop_data();
const gfx::Point client_pt(event.x, event.y); const gfx::Point client_pt(event.x, event.y);
const gfx::Point& screen_pt = GetScreenPoint(client_pt); const gfx::Point& screen_pt = GetScreenPoint(client_pt);
blink::WebDragOperationsMask ops = blink::WebDragOperationsMask ops =
static_cast<blink::WebDragOperationsMask>(allowed_ops); static_cast<blink::WebDragOperationsMask>(allowed_ops);
int modifiers = TranslateModifiers(event.modifiers); int modifiers = TranslateModifiers(event.modifiers);
rvh->DragTargetDragEnter(drop_data, client_pt, screen_pt, ops, modifiers); rvh->FilterDropData(drop_data);
rvh->DragTargetDragEnter(*drop_data, client_pt, screen_pt, ops, modifiers);
} }
void CefBrowserPlatformDelegateOsr::DragTargetDragOver( void CefBrowserPlatformDelegateOsr::DragTargetDragOver(
@ -258,11 +261,19 @@ void CefBrowserPlatformDelegateOsr::DragTargetDrop(const CefMouseEvent& event) {
if (!rvh) if (!rvh)
return; return;
const gfx::Point client_pt(event.x, event.y); {
const gfx::Point& screen_pt = GetScreenPoint(client_pt); CefDragDataImpl* data_impl =
int modifiers = TranslateModifiers(event.modifiers); static_cast<CefDragDataImpl*>(drag_data_.get());
base::AutoLock lock_scope(data_impl->lock());
content::DropData* drop_data = data_impl->drop_data();
const gfx::Point client_pt(event.x, event.y);
const gfx::Point& screen_pt = GetScreenPoint(client_pt);
int modifiers = TranslateModifiers(event.modifiers);
rvh->DragTargetDrop(client_pt, screen_pt, modifiers); rvh->DragTargetDrop(*drop_data, client_pt, screen_pt, modifiers);
}
drag_data_ = nullptr;
} }
void CefBrowserPlatformDelegateOsr::DragSourceEndedAt( void CefBrowserPlatformDelegateOsr::DragSourceEndedAt(

View File

@ -83,6 +83,9 @@ class CefBrowserPlatformDelegateOsr :
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate_; std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate_;
CefWebContentsViewOSR* view_osr_; // Not owned by this class. CefWebContentsViewOSR* view_osr_; // Not owned by this class.
// Pending drag/drop data.
CefRefPtr<CefDragData> drag_data_;
}; };
#endif // CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_ #endif // CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_

View File

@ -409,9 +409,11 @@ class CefBeginFrameTimer : public cc::DelayBasedTimeSourceClient {
CefBeginFrameTimer(int frame_rate_threshold_ms, CefBeginFrameTimer(int frame_rate_threshold_ms,
const base::Closure& callback) const base::Closure& callback)
: callback_(callback) { : callback_(callback) {
time_source_ = cc::DelayBasedTimeSource::Create( time_source_.reset(new cc::DelayBasedTimeSource(
base::TimeDelta::FromMilliseconds(frame_rate_threshold_ms), content::BrowserThread::GetMessageLoopProxyForThread(CEF_UIT).get()));
content::BrowserThread::GetMessageLoopProxyForThread(CEF_UIT).get()); time_source_->SetTimebaseAndInterval(
base::TimeTicks(),
base::TimeDelta::FromMilliseconds(frame_rate_threshold_ms));
time_source_->SetClient(this); time_source_->SetClient(this);
} }
@ -1006,6 +1008,11 @@ CefRenderWidgetHostViewOSR::CreateSoftwareOutputDevice(
return base::WrapUnique(software_output_device_); return base::WrapUnique(software_output_device_);
} }
int CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGpuMemoryBufferClientId()
const {
return render_widget_host_->GetProcess()->GetID();
}
ui::Layer* CefRenderWidgetHostViewOSR::DelegatedFrameHostGetLayer() const { ui::Layer* CefRenderWidgetHostViewOSR::DelegatedFrameHostGetLayer() const {
return root_layer_.get(); return root_layer_.get();
} }
@ -1020,8 +1027,7 @@ SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor(
// may not match the page's, so use black as the gutter color to avoid // may not match the page's, so use black as the gutter color to avoid
// flashes of brighter colors during the transition. // flashes of brighter colors during the transition.
if (render_widget_host_->delegate() && if (render_widget_host_->delegate() &&
render_widget_host_->delegate()->IsFullscreenForCurrentTab( render_widget_host_->delegate()->IsFullscreenForCurrentTab()) {
render_widget_host_)) {
return SK_ColorBLACK; return SK_ColorBLACK;
} }
return color; return color;

View File

@ -25,7 +25,6 @@
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "content/browser/renderer_host/browser_compositor_view_mac.h" #include "content/browser/renderer_host/browser_compositor_view_mac.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
@ -76,11 +75,12 @@ class CefWindowX11;
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h. // RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if defined(OS_MACOSX)
class AcceleratedWidgetMacNSViewHelper;
#endif
class CefRenderWidgetHostViewOSR class CefRenderWidgetHostViewOSR
: public content::RenderWidgetHostViewBase, : public content::RenderWidgetHostViewBase,
#if defined(OS_MACOSX)
public ui::AcceleratedWidgetMacNSView,
#endif
public ui::CompositorDelegate, public ui::CompositorDelegate,
public content::DelegatedFrameHostClient { public content::DelegatedFrameHostClient {
public: public:
@ -183,14 +183,6 @@ class CefRenderWidgetHostViewOSR
const std::vector<gfx::Rect>& character_bounds) override; const std::vector<gfx::Rect>& character_bounds) override;
#endif #endif
#if defined(OS_MACOSX)
// AcceleratedWidgetMacNSView implementation.
NSView* AcceleratedWidgetGetNSView() const override;
void AcceleratedWidgetGetVSyncParameters(
base::TimeTicks* timebase, base::TimeDelta* interval) const override;
void AcceleratedWidgetSwapCompleted() override;
#endif // defined(OS_MACOSX)
bool OnMessageReceived(const IPC::Message& msg) override; bool OnMessageReceived(const IPC::Message& msg) override;
// Message handlers. // Message handlers.
@ -201,6 +193,7 @@ class CefRenderWidgetHostViewOSR
ui::Compositor* compositor) override; ui::Compositor* compositor) override;
// DelegatedFrameHostClient implementation. // DelegatedFrameHostClient implementation.
virtual int DelegatedFrameHostGetGpuMemoryBufferClientId() const override;
ui::Layer* DelegatedFrameHostGetLayer() const override; ui::Layer* DelegatedFrameHostGetLayer() const override;
bool DelegatedFrameHostIsVisible() const override; bool DelegatedFrameHostIsVisible() const override;
SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override; SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override;
@ -295,6 +288,8 @@ class CefRenderWidgetHostViewOSR
void OnScrollOffsetChanged(); void OnScrollOffsetChanged();
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
friend class AcceleratedWidgetMacNSViewHelper;
// Returns composition character boundary rectangle. The |range| is // Returns composition character boundary rectangle. The |range| is
// composition based range. Also stores |actual_range| which is corresponding // composition based range. Also stores |actual_range| which is corresponding
// to actually used range for returned rectangle. // to actually used range for returned rectangle.
@ -339,6 +334,7 @@ class CefRenderWidgetHostViewOSR
NSWindow* window_; NSWindow* window_;
CALayer* background_layer_; CALayer* background_layer_;
std::unique_ptr<content::BrowserCompositorMac> browser_compositor_; std::unique_ptr<content::BrowserCompositorMac> browser_compositor_;
AcceleratedWidgetMacNSViewHelper* accelerated_widget_helper_;
#elif defined(USE_X11) #elif defined(USE_X11)
CefWindowX11* window_; CefWindowX11* window_;
std::unique_ptr<ui::XScopedCursor> invisible_cursor_; std::unique_ptr<ui::XScopedCursor> invisible_cursor_;

View File

@ -17,6 +17,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "content/common/view_messages.h" #include "content/common/view_messages.h"
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
#include "ui/events/latency_info.h" #include "ui/events/latency_info.h"
namespace { namespace {
@ -30,6 +31,35 @@ CefTextInputClientOSRMac* GetInputClientFromContext(
} // namespace } // namespace
class AcceleratedWidgetMacNSViewHelper : public ui::AcceleratedWidgetMacNSView {
public:
explicit AcceleratedWidgetMacNSViewHelper(CefRenderWidgetHostViewOSR* view)
: view_(view) {
}
virtual ~AcceleratedWidgetMacNSViewHelper() {}
NSView* AcceleratedWidgetGetNSView() const override {
return [view_->window_ contentView];
}
void AcceleratedWidgetGetVSyncParameters(
base::TimeTicks* timebase, base::TimeDelta* interval) const override {
*timebase = base::TimeTicks();
*interval = base::TimeDelta();
}
void AcceleratedWidgetSwapCompleted() override {
}
private:
// Guaranteed to outlive this object.
CefRenderWidgetHostViewOSR* view_;
DISALLOW_COPY_AND_ASSIGN(AcceleratedWidgetMacNSViewHelper);
};
ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac() ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac()
const { const {
if (browser_compositor_) if (browser_compositor_)
@ -109,19 +139,6 @@ void CefRenderWidgetHostViewOSR::SelectionBoundsChanged(
first_selection_rect_ = params.anchor_rect; first_selection_rect_ = params.anchor_rect;
} }
NSView* CefRenderWidgetHostViewOSR::AcceleratedWidgetGetNSView() const {
return [window_ contentView];
}
void CefRenderWidgetHostViewOSR::AcceleratedWidgetGetVSyncParameters(
base::TimeTicks* timebase, base::TimeDelta* interval) const {
*timebase = base::TimeTicks();
*interval = base::TimeDelta();
}
void CefRenderWidgetHostViewOSR::AcceleratedWidgetSwapCompleted() {
}
CefTextInputContext CefRenderWidgetHostViewOSR::GetNSTextInputContext() { CefTextInputContext CefRenderWidgetHostViewOSR::GetNSTextInputContext() {
if (!text_input_context_osr_mac_) { if (!text_input_context_osr_mac_) {
CefTextInputClientOSRMac* text_input_client_osr_mac = CefTextInputClientOSRMac* text_input_client_osr_mac =
@ -305,10 +322,12 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget() {
[content_view setWantsLayer:YES]; [content_view setWantsLayer:YES];
browser_compositor_ = content::BrowserCompositorMac::Create(); browser_compositor_ = content::BrowserCompositorMac::Create();
accelerated_widget_helper_ = new AcceleratedWidgetMacNSViewHelper(this);
compositor_.reset(browser_compositor_->compositor()); compositor_.reset(browser_compositor_->compositor());
compositor_->SetRootLayer(root_layer_.get()); compositor_->SetRootLayer(root_layer_.get());
browser_compositor_->accelerated_widget_mac()->SetNSView(this); browser_compositor_->accelerated_widget_mac()->SetNSView(
accelerated_widget_helper_);
browser_compositor_->compositor()->SetVisible(true); browser_compositor_->compositor()->SetVisible(true);
// CEF needs the browser compositor to remain responsive whereas normal // CEF needs the browser compositor to remain responsive whereas normal
@ -335,4 +354,7 @@ void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
browser_compositor_->compositor()->SetScaleAndSize(1.0, gfx::Size(0, 0)); browser_compositor_->compositor()->SetScaleAndSize(1.0, gfx::Size(0, 0));
browser_compositor_->compositor()->SetRootLayer(NULL); browser_compositor_->compositor()->SetRootLayer(NULL);
content::BrowserCompositorMac::Recycle(std::move(browser_compositor_)); content::BrowserCompositorMac::Recycle(std::move(browser_compositor_));
delete accelerated_widget_helper_;
accelerated_widget_helper_ = nullptr;
} }

View File

@ -5,6 +5,7 @@
#include "libcef/browser/prefs/browser_prefs.h" #include "libcef/browser/prefs/browser_prefs.h"
#include "libcef/browser/media_capture_devices_dispatcher.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/browser/prefs/renderer_prefs.h"
#include "libcef/common/cef_switches.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()); PrefProxyConfigTrackerImpl::RegisterPrefs(registry.get());
extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get()); extensions::ExtensionPrefs::RegisterProfilePrefs(registry.get());
HostContentSettingsMap::RegisterProfilePrefs(registry.get()); HostContentSettingsMap::RegisterProfilePrefs(registry.get());
CefURLRequestContextGetterImpl::RegisterPrefs(registry.get());
renderer_prefs::RegisterProfilePrefs(registry.get()); renderer_prefs::RegisterProfilePrefs(registry.get());
update_client::RegisterPrefs(registry.get()); update_client::RegisterPrefs(registry.get());
@ -160,14 +162,6 @@ std::unique_ptr<PrefService> CreatePrefService(const base::FilePath& pref_path)
registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false); registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, false);
registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, false); registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, false);
// Network preferences.
// Based on ProfileImpl::RegisterProfilePrefs.
registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false);
// Based on IOThread::RegisterPrefs.
#if defined(OS_POSIX) && !defined(OS_ANDROID)
registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string());
#endif
if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) { if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) {
// Preferences used with unit tests. // Preferences used with unit tests.
registry->RegisterBooleanPref("test.bool", true); registry->RegisterBooleanPref("test.bool", true);

View File

@ -140,7 +140,7 @@ void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
DCHECK_CURRENTLY_ON(BrowserThread::FILE); DCHECK_CURRENTLY_ON(BrowserThread::FILE);
DCHECK_GT(data->size(), 0U); DCHECK_GT(data->size(), 0U);
PdfMetafileSkia metafile; PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
metafile.InitFromData(static_cast<const void*>(data->front()), data->size()); metafile.InitFromData(static_cast<const void*>(data->front()), data->size());
base::File file(path, base::File file(path,

View File

@ -151,7 +151,8 @@ void PrintViewManagerBase::OnDidPrintPage(
} }
} }
std::unique_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia); std::unique_ptr<PdfMetafileSkia> metafile(
new PdfMetafileSkia(PDF_SKIA_DOCUMENT_TYPE));
if (metafile_must_be_valid) { if (metafile_must_be_valid) {
if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) { if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) {
NOTREACHED() << "Invalid metafile header"; NOTREACHED() << "Invalid metafile header";
@ -214,16 +215,8 @@ void PrintViewManagerBase::Observe(
int type, int type,
const content::NotificationSource& source, const content::NotificationSource& source,
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
switch (type) { DCHECK_EQ(chrome::NOTIFICATION_PRINT_JOB_EVENT, type);
case chrome::NOTIFICATION_PRINT_JOB_EVENT: { OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr());
OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr());
break;
}
default: {
NOTREACHED();
break;
}
}
} }
void PrintViewManagerBase::OnNotifyPrintJobEvent( void PrintViewManagerBase::OnNotifyPrintJobEvent(

View File

@ -84,20 +84,23 @@ bool CefResourceDispatcherHostDelegate::HandleExternalProtocol(
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter, const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
bool is_main_frame, bool is_main_frame,
ui::PageTransition page_transition, ui::PageTransition page_transition,
bool has_user_gesture) { bool has_user_gesture,
if (CEF_CURRENTLY_ON_UIT()) { content::ResourceContext* resource_context) {
content::WebContents* web_contents = web_contents_getter.Run(); if (!CEF_CURRENTLY_ON_UIT()) {
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get())
browser->HandleExternalProtocol(url);
} else {
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
base::Bind(base::IgnoreResult(&CefResourceDispatcherHostDelegate:: base::Bind(base::IgnoreResult(&CefResourceDispatcherHostDelegate::
HandleExternalProtocol), HandleExternalProtocol),
base::Unretained(this), url, child_id, web_contents_getter, base::Unretained(this), url, child_id, web_contents_getter,
is_main_frame, page_transition, has_user_gesture)); is_main_frame, page_transition, has_user_gesture,
resource_context));
return false;
} }
content::WebContents* web_contents = web_contents_getter.Run();
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get())
browser->HandleExternalProtocol(url);
return false; return false;
} }

View File

@ -28,7 +28,8 @@ class CefResourceDispatcherHostDelegate
web_contents_getter, web_contents_getter,
bool is_main_frame, bool is_main_frame,
ui::PageTransition page_transition, ui::PageTransition page_transition,
bool has_user_gesture) override; bool has_user_gesture,
content::ResourceContext* resource_context) override;
bool ShouldInterceptResourceAsStream(net::URLRequest* request, bool ShouldInterceptResourceAsStream(net::URLRequest* request,
const base::FilePath& plugin_path, const base::FilePath& plugin_path,
const std::string& mime_type, const std::string& mime_type,

View File

@ -200,7 +200,7 @@ display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
find_bounds); find_bounds);
} }
#endif #endif
return display::Screen::GetScreen()->GetDisplayMatching(bounds); return display::Screen::GetScreen()->GetDisplayMatching(find_bounds);
} }
void ConvertPointFromPixels(gfx::Point* point, void ConvertPointFromPixels(gfx::Point* point,

View File

@ -3,6 +3,9 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/common/crash_reporter_client.h" #include "libcef/common/crash_reporter_client.h"
#include <utility>
#include "libcef/common/cef_switches.h" #include "libcef/common/cef_switches.h"
#include "include/cef_version.h" #include "include/cef_version.h"
@ -19,7 +22,7 @@ CefCrashReporterClient::~CefCrashReporterClient() {}
#if defined(OS_WIN) #if defined(OS_WIN)
void CefCrashReporterClient::GetProductNameAndVersion( void CefCrashReporterClient::GetProductNameAndVersion(
const base::FilePath& exe_path, const base::string16& exe_path,
base::string16* product_name, base::string16* product_name,
base::string16* version, base::string16* version,
base::string16* special_build, base::string16* special_build,
@ -44,18 +47,24 @@ base::FilePath CefCrashReporterClient::GetReporterLogFilename() {
} }
#endif #endif
bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) { #if defined(OS_WIN)
#if !defined(OS_WIN) bool CefCrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) {
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kCrashDumpsDir))
return false;
*crash_dir = command_line->GetSwitchValuePath(switches::kCrashDumpsDir);
return true;
#else #else
NOTREACHED(); bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) {
return false;
#endif #endif
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kCrashDumpsDir))
return false;
base::FilePath crash_directory =
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kCrashDumpsDir);
#if defined(OS_WIN)
*crash_dir = crash_directory.value();
#else
*crash_dir = std::move(crash_directory);
#endif
return true;
} }
bool CefCrashReporterClient::EnableBreakpadForProcess( bool CefCrashReporterClient::EnableBreakpadForProcess(

View File

@ -17,7 +17,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
#if defined(OS_WIN) #if defined(OS_WIN)
// Returns a textual description of the product type and version to include // Returns a textual description of the product type and version to include
// in the crash report. // in the crash report.
void GetProductNameAndVersion(const base::FilePath& exe_path, void GetProductNameAndVersion(const base::string16& exe_path,
base::string16* product_name, base::string16* product_name,
base::string16* version, base::string16* version,
base::string16* special_build, base::string16* special_build,
@ -35,7 +35,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
// The location where minidump files should be written. Returns true if // The location where minidump files should be written. Returns true if
// |crash_dir| was set. // |crash_dir| was set.
#if defined(OS_WIN)
bool GetCrashDumpLocation(base::string16* crash_dir) override;
#else
bool GetCrashDumpLocation(base::FilePath* crash_dir) override; bool GetCrashDumpLocation(base::FilePath* crash_dir) override;
#endif
bool EnableBreakpadForProcess(const std::string& process_type) override; bool EnableBreakpadForProcess(const std::string& process_type) override;

View File

@ -43,8 +43,8 @@ class CefDragDataImpl : public CefDragData {
void AddFile(const CefString& path, const CefString& display_name) override; void AddFile(const CefString& path, const CefString& display_name) override;
// This method is not safe. Use Lock/Unlock to get mutually exclusive access. // This method is not safe. Use Lock/Unlock to get mutually exclusive access.
const content::DropData& drop_data() { content::DropData* drop_data() {
return data_; return &data_;
} }
void SetReadOnly(bool read_only); void SetReadOnly(bool read_only);

View File

@ -454,7 +454,8 @@ CefBinaryValueImpl::CefBinaryValueImpl(char* data,
size_t data_size, size_t data_size,
bool copy) bool copy)
: CefValueBase<CefBinaryValue, base::BinaryValue>( : CefValueBase<CefBinaryValue, base::BinaryValue>(
copy ? base::BinaryValue::CreateWithCopiedBuffer(data, data_size) : copy ? base::BinaryValue::CreateWithCopiedBuffer(data,
data_size).release() :
new base::BinaryValue(std::unique_ptr<char[]>(data), data_size), new base::BinaryValue(std::unique_ptr<char[]>(data), data_size),
NULL, kOwnerWillDelete, true, NULL) { NULL, kOwnerWillDelete, true, NULL) {
} }

View File

@ -120,6 +120,12 @@ class CefPrerendererClient : public content::RenderViewObserver,
private: private:
~CefPrerendererClient() override {} ~CefPrerendererClient() override {}
// RenderViewObserver methods:
void OnDestruct() override {
delete this;
}
// WebPrerendererClient methods:
void willAddPrerender(blink::WebPrerender* prerender) override {} void willAddPrerender(blink::WebPrerender* prerender) override {}
}; };

View File

@ -125,10 +125,11 @@ static void AddPepperBasedWidevine(
#endif // defined(USE_PROPRIETARY_CODECS) #endif // defined(USE_PROPRIETARY_CODECS)
} }
using Robustness = cdm::WidevineKeySystemProperties::Robustness;
concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties( concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
supported_codecs, supported_codecs,
media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness. Robustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness. Robustness::SW_SECURE_DECODE, // Maximum video robustness.
media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
media::EmeSessionTypeSupport:: media::EmeSessionTypeSupport::
NOT_SUPPORTED, // persistent-release-message. NOT_SUPPORTED, // persistent-release-message.

View File

@ -23,3 +23,7 @@ void CefPepperHelper::DidCreatePepperPlugin(content::RendererPpapiHost* host) {
host->GetPpapiHost()->AddHostFactoryFilter( host->GetPpapiHost()->AddHostFactoryFilter(
base::WrapUnique(new CefRendererPepperHostFactory(host))); base::WrapUnique(new CefRendererPepperHostFactory(host)));
} }
void CefPepperHelper::OnDestruct() {
delete this;
}

View File

@ -17,6 +17,7 @@ class CefPepperHelper : public content::RenderFrameObserver {
// RenderFrameObserver. // RenderFrameObserver.
void DidCreatePepperPlugin(content::RendererPpapiHost* host) override; void DidCreatePepperPlugin(content::RendererPpapiHost* host) override;
void OnDestruct() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(CefPepperHelper); DISALLOW_COPY_AND_ASSIGN(CefPepperHelper);

View File

@ -58,7 +58,6 @@ CefPluginPlaceholder::CefPluginPlaceholder(
html_data), html_data),
status_(CefViewHostMsg_GetPluginInfo_Status::kAllowed), status_(CefViewHostMsg_GetPluginInfo_Status::kAllowed),
title_(title), title_(title),
has_host_(false),
context_menu_request_id_(0), context_menu_request_id_(0),
ignore_updates_(false) { ignore_updates_(false) {
RenderThread::Get()->AddObserver(this); RenderThread::Get()->AddObserver(this);

View File

@ -82,7 +82,6 @@ class CefPluginPlaceholder final
base::string16 title_; base::string16 title_;
bool has_host_;
int context_menu_request_id_; // Nonzero when request pending. int context_menu_request_id_; // Nonzero when request pending.
base::string16 plugin_name_; base::string16 plugin_name_;

View File

@ -91,3 +91,7 @@ void CefPluginPreroller::OnThrottlerDestroyed() {
throttler_ = nullptr; throttler_ = nullptr;
delete this; delete this;
} }
void CefPluginPreroller::OnDestruct() {
delete this;
}

View File

@ -44,6 +44,9 @@ class CefPluginPreroller : public content::PluginInstanceThrottler::Observer,
void OnThrottleStateChange() override; void OnThrottleStateChange() override;
void OnThrottlerDestroyed() override; void OnThrottlerDestroyed() override;
// content::RenderFrameObserver implementation.
void OnDestruct() override;
blink::WebLocalFrame* frame_; blink::WebLocalFrame* frame_;
blink::WebPluginParams params_; blink::WebPluginParams params_;
content::WebPluginInfo info_; content::WebPluginInfo info_;

View File

@ -99,6 +99,10 @@ void CefRenderFrameObserver::WillReleaseScriptContext(
CefV8ReleaseContext(context); CefV8ReleaseContext(context);
} }
void CefRenderFrameObserver::OnDestruct() {
delete this;
}
// Enable deprecation warnings for MSVC. See http://crbug.com/585142. // Enable deprecation warnings for MSVC. See http://crbug.com/585142.
#if defined(OS_WIN) #if defined(OS_WIN)

View File

@ -21,6 +21,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
int world_id) override; int world_id) override;
void WillReleaseScriptContext(v8::Handle<v8::Context> context, void WillReleaseScriptContext(v8::Handle<v8::Context> context,
int world_id) override; int world_id) override;
void OnDestruct() override;
private: private:
DISALLOW_COPY_AND_ASSIGN(CefRenderFrameObserver); DISALLOW_COPY_AND_ASSIGN(CefRenderFrameObserver);

View File

@ -15,7 +15,6 @@
MSVC_PUSH_WARNING_LEVEL(0); MSVC_PUSH_WARNING_LEVEL(0);
#include "core/frame/Frame.h" #include "core/frame/Frame.h"
#include "core/frame/LocalFrame.h" #include "core/frame/LocalFrame.h"
#include "core/workers/WorkerGlobalScope.h"
#include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8Binding.h"
MSVC_POP_WARNING(); MSVC_POP_WARNING();

View File

@ -27,7 +27,10 @@ patches = [
{ {
# Avoid MessageLoop assertion on OS X. # Avoid MessageLoop assertion on OS X.
# https://bitbucket.org/chromiumembedded/cef/issues/443 # https://bitbucket.org/chromiumembedded/cef/issues/443
'name': 'message_loop_443', #
# Revert change on Windows that removes MessageLoop::os_modal_loop().
# https://codereview.chromium.org/1992243003
'name': 'message_loop_443_1992243003',
'path': '../base/message_loop/', 'path': '../base/message_loop/',
}, },
{ {

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc diff --git render_widget_host_view_guest.cc render_widget_host_view_guest.cc
index 54d6c4c..4a5268d 100644 index 2f7ff29..49389ce 100644
--- render_widget_host_view_guest.cc --- render_widget_host_view_guest.cc
+++ render_widget_host_view_guest.cc +++ render_widget_host_view_guest.cc
@@ -212,6 +212,9 @@ void RenderWidgetHostViewGuest::Destroy() { @@ -215,6 +215,9 @@ void RenderWidgetHostViewGuest::Destroy() {
} }
gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const {

View File

@ -1,5 +1,5 @@
diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc diff --git browser/browser_plugin/browser_plugin_guest.cc browser/browser_plugin/browser_plugin_guest.cc
index 71e2857..73d4e45 100644 index 826c644..f52fd25 100644
--- browser/browser_plugin/browser_plugin_guest.cc --- browser/browser_plugin/browser_plugin_guest.cc
+++ browser/browser_plugin/browser_plugin_guest.cc +++ browser/browser_plugin/browser_plugin_guest.cc
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
@ -11,7 +11,7 @@ index 71e2857..73d4e45 100644
#include "content/common/browser_plugin/browser_plugin_constants.h" #include "content/common/browser_plugin/browser_plugin_constants.h"
#include "content/common/browser_plugin/browser_plugin_messages.h" #include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/content_constants_internal.h" #include "content/common/content_constants_internal.h"
@@ -287,20 +287,19 @@ void BrowserPluginGuest::InitInternal( @@ -289,20 +289,19 @@ void BrowserPluginGuest::InitInternal(
guest_window_rect_ = params.view_rect; guest_window_rect_ = params.view_rect;
if (owner_web_contents_ != owner_web_contents) { if (owner_web_contents_ != owner_web_contents) {
@ -36,7 +36,7 @@ index 71e2857..73d4e45 100644
} }
RendererPreferences* renderer_prefs = RendererPreferences* renderer_prefs =
@@ -750,11 +749,10 @@ void BrowserPluginGuest::OnWillAttachComplete( @@ -755,11 +754,10 @@ void BrowserPluginGuest::OnWillAttachComplete(
->GetWidget() ->GetWidget()
->Init(); ->Init();
GetWebContents()->GetMainFrame()->Init(); GetWebContents()->GetMainFrame()->Init();

View File

@ -1,79 +1,29 @@
diff --git web_contents_impl.cc web_contents_impl.cc diff --git web_contents_impl.cc web_contents_impl.cc
index 5621f82..3124d00 100644 index 7754791..8aebfcd 100644
--- web_contents_impl.cc --- web_contents_impl.cc
+++ web_contents_impl.cc +++ web_contents_impl.cc
@@ -1510,39 +1510,47 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { @@ -1498,6 +1498,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
// frame - let's do the same thing here.
std::string unique_name = params.main_frame_name; std::string unique_name = params.main_frame_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
+
+ if (params.view && params.delegate_view) { + if (params.view && params.delegate_view) {
+ view_.reset(params.view); + view_.reset(params.view);
+ render_view_host_delegate_view_ = params.delegate_view; + render_view_host_delegate_view_ = params.delegate_view;
+ } + }
- WebContentsViewDelegate* delegate =
- GetContentClient()->browser()->GetWebContentsViewDelegate(this);
+ if (!view_) {
+ WebContentsViewDelegate* delegate =
+ GetContentClient()->browser()->GetWebContentsViewDelegate(this);
#if defined(MOJO_SHELL_CLIENT)
- if (MojoShellConnection::Get() &&
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kUseMusInRenderer)) {
- mus::Window* mus_window = aura::GetMusWindow(params.context);
- if (mus_window) {
- view_.reset(new WebContentsViewMus(mus_window, this, delegate,
- &render_view_host_delegate_view_));
+ if (MojoShellConnection::Get() &&
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseMusInRenderer)) {
+ mus::Window* mus_window = aura::GetMusWindow(params.context);
+ if (mus_window) {
+ view_.reset(new WebContentsViewMus(mus_window, this, delegate,
+ &render_view_host_delegate_view_));
+ }
}
- }
#endif
- if (!view_) {
+ if (!view_) {
+ if (browser_plugin_guest_ &&
+ BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ view_.reset(new WebContentsViewChildFrame(
+ this, delegate, &render_view_host_delegate_view_));
+ } else {
+ view_.reset(CreateWebContentsView(this, delegate,
+ &render_view_host_delegate_view_));
+ }
+ }
+ +
if (browser_plugin_guest_ && + if (!view_) {
- BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { WebContentsViewDelegate* delegate =
- view_.reset(new WebContentsViewChildFrame( GetContentClient()->browser()->GetWebContentsViewDelegate(this);
- this, delegate, &render_view_host_delegate_view_));
- } else {
- view_.reset(CreateWebContentsView(this, delegate,
- &render_view_host_delegate_view_));
+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
+ std::move(view_),
+ &render_view_host_delegate_view_));
}
}
- if (browser_plugin_guest_ && @@ -1530,6 +1536,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { std::move(view_),
- view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), &render_view_host_delegate_view_));
- std::move(view_), }
- &render_view_host_delegate_view_)); + }
- }
CHECK(render_view_host_delegate_view_); CHECK(render_view_host_delegate_view_);
CHECK(view_.get()); CHECK(view_.get());
@@ -1974,11 +1982,14 @@ void WebContentsImpl::CreateNewWindow( @@ -1973,11 +1980,14 @@ void WebContentsImpl::CreateNewWindow(
static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace);
CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context));
@ -89,7 +39,7 @@ index 5621f82..3124d00 100644
if (route_id != MSG_ROUTING_NONE && if (route_id != MSG_ROUTING_NONE &&
!RenderViewHost::FromID(render_process_id, route_id)) { !RenderViewHost::FromID(render_process_id, route_id)) {
// If the embedder didn't create a WebContents for this route, we need to // If the embedder didn't create a WebContents for this route, we need to
@@ -2002,6 +2013,8 @@ void WebContentsImpl::CreateNewWindow( @@ -2001,6 +2011,8 @@ void WebContentsImpl::CreateNewWindow(
create_params.opener_render_process_id = render_process_id; create_params.opener_render_process_id = render_process_id;
create_params.opener_render_frame_id = params.opener_render_frame_id; create_params.opener_render_frame_id = params.opener_render_frame_id;
create_params.opener_suppressed = params.opener_suppressed; create_params.opener_suppressed = params.opener_suppressed;

View File

@ -1,5 +1,5 @@
diff --git common.gypi common.gypi diff --git common.gypi common.gypi
index 3724f2f..5eb9cde 100644 index 203247d..2991dfc 100644
--- common.gypi --- common.gypi
+++ common.gypi +++ common.gypi
@@ -9,6 +9,9 @@ @@ -9,6 +9,9 @@

View File

@ -1,8 +1,8 @@
diff --git ui/browser.cc ui/browser.cc diff --git ui/browser.cc ui/browser.cc
index e551474..222b6ad 100644 index 14a9336..6f26daf 100644
--- ui/browser.cc --- ui/browser.cc
+++ ui/browser.cc +++ ui/browser.cc
@@ -1731,7 +1731,9 @@ bool Browser::ShouldCreateWebContents( @@ -1614,7 +1614,9 @@ bool Browser::ShouldCreateWebContents(
const std::string& frame_name, const std::string& frame_name,
const GURL& target_url, const GURL& target_url,
const std::string& partition_id, const std::string& partition_id,
@ -14,7 +14,7 @@ index e551474..222b6ad 100644
// If a BackgroundContents is created, suppress the normal WebContents. // If a BackgroundContents is created, suppress the normal WebContents.
return !MaybeCreateBackgroundContents( return !MaybeCreateBackgroundContents(
diff --git ui/browser.h ui/browser.h diff --git ui/browser.h ui/browser.h
index 2196898..af9df43 100644 index 01f2880..e741e21 100644
--- ui/browser.h --- ui/browser.h
+++ ui/browser.h +++ ui/browser.h
@@ -616,7 +616,9 @@ class Browser : public TabStripModelObserver, @@ -616,7 +616,9 @@ class Browser : public TabStripModelObserver,

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index ea713fd..e4119f6 100644 index 6fdb92e..5405306 100644
--- content/browser/compositor/gpu_process_transport_factory.cc --- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -188,6 +188,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() { @@ -184,6 +184,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
std::unique_ptr<cc::SoftwareOutputDevice> std::unique_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice( GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) { ui::Compositor* compositor) {
@ -14,7 +14,7 @@ index ea713fd..e4119f6 100644
+ } + }
+ +
#if defined(MOJO_RUNNER_CLIENT) #if defined(MOJO_RUNNER_CLIENT)
if (IsRunningInMojoShell()) { if (shell::ShellIsRemote()) {
return std::unique_ptr<cc::SoftwareOutputDevice>( return std::unique_ptr<cc::SoftwareOutputDevice>(
diff --git ui/compositor/compositor.h ui/compositor/compositor.h diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index a6245da..edfdeb5c 100644 index a6245da..edfdeb5c 100644

View File

@ -19,10 +19,10 @@ index 4ad49c8..f1fa7ab 100644
return false; return false;
} }
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
index d96adc9..348ae16 100644 index 579335b..2248549 100644
--- public/renderer/content_renderer_client.h --- public/renderer/content_renderer_client.h
+++ public/renderer/content_renderer_client.h +++ public/renderer/content_renderer_client.h
@@ -200,7 +200,6 @@ class CONTENT_EXPORT ContentRendererClient { @@ -201,7 +201,6 @@ class CONTENT_EXPORT ContentRendererClient {
// Returns true if a popup window should be allowed. // Returns true if a popup window should be allowed.
virtual bool AllowPopup(); virtual bool AllowPopup();
@ -30,7 +30,7 @@ index d96adc9..348ae16 100644
// TODO(sgurun) This callback is deprecated and will be removed as soon // TODO(sgurun) This callback is deprecated and will be removed as soon
// as android webview completes implementation of a resource throttle based // as android webview completes implementation of a resource throttle based
// shouldoverrideurl implementation. See crbug.com/325351 // shouldoverrideurl implementation. See crbug.com/325351
@@ -216,6 +215,7 @@ class CONTENT_EXPORT ContentRendererClient { @@ -217,6 +216,7 @@ class CONTENT_EXPORT ContentRendererClient {
blink::WebNavigationPolicy default_policy, blink::WebNavigationPolicy default_policy,
bool is_redirect); bool is_redirect);
@ -39,10 +39,10 @@ index d96adc9..348ae16 100644
// built in media player for the given |url|. Defaults to false. // built in media player for the given |url|. Defaults to false.
virtual bool ShouldUseMediaPlayerForURL(const GURL& url); virtual bool ShouldUseMediaPlayerForURL(const GURL& url);
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
index 4ff6aaa..4309775 100644 index 5f3ab60..b6f503f 100644
--- renderer/render_frame_impl.cc --- renderer/render_frame_impl.cc
+++ renderer/render_frame_impl.cc +++ renderer/render_frame_impl.cc
@@ -4771,7 +4771,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( @@ -4867,7 +4867,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
(pending_navigation_params_ && (pending_navigation_params_ &&
!pending_navigation_params_->request_params.redirects.empty()); !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 // The handlenavigation API is deprecated and will be removed once
// crbug.com/325351 is resolved. // crbug.com/325351 is resolved.
if (GetContentClient()->renderer()->HandleNavigation( if (GetContentClient()->renderer()->HandleNavigation(
@@ -4780,7 +4779,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( @@ -4876,7 +4875,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
is_redirect)) { is_redirect)) {
return blink::WebNavigationPolicyIgnore; return blink::WebNavigationPolicyIgnore;
} }

View File

@ -1,5 +1,5 @@
diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc diff --git browser/guest_view/extension_options/extension_options_guest.cc browser/guest_view/extension_options/extension_options_guest.cc
index eb8eb4d..836ce55 100644 index 85bd364..60e936c 100644
--- browser/guest_view/extension_options/extension_options_guest.cc --- browser/guest_view/extension_options/extension_options_guest.cc
+++ browser/guest_view/extension_options/extension_options_guest.cc +++ browser/guest_view/extension_options/extension_options_guest.cc
@@ -203,7 +203,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents( @@ -203,7 +203,9 @@ bool ExtensionOptionsGuest::ShouldCreateWebContents(

View File

@ -1,5 +1,5 @@
diff --git resource_ids resource_ids diff --git resource_ids resource_ids
index 5c46a26..b0babb3 100644 index bac636f2..979a58f0 100644
--- resource_ids --- resource_ids
+++ resource_ids +++ resource_ids
@@ -14,6 +14,12 @@ @@ -14,6 +14,12 @@
@ -14,4 +14,4 @@ index 5c46a26..b0babb3 100644
+ }, + },
"chrome/browser/browser_resources.grd": { "chrome/browser/browser_resources.grd": {
"includes": [400], "includes": [400],
"structures": [750], "structures": [850],

View File

@ -1,17 +0,0 @@
diff --git message_loop.cc message_loop.cc
index 3fef91b..58ddbf3 100644
--- message_loop.cc
+++ message_loop.cc
@@ -142,12 +142,6 @@ MessageLoop::~MessageLoop() {
// may be current.
DCHECK((pump_ && current() == this) || (!pump_ && current() != this));
- // iOS just attaches to the loop, it doesn't Run it.
- // TODO(stuartmorgan): Consider wiring up a Detach().
-#if !defined(OS_IOS)
- DCHECK(!run_loop_);
-#endif
-
#if defined(OS_WIN)
if (in_high_res_mode_)
Time::ActivateHighResolutionTimer(false);

View File

@ -0,0 +1,106 @@
diff --git message_loop.cc message_loop.cc
index 2d6e2a5..7509494 100644
--- message_loop.cc
+++ message_loop.cc
@@ -143,12 +143,6 @@ MessageLoop::~MessageLoop() {
// may be current.
DCHECK((pump_ && current() == this) || (!pump_ && current() != this));
- // iOS just attaches to the loop, it doesn't Run it.
- // TODO(stuartmorgan): Consider wiring up a Detach().
-#if !defined(OS_IOS)
- DCHECK(!run_loop_);
-#endif
-
#if defined(OS_WIN)
if (in_high_res_mode_)
Time::ActivateHighResolutionTimer(false);
@@ -390,6 +384,9 @@ MessageLoop::MessageLoop(Type type, MessagePumpFactoryCallback pump_factory)
in_high_res_mode_(false),
#endif
nestable_tasks_allowed_(true),
+#if defined(OS_WIN)
+ os_modal_loop_(false),
+#endif // OS_WIN
pump_factory_(pump_factory),
message_histogram_(NULL),
run_loop_(NULL),
diff --git message_loop.h message_loop.h
index 11d8712..bddc532 100644
--- message_loop.h
+++ message_loop.h
@@ -373,6 +373,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
void AddTaskObserver(TaskObserver* task_observer);
void RemoveTaskObserver(TaskObserver* task_observer);
+#if defined(OS_WIN)
+ void set_os_modal_loop(bool os_modal_loop) {
+ os_modal_loop_ = os_modal_loop;
+ }
+
+ bool os_modal_loop() const {
+ return os_modal_loop_;
+ }
+#endif // OS_WIN
+
// Can only be called from the thread that owns the MessageLoop.
bool is_running() const;
@@ -511,6 +521,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// insider a (accidentally induced?) nested message pump.
bool nestable_tasks_allowed_;
+#if defined(OS_WIN)
+ // Should be set to true before calling Windows APIs like TrackPopupMenu, etc.
+ // which enter a modal message loop.
+ bool os_modal_loop_;
+#endif
+
// pump_factory_.Run() is called to create a message pump for this loop
// if type_ is TYPE_CUSTOM and pump_ is null.
MessagePumpFactoryCallback pump_factory_;
diff --git message_pump_win.cc message_pump_win.cc
index 499d2d8..9002e15 100644
--- message_pump_win.cc
+++ message_pump_win.cc
@@ -474,20 +474,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
}
bool MessagePumpForUI::ProcessPumpReplacementMessage() {
- // When we encounter a kMsgHaveWork message, this method is called to peek and
- // process a replacement message. The goal is to make the kMsgHaveWork as non-
- // intrusive as possible, even though a continuous stream of such messages are
- // posted. This method carefully peeks a message while there is no chance for
- // a kMsgHaveWork to be pending, then resets the |have_work_| flag (allowing a
- // replacement kMsgHaveWork to possibly be posted), and finally dispatches
- // that peeked replacement. Note that the re-post of kMsgHaveWork may be
- // asynchronous to this thread!!
-
+ // When we encounter a kMsgHaveWork message, this method is called to peek
+ // and process a replacement message, such as a WM_PAINT or WM_TIMER. The
+ // goal is to make the kMsgHaveWork as non-intrusive as possible, even though
+ // a continuous stream of such messages are posted. This method carefully
+ // peeks a message while there is no chance for a kMsgHaveWork to be pending,
+ // then resets the have_work_ flag (allowing a replacement kMsgHaveWork to
+ // possibly be posted), and finally dispatches that peeked replacement. Note
+ // that the re-post of kMsgHaveWork may be asynchronous to this thread!!
+
+ bool have_message = false;
MSG msg;
- const bool have_message =
- g_peek_message(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE;
+ // We should not process all window messages if we are in the context of an
+ // OS modal loop, i.e. in the context of a windows API call like MessageBox.
+ // This is to ensure that these messages are peeked out by the OS modal loop.
+ if (MessageLoop::current()->os_modal_loop()) {
+ // We only peek out WM_PAINT and WM_TIMER here for reasons mentioned above.
+ have_message = PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE) ||
+ PeekMessage(&msg, NULL, WM_TIMER, WM_TIMER, PM_REMOVE);
+ } else {
+ have_message = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != FALSE;
+ }
- // Expect no message or a message different than kMsgHaveWork.
DCHECK(!have_message || kMsgHaveWork != msg.message ||
msg.hwnd != message_hwnd_);

View File

@ -1,8 +1,8 @@
diff --git base/network_delegate.h base/network_delegate.h diff --git base/network_delegate.h base/network_delegate.h
index 81d8190..3405e31 100644 index 2deb9c58..0896a36 100644
--- base/network_delegate.h --- base/network_delegate.h
+++ base/network_delegate.h +++ base/network_delegate.h
@@ -35,6 +35,7 @@ namespace net { @@ -36,6 +36,7 @@ namespace net {
// of net/base here, because we have a net_base library. Forward declarations // of net/base here, because we have a net_base library. Forward declarations
// are ok. // are ok.
class CookieOptions; class CookieOptions;
@ -10,7 +10,7 @@ index 81d8190..3405e31 100644
class HttpRequestHeaders; class HttpRequestHeaders;
class HttpResponseHeaders; class HttpResponseHeaders;
class ProxyInfo; class ProxyInfo;
@@ -109,6 +110,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { @@ -111,6 +112,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
const GURL& target_url, const GURL& target_url,
const GURL& referrer_url) const; const GURL& referrer_url) const;
@ -45,10 +45,10 @@ index 78b8c34..387bea5 100644
friend class GZipUnitTest; friend class GZipUnitTest;
friend class SdchFilterChainingTest; friend class SdchFilterChainingTest;
diff --git url_request/url_request_job.cc url_request/url_request_job.cc diff --git url_request/url_request_job.cc url_request/url_request_job.cc
index 63edfe3..8ab84cc 100644 index b9c8646..f1ed586 100644
--- url_request/url_request_job.cc --- url_request/url_request_job.cc
+++ url_request/url_request_job.cc +++ url_request/url_request_job.cc
@@ -448,6 +448,9 @@ void URLRequestJob::NotifyHeadersComplete() { @@ -444,6 +444,9 @@ void URLRequestJob::NotifyHeadersComplete() {
if (request_->status().is_success()) if (request_->status().is_success())
filter_ = SetupFilter(); filter_ = SetupFilter();

View File

@ -1,8 +1,8 @@
diff --git url_request.h url_request.h diff --git url_request.h url_request.h
index eb94da8..e4a9370 100644 index a4dba71..bde4569 100644
--- url_request.h --- url_request.h
+++ url_request.h +++ url_request.h
@@ -659,10 +659,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), @@ -648,10 +648,10 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// or after the response headers are received. // or after the response headers are received.
void GetConnectionAttempts(ConnectionAttempts* out) const; void GetConnectionAttempts(ConnectionAttempts* out) const;

View File

@ -1,8 +1,8 @@
diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
index 020ff8d..e4c5d9a 100644 index 43ca318..ca42502 100644
--- fpdfsdk/fpdfview.cpp --- fpdfsdk/fpdfview.cpp
+++ fpdfsdk/fpdfview.cpp +++ fpdfsdk/fpdfview.cpp
@@ -19,6 +19,7 @@ @@ -20,6 +20,7 @@
#include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/include/fsdk_rendercontext.h" #include "fpdfsdk/include/fsdk_rendercontext.h"
#include "fpdfsdk/javascript/ijs_runtime.h" #include "fpdfsdk/javascript/ijs_runtime.h"
@ -10,7 +10,7 @@ index 020ff8d..e4c5d9a 100644
#include "public/fpdf_ext.h" #include "public/fpdf_ext.h"
#include "public/fpdf_progressive.h" #include "public/fpdf_progressive.h"
#include "third_party/base/numerics/safe_conversions_impl.h" #include "third_party/base/numerics/safe_conversions_impl.h"
@@ -267,6 +268,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() { @@ -291,6 +292,7 @@ DLLEXPORT void STDCALL FPDF_DestroyLibrary() {
#endif // PDF_ENABLE_XFA #endif // PDF_ENABLE_XFA
CPDF_ModuleMgr::Destroy(); CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy(); CFX_GEModule::Destroy();

View File

@ -1,8 +1,8 @@
diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h diff --git public/common/common_param_traits_macros.h public/common/common_param_traits_macros.h
index 3a1b8fb..927061c 100644 index c58e881..ccce3c1 100644
--- public/common/common_param_traits_macros.h --- public/common/common_param_traits_macros.h
+++ public/common/common_param_traits_macros.h +++ public/common/common_param_traits_macros.h
@@ -207,6 +207,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) @@ -208,6 +208,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
@ -11,10 +11,10 @@ index 3a1b8fb..927061c 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git public/common/web_preferences.cc public/common/web_preferences.cc diff --git public/common/web_preferences.cc public/common/web_preferences.cc
index a0bc6f1..96d1478 100644 index 21411ea..2555544 100644
--- public/common/web_preferences.cc --- public/common/web_preferences.cc
+++ public/common/web_preferences.cc +++ public/common/web_preferences.cc
@@ -163,6 +163,7 @@ WebPreferences::WebPreferences() @@ -167,6 +167,7 @@ WebPreferences::WebPreferences()
pinch_overlay_scrollbar_thickness(0), pinch_overlay_scrollbar_thickness(0),
use_solid_color_scrollbars(false), use_solid_color_scrollbars(false),
navigate_on_drag_drop(true), navigate_on_drag_drop(true),
@ -23,10 +23,10 @@ index a0bc6f1..96d1478 100644
inert_visual_viewport(false), inert_visual_viewport(false),
record_whole_document(false), record_whole_document(false),
diff --git public/common/web_preferences.h public/common/web_preferences.h diff --git public/common/web_preferences.h public/common/web_preferences.h
index 54b8ed4..160991f 100644 index b30f22a9..7779d08 100644
--- public/common/web_preferences.h --- public/common/web_preferences.h
+++ public/common/web_preferences.h +++ public/common/web_preferences.h
@@ -176,6 +176,7 @@ struct CONTENT_EXPORT WebPreferences { @@ -178,6 +178,7 @@ struct CONTENT_EXPORT WebPreferences {
int pinch_overlay_scrollbar_thickness; int pinch_overlay_scrollbar_thickness;
bool use_solid_color_scrollbars; bool use_solid_color_scrollbars;
bool navigate_on_drag_drop; bool navigate_on_drag_drop;
@ -35,10 +35,10 @@ index 54b8ed4..160991f 100644
bool inert_visual_viewport; bool inert_visual_viewport;
bool record_whole_document; bool record_whole_document;
diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc diff --git renderer/render_view_impl.cc renderer/render_view_impl.cc
index 71c52a3..cef247f 100644 index bec4737..ea6262b 100644
--- renderer/render_view_impl.cc --- renderer/render_view_impl.cc
+++ renderer/render_view_impl.cc +++ renderer/render_view_impl.cc
@@ -1475,6 +1475,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( @@ -1468,6 +1468,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
blink::WebView* web_view, blink::WebView* web_view,
CompositorDependencies* compositor_deps) { CompositorDependencies* compositor_deps) {
ApplyWebPreferences(prefs, web_view); ApplyWebPreferences(prefs, web_view);

View File

@ -136,7 +136,7 @@ index 705211b..a524333 100644
PrintHostMsg_SetOptionsFromDocument_Params /* params */) PrintHostMsg_SetOptionsFromDocument_Params /* params */)
-#endif // defined(ENABLE_PRINT_PREVIEW) -#endif // defined(ENABLE_PRINT_PREVIEW)
diff --git printing/renderer/print_web_view_helper.cc printing/renderer/print_web_view_helper.cc diff --git printing/renderer/print_web_view_helper.cc printing/renderer/print_web_view_helper.cc
index cfb1c77..33dad1a 100644 index fa79d1a..3cf2f1d 100644
--- printing/renderer/print_web_view_helper.cc --- printing/renderer/print_web_view_helper.cc
+++ printing/renderer/print_web_view_helper.cc +++ printing/renderer/print_web_view_helper.cc
@@ -83,6 +83,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f; @@ -83,6 +83,9 @@ const float kPrintingMinimumShrinkFactor = 1.333f;
@ -241,7 +241,7 @@ index cfb1c77..33dad1a 100644
IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked, IPC_MESSAGE_HANDLER(PrintMsg_SetScriptedPrintingBlocked,
SetScriptedPrintBlocked) SetScriptedPrintBlocked)
IPC_MESSAGE_UNHANDLED(handled = false) IPC_MESSAGE_UNHANDLED(handled = false)
@@ -984,7 +973,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() { @@ -988,7 +977,6 @@ void PrintWebViewHelper::OnPrintForSystemDialog() {
} }
#endif // defined(ENABLE_BASIC_PRINTING) #endif // defined(ENABLE_BASIC_PRINTING)
@ -249,7 +249,7 @@ index cfb1c77..33dad1a 100644
void PrintWebViewHelper::OnPrintForPrintPreview( void PrintWebViewHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) { const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1); CHECK_LE(ipc_nesting_level_, 1);
@@ -1049,7 +1037,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview( @@ -1053,7 +1041,6 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT); DidFinishPrinting(FAIL_PRINT);
} }
} }
@ -257,7 +257,7 @@ index cfb1c77..33dad1a 100644
void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout( void PrintWebViewHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points, const PageSizeMargins& page_layout_in_points,
@@ -1074,7 +1061,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo( @@ -1078,7 +1065,6 @@ void PrintWebViewHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS); ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
} }
@ -265,7 +265,7 @@ index cfb1c77..33dad1a 100644
void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
@@ -1235,7 +1221,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() { @@ -1239,7 +1225,7 @@ bool PrintWebViewHelper::CreatePreviewDocument() {
return true; return true;
} }
@ -274,7 +274,7 @@ index cfb1c77..33dad1a 100644
bool PrintWebViewHelper::RenderPreviewPage( bool PrintWebViewHelper::RenderPreviewPage(
int page_number, int page_number,
const PrintMsg_Print_Params& print_params) { const PrintMsg_Print_Params& print_params) {
@@ -1264,7 +1250,7 @@ bool PrintWebViewHelper::RenderPreviewPage( @@ -1269,7 +1255,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
} }
return PreviewPageRendered(page_number, draft_metafile.get()); return PreviewPageRendered(page_number, draft_metafile.get());
} }
@ -283,7 +283,7 @@ index cfb1c77..33dad1a 100644
bool PrintWebViewHelper::FinalizePrintReadyDocument() { bool PrintWebViewHelper::FinalizePrintReadyDocument() {
DCHECK(!is_print_ready_metafile_sent_); DCHECK(!is_print_ready_metafile_sent_);
@@ -1294,7 +1280,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() { @@ -1299,7 +1285,6 @@ bool PrintWebViewHelper::FinalizePrintReadyDocument() {
Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params)); Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
return true; return true;
} }
@ -291,7 +291,7 @@ index cfb1c77..33dad1a 100644
void PrintWebViewHelper::OnPrintingDone(bool success) { void PrintWebViewHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
@@ -1309,7 +1294,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) { @@ -1314,7 +1299,6 @@ void PrintWebViewHelper::SetScriptedPrintBlocked(bool blocked) {
is_scripted_printing_blocked_ = blocked; is_scripted_printing_blocked_ = blocked;
} }
@ -299,7 +299,7 @@ index cfb1c77..33dad1a 100644
void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
@@ -1320,7 +1304,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { @@ -1325,7 +1309,9 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
// that instead. // that instead.
auto plugin = delegate_->GetPdfElement(frame); auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.isNull()) { if (!plugin.isNull()) {
@ -309,7 +309,7 @@ index cfb1c77..33dad1a 100644
return; return;
} }
print_preview_context_.InitWithFrame(frame); print_preview_context_.InitWithFrame(frame);
@@ -1328,7 +1314,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) { @@ -1333,7 +1319,6 @@ void PrintWebViewHelper::OnInitiatePrintPreview(bool selection_only) {
? PRINT_PREVIEW_USER_INITIATED_SELECTION ? PRINT_PREVIEW_USER_INITIATED_SELECTION
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
} }
@ -317,7 +317,7 @@ index cfb1c77..33dad1a 100644
bool PrintWebViewHelper::IsPrintingEnabled() { bool PrintWebViewHelper::IsPrintingEnabled() {
bool result = false; bool result = false;
@@ -1354,11 +1339,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) { @@ -1359,11 +1344,9 @@ void PrintWebViewHelper::PrintNode(const blink::WebNode& node) {
// Make a copy of the node, in case RenderView::OnContextMenuClosed resets // Make a copy of the node, in case RenderView::OnContextMenuClosed resets
// its |context_menu_node_|. // its |context_menu_node_|.
@ -330,7 +330,7 @@ index cfb1c77..33dad1a 100644
} else { } else {
#if defined(ENABLE_BASIC_PRINTING) #if defined(ENABLE_BASIC_PRINTING)
blink::WebNode duplicate_node(node); blink::WebNode duplicate_node(node);
@@ -1424,7 +1407,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { @@ -1429,7 +1412,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
} }
break; break;
@ -338,7 +338,7 @@ index cfb1c77..33dad1a 100644
case FAIL_PREVIEW: case FAIL_PREVIEW:
int cookie = int cookie =
print_pages_params_ ? print_pages_params_->params.document_cookie : 0; print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
@@ -1436,7 +1418,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { @@ -1441,7 +1423,6 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
} }
print_preview_context_.Failed(notify_browser_of_print_failure_); print_preview_context_.Failed(notify_browser_of_print_failure_);
break; break;
@ -346,7 +346,7 @@ index cfb1c77..33dad1a 100644
} }
prep_frame_view_.reset(); prep_frame_view_.reset();
print_pages_params_.reset(); print_pages_params_.reset();
@@ -1568,7 +1549,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, @@ -1573,7 +1554,6 @@ bool PrintWebViewHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true; return true;
} }
@ -354,7 +354,7 @@ index cfb1c77..33dad1a 100644
bool PrintWebViewHelper::SetOptionsFromPdfDocument( bool PrintWebViewHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) { PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -1677,7 +1657,6 @@ bool PrintWebViewHelper::UpdatePrintSettings( @@ -1682,7 +1662,6 @@ bool PrintWebViewHelper::UpdatePrintSettings(
return true; return true;
} }
@ -362,7 +362,7 @@ index cfb1c77..33dad1a 100644
#if defined(ENABLE_BASIC_PRINTING) #if defined(ENABLE_BASIC_PRINTING)
bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame, bool PrintWebViewHelper::GetPrintSettingsFromUser(blink::WebLocalFrame* frame,
@@ -1785,7 +1764,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -1790,7 +1769,6 @@ void PrintWebViewHelper::PrintPageInternal(
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
@ -370,7 +370,7 @@ index cfb1c77..33dad1a 100644
if (params.params.display_header_footer) { if (params.params.display_header_footer) {
// TODO(thestig): Figure out why Linux needs this. It is almost certainly // TODO(thestig): Figure out why Linux needs this. It is almost certainly
// |printingMinimumShrinkFactor| from Blink. // |printingMinimumShrinkFactor| from Blink.
@@ -1800,7 +1778,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -1805,7 +1783,6 @@ void PrintWebViewHelper::PrintPageInternal(
scale_factor / fudge_factor, page_layout_in_points, scale_factor / fudge_factor, page_layout_in_points,
params.params); params.params);
} }
@ -378,7 +378,7 @@ index cfb1c77..33dad1a 100644
float webkit_scale_factor = float webkit_scale_factor =
RenderPageContent(frame, params.page_number, canvas_area, content_area, RenderPageContent(frame, params.page_number, canvas_area, content_area,
@@ -1836,7 +1813,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem( @@ -1841,7 +1818,6 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
return true; return true;
} }
@ -386,7 +386,7 @@ index cfb1c77..33dad1a 100644
void PrintWebViewHelper::ShowScriptedPrintPreview() { void PrintWebViewHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) { if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false; is_scripted_preview_delayed_ = false;
@@ -1964,7 +1940,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number, @@ -1969,7 +1945,6 @@ bool PrintWebViewHelper::PreviewPageRendered(int page_number,
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params)); Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true; return true;
} }
@ -395,7 +395,7 @@ index cfb1c77..33dad1a 100644
PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext() PrintWebViewHelper::PrintPreviewContext::PrintPreviewContext()
: total_page_count_(0), : total_page_count_(0),
diff --git printing/renderer/print_web_view_helper.h printing/renderer/print_web_view_helper.h diff --git printing/renderer/print_web_view_helper.h printing/renderer/print_web_view_helper.h
index 7232b22..d2833f8 100644 index fe33d5e..3f1b7b5 100644
--- printing/renderer/print_web_view_helper.h --- printing/renderer/print_web_view_helper.h
+++ printing/renderer/print_web_view_helper.h +++ printing/renderer/print_web_view_helper.h
@@ -137,9 +137,7 @@ class PrintWebViewHelper @@ -137,9 +137,7 @@ class PrintWebViewHelper
@ -408,7 +408,7 @@ index 7232b22..d2833f8 100644
}; };
enum PrintPreviewErrorBuckets { enum PrintPreviewErrorBuckets {
@@ -173,10 +171,8 @@ class PrintWebViewHelper @@ -174,10 +172,8 @@ class PrintWebViewHelper
void OnPrintForSystemDialog(); void OnPrintForSystemDialog();
void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); void OnPrintForPrintPreview(const base::DictionaryValue& job_settings);
#endif // defined(ENABLE_BASIC_PRINTING) #endif // defined(ENABLE_BASIC_PRINTING)
@ -419,7 +419,7 @@ index 7232b22..d2833f8 100644
void OnPrintingDone(bool success); void OnPrintingDone(bool success);
// Get |page_size| and |content_area| information from // Get |page_size| and |content_area| information from
@@ -189,7 +185,6 @@ class PrintWebViewHelper @@ -190,7 +186,6 @@ class PrintWebViewHelper
// Update |ignore_css_margins_| based on settings. // Update |ignore_css_margins_| based on settings.
void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
@ -427,7 +427,7 @@ index 7232b22..d2833f8 100644
// Prepare frame for creating preview document. // Prepare frame for creating preview document.
void PrepareFrameForPreviewDocument(); void PrepareFrameForPreviewDocument();
@@ -206,7 +201,6 @@ class PrintWebViewHelper @@ -207,7 +202,6 @@ class PrintWebViewHelper
// Finalize the print ready preview document. // Finalize the print ready preview document.
bool FinalizePrintReadyDocument(); bool FinalizePrintReadyDocument();
@ -435,7 +435,7 @@ index 7232b22..d2833f8 100644
// Enable/Disable window.print calls. If |blocked| is true window.print // Enable/Disable window.print calls. If |blocked| is true window.print
// calls will silently fail. Call with |blocked| set to false to reenable. // calls will silently fail. Call with |blocked| set to false to reenable.
@@ -235,7 +229,6 @@ class PrintWebViewHelper @@ -236,7 +230,6 @@ class PrintWebViewHelper
const blink::WebNode& node, const blink::WebNode& node,
int* number_of_pages); int* number_of_pages);
@ -443,7 +443,7 @@ index 7232b22..d2833f8 100644
// Set options for print preset from source PDF document. // Set options for print preset from source PDF document.
bool SetOptionsFromPdfDocument( bool SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options); PrintHostMsg_SetOptionsFromDocument_Params* options);
@@ -246,7 +239,6 @@ class PrintWebViewHelper @@ -247,7 +240,6 @@ class PrintWebViewHelper
bool UpdatePrintSettings(blink::WebLocalFrame* frame, bool UpdatePrintSettings(blink::WebLocalFrame* frame,
const blink::WebNode& node, const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings); const base::DictionaryValue& passed_job_settings);
@ -451,7 +451,7 @@ index 7232b22..d2833f8 100644
// Get final print settings from the user. // Get final print settings from the user.
// Return false if the user cancels or on error. // Return false if the user cancels or on error.
@@ -321,7 +313,6 @@ class PrintWebViewHelper @@ -322,7 +314,6 @@ class PrintWebViewHelper
const PrintMsg_PrintPages_Params& params, const PrintMsg_PrintPages_Params& params,
int page_count); int page_count);
@ -459,7 +459,7 @@ index 7232b22..d2833f8 100644
// Given the |device| and |canvas| to draw on, prints the appropriate headers // Given the |device| and |canvas| to draw on, prints the appropriate headers
// and footers using strings from |header_footer_info| on to the canvas. // and footers using strings from |header_footer_info| on to the canvas.
static void PrintHeaderAndFooter(blink::WebCanvas* canvas, static void PrintHeaderAndFooter(blink::WebCanvas* canvas,
@@ -331,7 +322,6 @@ class PrintWebViewHelper @@ -332,7 +323,6 @@ class PrintWebViewHelper
float webkit_scale_factor, float webkit_scale_factor,
const PageSizeMargins& page_layout_in_points, const PageSizeMargins& page_layout_in_points,
const PrintMsg_Print_Params& params); const PrintMsg_Print_Params& params);
@ -467,7 +467,7 @@ index 7232b22..d2833f8 100644
bool GetPrintFrame(blink::WebLocalFrame** frame); bool GetPrintFrame(blink::WebLocalFrame** frame);
@@ -343,7 +333,6 @@ class PrintWebViewHelper @@ -344,7 +334,6 @@ class PrintWebViewHelper
bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame, bool IsScriptInitiatedPrintAllowed(blink::WebFrame* frame,
bool user_initiated); bool user_initiated);
@ -475,7 +475,7 @@ index 7232b22..d2833f8 100644
// Shows scripted print preview when options from plugin are available. // Shows scripted print preview when options from plugin are available.
void ShowScriptedPrintPreview(); void ShowScriptedPrintPreview();
@@ -359,7 +348,6 @@ class PrintWebViewHelper @@ -360,7 +349,6 @@ class PrintWebViewHelper
// |metafile| is the rendered page. Otherwise |metafile| is NULL. // |metafile| is the rendered page. Otherwise |metafile| is NULL.
// Returns true if print preview should continue, false on failure. // Returns true if print preview should continue, false on failure.
bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile); bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile);
@ -483,7 +483,7 @@ index 7232b22..d2833f8 100644
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
@@ -512,6 +500,7 @@ class PrintWebViewHelper @@ -513,6 +501,7 @@ class PrintWebViewHelper
ScriptingThrottler scripting_throttler_; ScriptingThrottler scripting_throttler_;
bool print_node_in_progress_; bool print_node_in_progress_;
@ -492,7 +492,7 @@ index 7232b22..d2833f8 100644
bool is_loading_; bool is_loading_;
bool is_scripted_preview_delayed_; bool is_scripted_preview_delayed_;
diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm diff --git printing/renderer/print_web_view_helper_mac.mm printing/renderer/print_web_view_helper_mac.mm
index 1d23d5b..e99373b 100644 index d227c5e..f362093 100644
--- printing/renderer/print_web_view_helper_mac.mm --- printing/renderer/print_web_view_helper_mac.mm
+++ printing/renderer/print_web_view_helper_mac.mm +++ printing/renderer/print_web_view_helper_mac.mm
@@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal( @@ -68,7 +68,6 @@ void PrintWebViewHelper::PrintPageInternal(
@ -503,7 +503,7 @@ index 1d23d5b..e99373b 100644
bool PrintWebViewHelper::RenderPreviewPage( bool PrintWebViewHelper::RenderPreviewPage(
int page_number, int page_number,
const PrintMsg_Print_Params& print_params) { const PrintMsg_Print_Params& print_params) {
@@ -104,7 +103,6 @@ bool PrintWebViewHelper::RenderPreviewPage( @@ -105,7 +104,6 @@ bool PrintWebViewHelper::RenderPreviewPage(
} }
return PreviewPageRendered(page_number, draft_metafile.get()); return PreviewPageRendered(page_number, draft_metafile.get());
} }
@ -511,7 +511,7 @@ index 1d23d5b..e99373b 100644
void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
int page_number, int page_number,
@@ -139,14 +137,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params, @@ -140,14 +138,12 @@ void PrintWebViewHelper::RenderPage(const PrintMsg_Print_Params& params,
MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile); MetafileSkiaWrapper::SetMetafileOnCanvas(*canvas, metafile);
skia::SetIsPreviewMetafile(*canvas, is_preview); skia::SetIsPreviewMetafile(*canvas, is_preview);

View File

@ -1,20 +1,20 @@
diff --git web_contents.cc web_contents.cc diff --git web_contents.cc web_contents.cc
index 69190cf..05d2250 100644 index fa0afb5..d677b31 100644
--- web_contents.cc --- web_contents.cc
+++ web_contents.cc +++ web_contents.cc
@@ -28,7 +28,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context, @@ -29,7 +29,9 @@ WebContents::CreateParams::CreateParams(BrowserContext* context,
initially_hidden(false),
guest_delegate(nullptr), guest_delegate(nullptr),
context(nullptr), context(nullptr),
- renderer_initiated_creation(false) {} renderer_initiated_creation(false),
+ renderer_initiated_creation(false), - initialize_renderer(false) {
+ initialize_renderer(false),
+ view(nullptr), + view(nullptr),
+ delegate_view(nullptr) {} + delegate_view(nullptr) {
}
WebContents::CreateParams::CreateParams(const CreateParams& other) = default; WebContents::CreateParams::CreateParams(const CreateParams& other) = default;
diff --git web_contents.h web_contents.h diff --git web_contents.h web_contents.h
index 6aa00e6..41223fa 100644 index 90b647e..9fcedc0 100644
--- web_contents.h --- web_contents.h
+++ web_contents.h +++ web_contents.h
@@ -55,8 +55,10 @@ class PageState; @@ -55,8 +55,10 @@ class PageState;
@ -28,10 +28,10 @@ index 6aa00e6..41223fa 100644
struct CustomContextMenuContext; struct CustomContextMenuContext;
struct DropData; struct DropData;
struct Manifest; struct Manifest;
@@ -149,6 +151,10 @@ class WebContents : public PageNavigator, @@ -157,6 +159,10 @@ class WebContents : public PageNavigator,
// RenderFrame, have already been created on the renderer side, and // Note that the pre-created renderer process may not be used if the first
// WebContents construction should take this into account. // navigation requires a dedicated or privileged process, such as a WebUI.
bool renderer_initiated_creation; bool initialize_renderer;
+ +
+ // Optionally specify the view and delegate view. + // Optionally specify the view and delegate view.
+ content::WebContentsView* view; + content::WebContentsView* view;
@ -55,7 +55,7 @@ index df97348..8e2168e 100644
} }
diff --git web_contents_delegate.h web_contents_delegate.h diff --git web_contents_delegate.h web_contents_delegate.h
index 74b56e1..b4dcb2a 100644 index 2816c4d..387821f 100644
--- web_contents_delegate.h --- web_contents_delegate.h
+++ web_contents_delegate.h +++ web_contents_delegate.h
@@ -42,9 +42,11 @@ class JavaScriptDialogManager; @@ -42,9 +42,11 @@ class JavaScriptDialogManager;

View File

@ -1,8 +1,8 @@
diff --git render_view_host_impl.h render_view_host_impl.h diff --git render_view_host_impl.h render_view_host_impl.h
index d54b2d7..c696c6f 100644 index 495ee21..952ddc8 100644
--- render_view_host_impl.h --- render_view_host_impl.h
+++ render_view_host_impl.h +++ render_view_host_impl.h
@@ -193,6 +193,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost, @@ -196,6 +196,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost,
void set_is_swapped_out(bool is_swapped_out) { void set_is_swapped_out(bool is_swapped_out) {
is_swapped_out_ = is_swapped_out; is_swapped_out_ = is_swapped_out;
} }

View File

@ -1,8 +1,8 @@
diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm diff --git render_widget_host_view_mac.mm render_widget_host_view_mac.mm
index 86481a9..e2e56c0 100644 index 68b3476..5fd78d0 100644
--- render_widget_host_view_mac.mm --- render_widget_host_view_mac.mm
+++ render_widget_host_view_mac.mm +++ render_widget_host_view_mac.mm
@@ -572,9 +572,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget, @@ -575,9 +575,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
// Paint this view host with |background_color_| when there is no content // Paint this view host with |background_color_| when there is no content
// ready to draw. // ready to draw.
background_layer_.reset([[CALayer alloc] init]); background_layer_.reset([[CALayer alloc] init]);

View File

@ -1,9 +1,9 @@
diff --git os_exchange_data_provider_aurax11.cc os_exchange_data_provider_aurax11.cc diff --git os_exchange_data_provider_aurax11.cc os_exchange_data_provider_aurax11.cc
index e2bba47..ea698fa3 100644 index 6048670..b37f4bf 100644
--- os_exchange_data_provider_aurax11.cc --- os_exchange_data_provider_aurax11.cc
+++ os_exchange_data_provider_aurax11.cc +++ os_exchange_data_provider_aurax11.cc
@@ -159,7 +159,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url, @@ -158,7 +158,8 @@ void OSExchangeDataProviderAuraX11::SetURL(const GURL& url,
format_map_.Insert(atom_cache_.GetAtom(kMimeTypeMozillaURL), mem); mem);
// Set a string fallback as well. // Set a string fallback as well.
- SetString(spec); - SetString(spec);

View File

@ -1,8 +1,8 @@
diff --git controls/button/menu_button.cc controls/button/menu_button.cc diff --git controls/button/menu_button.cc controls/button/menu_button.cc
index 3602b45..ec83c86 100644 index 20b3452..ec73e01 100644
--- controls/button/menu_button.cc --- controls/button/menu_button.cc
+++ controls/button/menu_button.cc +++ controls/button/menu_button.cc
@@ -199,7 +199,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) { @@ -195,7 +195,7 @@ void MenuButton::OnPaint(gfx::Canvas* canvas) {
gfx::Size MenuButton::GetPreferredSize() const { gfx::Size MenuButton::GetPreferredSize() const {
gfx::Size prefsize = LabelButton::GetPreferredSize(); gfx::Size prefsize = LabelButton::GetPreferredSize();
if (show_menu_marker_) { if (show_menu_marker_) {
@ -11,7 +11,7 @@ index 3602b45..ec83c86 100644
kMenuMarkerPaddingRight, kMenuMarkerPaddingRight,
0); 0);
} }
@@ -329,7 +329,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() { @@ -324,7 +324,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() {
gfx::Size s = size(); gfx::Size s = size();
if (show_menu_marker_) { if (show_menu_marker_) {
@ -20,7 +20,7 @@ index 3602b45..ec83c86 100644
kMenuMarkerPaddingRight); kMenuMarkerPaddingRight);
} }
@@ -415,4 +415,10 @@ int MenuButton::GetMaximumScreenXCoordinate() { @@ -412,4 +412,10 @@ int MenuButton::GetMaximumScreenXCoordinate() {
return monitor_bounds.right() - 1; return monitor_bounds.right() - 1;
} }

View File

@ -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 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 f65febf0..9ffc653 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc --- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ 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() { @@ -770,6 +770,13 @@ void RenderWidgetHostViewAura::SetKeyboardFocus() {
} }
} }
#endif #endif
@ -17,19 +17,19 @@ index c33e325c..04ad7d9 100644
if (host_ && set_focus_on_mouse_down_or_key_event_) { if (host_ && set_focus_on_mouse_down_or_key_event_) {
set_focus_on_mouse_down_or_key_event_ = false; set_focus_on_mouse_down_or_key_event_ = false;
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
index dd88fae..0aaaf78 100644 index c4b9d14..c8f8cb2 100644
--- content/browser/renderer_host/render_widget_host_view_base.cc --- content/browser/renderer_host/render_widget_host_view_base.cc
+++ content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc
@@ -40,6 +40,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase() @@ -42,6 +42,7 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
current_device_scale_factor_(0),
current_display_rotation_(display::Display::ROTATE_0), current_display_rotation_(display::Display::ROTATE_0),
pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
text_input_manager_(nullptr),
+ has_external_parent_(false), + has_external_parent_(false),
renderer_frame_number_(0), renderer_frame_number_(0),
weak_factory_(this) {} weak_factory_(this) {}
@@ -250,6 +251,10 @@ void RenderWidgetHostViewBase::EndFrameSubscription() { @@ -269,6 +270,10 @@ void RenderWidgetHostViewBase::FocusedNodeTouched(
NOTREACHED(); DVLOG(1) << "FocusedNodeTouched: " << editable;
} }
+void RenderWidgetHostViewBase::SetHasExternalParent(bool val) { +void RenderWidgetHostViewBase::SetHasExternalParent(bool val) {
@ -40,20 +40,20 @@ index dd88fae..0aaaf78 100644
return renderer_frame_number_; return renderer_frame_number_;
} }
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
index 8eb9689..d076b3b 100644 index 772dca1..d28c177 100644
--- content/browser/renderer_host/render_widget_host_view_base.h --- content/browser/renderer_host/render_widget_host_view_base.h
+++ content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h
@@ -97,6 +97,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -101,6 +101,7 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
void BeginFrameSubscription(
std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override;
void EndFrameSubscription() override; void EndFrameSubscription() override;
void FocusedNodeTouched(const gfx::Point& location_dips_screen,
bool editable) override;
+ void SetHasExternalParent(bool val) override; + void SetHasExternalParent(bool val) override;
// This only needs to be overridden by RenderWidgetHostViewBase subclasses // This only needs to be overridden by RenderWidgetHostViewBase subclasses
// that handle content embedded within other RenderWidgetHostViews. // that handle content embedded within other RenderWidgetHostViews.
@@ -423,6 +424,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -455,6 +456,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// renderer. // destroyed before the RWHV is destroyed.
bool pinch_zoom_enabled_; TextInputManager* text_input_manager_;
+ // True if the widget has a external parent view/window outside of the + // True if the widget has a external parent view/window outside of the
+ // Chromium-controlled view/window hierarchy. + // Chromium-controlled view/window hierarchy.
@ -63,12 +63,12 @@ index 8eb9689..d076b3b 100644
void FlushInput(); void FlushInput();
diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h
index b902288..932f398 100644 index 5ef49e4..d391b20 100644
--- content/public/browser/render_widget_host_view.h --- content/public/browser/render_widget_host_view.h
+++ content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h
@@ -160,6 +160,10 @@ class CONTENT_EXPORT RenderWidgetHostView { @@ -167,6 +167,10 @@ class CONTENT_EXPORT RenderWidgetHostView {
// deleted after this call. virtual void FocusedNodeTouched(const gfx::Point& location_dips_screen,
virtual void EndFrameSubscription() = 0; bool editable) = 0;
+ // Set whether the widget has a external parent view/window outside of the + // Set whether the widget has a external parent view/window outside of the
+ // Chromium-controlled view/window hierarchy. + // Chromium-controlled view/window hierarchy.
@ -91,7 +91,7 @@ index f772f64..7d13f9f 100644
return host ? host->GetAcceleratedWidget() : NULL; return host ? host->GetAcceleratedWidget() : NULL;
} }
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index 7591042..ea6b52c 100644 index fd8de8f..e7750f7 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -86,6 +86,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( @@ -86,6 +86,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin(
@ -116,7 +116,7 @@ index 7591042..ea6b52c 100644
remove_standard_frame_ = params.remove_standard_frame; remove_standard_frame_ = params.remove_standard_frame;
has_non_client_view_ = Widget::RequiresNonClientView(params.type); has_non_client_view_ = Widget::RequiresNonClientView(params.type);
@@ -642,6 +647,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const { @@ -641,6 +646,10 @@ bool DesktopWindowTreeHostWin::CanActivate() const {
return native_widget_delegate_->CanActivate(); return native_widget_delegate_->CanActivate();
} }
@ -127,7 +127,7 @@ index 7591042..ea6b52c 100644
bool DesktopWindowTreeHostWin::WantsMouseEventsWhenInactive() const { bool DesktopWindowTreeHostWin::WantsMouseEventsWhenInactive() const {
return wants_mouse_events_when_inactive_; return wants_mouse_events_when_inactive_;
} }
@@ -822,11 +831,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { @@ -821,11 +830,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
} }
void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
@ -146,7 +146,7 @@ index 7591042..ea6b52c 100644
bool DesktopWindowTreeHostWin::HandleMouseEvent(const ui::MouseEvent& event) { bool DesktopWindowTreeHostWin::HandleMouseEvent(const ui::MouseEvent& event) {
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
index f357a5c..173d64d 100644 index e568375..6865670 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
@@ -137,6 +137,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin @@ -137,6 +137,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
@ -169,10 +169,10 @@ index f357a5c..173d64d 100644
// a reference. // a reference.
corewm::TooltipWin* tooltip_; corewm::TooltipWin* tooltip_;
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index f792797..417d965 100644 index 586d36d..76c8f1e 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -170,6 +170,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -174,6 +174,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
use_native_frame_(false), use_native_frame_(false),
should_maximize_after_map_(false), should_maximize_after_map_(false),
use_argb_visual_(false), use_argb_visual_(false),
@ -180,7 +180,7 @@ index f792797..417d965 100644
drag_drop_client_(NULL), drag_drop_client_(NULL),
native_widget_delegate_(native_widget_delegate), native_widget_delegate_(native_widget_delegate),
desktop_native_widget_aura_(desktop_native_widget_aura), desktop_native_widget_aura_(desktop_native_widget_aura),
@@ -178,7 +179,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -182,7 +183,8 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
custom_window_shape_(false), custom_window_shape_(false),
urgency_hint_set_(false), urgency_hint_set_(false),
activatable_(true), activatable_(true),
@ -190,7 +190,7 @@ index f792797..417d965 100644
} }
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() { DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
@@ -389,7 +391,8 @@ void DesktopWindowTreeHostX11::CloseNow() { @@ -392,7 +394,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
// Actually free our native resources. // Actually free our native resources.
if (ui::PlatformEventSource::GetInstance()) if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
@ -200,7 +200,7 @@ index f792797..417d965 100644
xwindow_ = None; xwindow_ = None;
desktop_native_widget_aura_->OnHostClosed(); desktop_native_widget_aura_->OnHostClosed();
@@ -538,6 +541,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( @@ -541,6 +544,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
} }
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
@ -209,7 +209,7 @@ index f792797..417d965 100644
return ToDIPRect(bounds_in_pixels_); return ToDIPRect(bounds_in_pixels_);
} }
@@ -982,6 +987,8 @@ void DesktopWindowTreeHostX11::HideImpl() { @@ -986,6 +991,8 @@ void DesktopWindowTreeHostX11::HideImpl() {
} }
gfx::Rect DesktopWindowTreeHostX11::GetBounds() const { gfx::Rect DesktopWindowTreeHostX11::GetBounds() const {
@ -218,7 +218,7 @@ index f792797..417d965 100644
return bounds_in_pixels_; return bounds_in_pixels_;
} }
@@ -1039,6 +1046,8 @@ void DesktopWindowTreeHostX11::SetBounds( @@ -1043,6 +1050,8 @@ void DesktopWindowTreeHostX11::SetBounds(
} }
gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const { gfx::Point DesktopWindowTreeHostX11::GetLocationOnNativeScreen() const {
@ -227,7 +227,7 @@ index f792797..417d965 100644
return bounds_in_pixels_.origin(); return bounds_in_pixels_.origin();
} }
@@ -1147,9 +1156,15 @@ void DesktopWindowTreeHostX11::InitX11Window( @@ -1151,9 +1160,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
use_argb_visual_ = true; use_argb_visual_ = true;
} }
@ -244,7 +244,7 @@ index f792797..417d965 100644
bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.y(), bounds_in_pixels_.width(),
bounds_in_pixels_.height(), bounds_in_pixels_.height(),
0, // border width 0, // border width
@@ -1771,6 +1786,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( @@ -1784,6 +1799,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
} }
break; break;
} }
@ -256,7 +256,7 @@ index f792797..417d965 100644
if (xev->xfocus.mode != NotifyGrab) { if (xev->xfocus.mode != NotifyGrab) {
ReleaseCapture(); ReleaseCapture();
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
index 6a963f8..6cf5c02 100644 index fa262f1..78a4aba 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -86,6 +86,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -86,6 +86,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
@ -272,7 +272,7 @@ index 6a963f8..6cf5c02 100644
protected: protected:
// Overridden from DesktopWindowTreeHost: // Overridden from DesktopWindowTreeHost:
void Init(aura::Window* content_window, void Init(aura::Window* content_window,
@@ -263,6 +269,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -266,6 +272,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// The bounds of |xwindow_|. // The bounds of |xwindow_|.
gfx::Rect bounds_in_pixels_; gfx::Rect bounds_in_pixels_;
@ -282,7 +282,7 @@ index 6a963f8..6cf5c02 100644
// Whenever the bounds are set, we keep the previous set of bounds around so // Whenever the bounds are set, we keep the previous set of bounds around so
// we can have a better chance of getting the real // we can have a better chance of getting the real
// |restored_bounds_in_pixels_|. Window managers tend to send a Configure // |restored_bounds_in_pixels_|. Window managers tend to send a Configure
@@ -299,6 +308,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -302,6 +311,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Whether we used an ARGB visual for our window. // Whether we used an ARGB visual for our window.
bool use_argb_visual_; bool use_argb_visual_;
@ -293,7 +293,7 @@ index 6a963f8..6cf5c02 100644
DesktopDragDropClientAuraX11* drag_drop_client_; DesktopDragDropClientAuraX11* drag_drop_client_;
std::unique_ptr<ui::EventHandler> x11_non_client_event_filter_; std::unique_ptr<ui::EventHandler> x11_non_client_event_filter_;
@@ -351,6 +364,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -354,6 +367,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_;
@ -365,7 +365,7 @@ index 8ec4b1e..587e4e3 100644
x_active_window_ = None; x_active_window_ = None;
} }
diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc
index a86fe48..8ec377d 100644 index 62b4b56..5fe4bd0 100644
--- ui/views/widget/widget.cc --- ui/views/widget/widget.cc
+++ ui/views/widget/widget.cc +++ ui/views/widget/widget.cc
@@ -126,9 +126,11 @@ Widget::InitParams::InitParams(Type type) @@ -126,9 +126,11 @@ Widget::InitParams::InitParams(Type type)
@ -413,7 +413,7 @@ index a86fe48..8ec377d 100644
// This must come after SetContentsView() or it might not be able to find // This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492 // the correct NativeTheme (on Linux). See http://crbug.com/384492
diff --git ui/views/widget/widget.h ui/views/widget/widget.h diff --git ui/views/widget/widget.h ui/views/widget/widget.h
index e52c7ff..57e466c 100644 index 0376866..7901ea4 100644
--- ui/views/widget/widget.h --- ui/views/widget/widget.h
+++ ui/views/widget/widget.h +++ ui/views/widget/widget.h
@@ -238,12 +238,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -238,12 +238,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
@ -473,10 +473,10 @@ index b843416..8b81a51 100644
} }
case Widget::InitParams::TYPE_CONTROL: case Widget::InitParams::TYPE_CONTROL:
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
index 921b838..954d426 100644 index d8c14ee..ca22040 100644
--- ui/views/win/hwnd_message_handler.cc --- ui/views/win/hwnd_message_handler.cc
+++ ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc
@@ -852,6 +852,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() { @@ -855,6 +855,8 @@ void HWNDMessageHandler::SizeConstraintsChanged() {
} else { } else {
style &= ~WS_MINIMIZEBOX; style &= ~WS_MINIMIZEBOX;
} }
@ -485,7 +485,7 @@ index 921b838..954d426 100644
SetWindowLong(hwnd(), GWL_STYLE, style); SetWindowLong(hwnd(), GWL_STYLE, style);
} }
@@ -2503,8 +2505,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, @@ -2500,8 +2502,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
active_mouse_tracking_flags_ = 0; active_mouse_tracking_flags_ = 0;
} else if (event.type() == ui::ET_MOUSEWHEEL) { } else if (event.type() == ui::ET_MOUSEWHEEL) {
// Reroute the mouse wheel to the window under the pointer if applicable. // Reroute the mouse wheel to the window under the pointer if applicable.

View File

@ -1,8 +1,8 @@
diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp diff --git Source/web/ChromeClientImpl.cpp Source/web/ChromeClientImpl.cpp
index ab5b0e7..c977d57 100644 index f3d796c..bc0ee90 100644
--- Source/web/ChromeClientImpl.cpp --- Source/web/ChromeClientImpl.cpp
+++ Source/web/ChromeClientImpl.cpp +++ Source/web/ChromeClientImpl.cpp
@@ -880,7 +880,7 @@ bool ChromeClientImpl::hasOpenedPopup() const @@ -881,7 +881,7 @@ bool ChromeClientImpl::hasOpenedPopup() const
PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select) PopupMenu* ChromeClientImpl::openPopupMenu(LocalFrame& frame, HTMLSelectElement& select)
{ {
notifyPopupOpeningObservers(); notifyPopupOpeningObservers();
@ -12,10 +12,10 @@ index ab5b0e7..c977d57 100644
DCHECK(RuntimeEnabledFeatures::pagePopupEnabled()); DCHECK(RuntimeEnabledFeatures::pagePopupEnabled());
diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp diff --git Source/web/WebViewImpl.cpp Source/web/WebViewImpl.cpp
index 218f70f..24824fd 100644 index 3df57d6..07c2307 100644
--- Source/web/WebViewImpl.cpp --- Source/web/WebViewImpl.cpp
+++ Source/web/WebViewImpl.cpp +++ Source/web/WebViewImpl.cpp
@@ -415,6 +415,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) @@ -419,6 +419,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_enableFakePageScaleAnimationForTesting(false) , m_enableFakePageScaleAnimationForTesting(false)
, m_fakePageScaleAnimationPageScaleFactor(0) , m_fakePageScaleAnimationPageScaleFactor(0)
, m_fakePageScaleAnimationUseAnchor(false) , m_fakePageScaleAnimationUseAnchor(false)
@ -23,7 +23,7 @@ index 218f70f..24824fd 100644
, m_doingDragAndDrop(false) , m_doingDragAndDrop(false)
, m_ignoreInputEvents(false) , m_ignoreInputEvents(false)
, m_compositorDeviceScaleFactorOverride(0) , m_compositorDeviceScaleFactorOverride(0)
@@ -4072,9 +4073,14 @@ void WebViewImpl::pageScaleFactorChanged() @@ -4110,9 +4111,14 @@ void WebViewImpl::pageScaleFactorChanged()
m_client->pageScaleFactorChanged(); m_client->pageScaleFactorChanged();
} }
@ -40,10 +40,10 @@ index 218f70f..24824fd 100644
void WebViewImpl::startDragging(LocalFrame* frame, void WebViewImpl::startDragging(LocalFrame* frame,
diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h diff --git Source/web/WebViewImpl.h Source/web/WebViewImpl.h
index 3015ed1..0eb5455 100644 index 716e264..9726e8f 100644
--- Source/web/WebViewImpl.h --- Source/web/WebViewImpl.h
+++ Source/web/WebViewImpl.h +++ Source/web/WebViewImpl.h
@@ -383,7 +383,8 @@ public: @@ -387,7 +387,8 @@ public:
// Returns true if popup menus should be rendered by the browser, false if // Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default). // they should be rendered by WebKit (which is the default).
@ -53,7 +53,7 @@ index 3015ed1..0eb5455 100644
bool shouldAutoResize() const bool shouldAutoResize() const
{ {
@@ -672,6 +673,8 @@ private: @@ -673,6 +674,8 @@ private:
float m_fakePageScaleAnimationPageScaleFactor; float m_fakePageScaleAnimationPageScaleFactor;
bool m_fakePageScaleAnimationUseAnchor; bool m_fakePageScaleAnimationUseAnchor;
@ -63,10 +63,10 @@ index 3015ed1..0eb5455 100644
bool m_ignoreInputEvents; bool m_ignoreInputEvents;
diff --git public/web/WebView.h public/web/WebView.h diff --git public/web/WebView.h public/web/WebView.h
index d25040c..67a9a1a 100644 index bca14ae..10b7ff6 100644
--- public/web/WebView.h --- public/web/WebView.h
+++ public/web/WebView.h +++ public/web/WebView.h
@@ -443,6 +443,7 @@ public: @@ -445,6 +445,7 @@ public:
// Sets whether select popup menus should be rendered by the browser. // Sets whether select popup menus should be rendered by the browser.
BLINK_EXPORT static void setUseExternalPopupMenus(bool); BLINK_EXPORT static void setUseExternalPopupMenus(bool);

View File

@ -500,7 +500,9 @@ void TestChangeDirectory(CefRefPtr<CefCookieManager> manager,
// Test creation of a domain cookie. // Test creation of a domain cookie.
TEST(CookieTest, DomainCookieGlobal) { TEST(CookieTest, DomainCookieGlobal) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event));
@ -512,7 +514,9 @@ TEST(CookieTest, DomainCookieGlobal) {
// Test creation of a domain cookie. // Test creation of a domain cookie.
TEST(CookieTest, DomainCookieInMemory) { TEST(CookieTest, DomainCookieInMemory) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(CefString(), false, CefCookieManager::CreateManager(CefString(), false,
@ -530,7 +534,9 @@ TEST(CookieTest, DomainCookieOnDisk) {
// Create a new temporary directory. // Create a new temporary directory.
EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false, CefCookieManager::CreateManager(temp_dir.path().value(), false,
@ -548,7 +554,9 @@ TEST(CookieTest, DomainCookieOnDisk) {
// Test creation of a host cookie. // Test creation of a host cookie.
TEST(CookieTest, HostCookieGlobal) { TEST(CookieTest, HostCookieGlobal) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event));
@ -560,7 +568,9 @@ TEST(CookieTest, HostCookieGlobal) {
// Test creation of a host cookie. // Test creation of a host cookie.
TEST(CookieTest, HostCookieInMemory) { TEST(CookieTest, HostCookieInMemory) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(CefString(), false, CefCookieManager::CreateManager(CefString(), false,
@ -578,7 +588,9 @@ TEST(CookieTest, HostCookieOnDisk) {
// Create a new temporary directory. // Create a new temporary directory.
EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false, CefCookieManager::CreateManager(temp_dir.path().value(), false,
@ -596,7 +608,9 @@ TEST(CookieTest, HostCookieOnDisk) {
// Test creation of multiple cookies. // Test creation of multiple cookies.
TEST(CookieTest, MultipleCookiesGlobal) { TEST(CookieTest, MultipleCookiesGlobal) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event));
@ -608,7 +622,9 @@ TEST(CookieTest, MultipleCookiesGlobal) {
// Test creation of multiple cookies. // Test creation of multiple cookies.
TEST(CookieTest, MultipleCookiesInMemory) { TEST(CookieTest, MultipleCookiesInMemory) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(CefString(), false, CefCookieManager::CreateManager(CefString(), false,
@ -626,7 +642,9 @@ TEST(CookieTest, MultipleCookiesOnDisk) {
// Create a new temporary directory. // Create a new temporary directory.
EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false, CefCookieManager::CreateManager(temp_dir.path().value(), false,
@ -643,7 +661,9 @@ TEST(CookieTest, MultipleCookiesOnDisk) {
} }
TEST(CookieTest, AllCookiesGlobal) { TEST(CookieTest, AllCookiesGlobal) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event));
@ -654,7 +674,9 @@ TEST(CookieTest, AllCookiesGlobal) {
} }
TEST(CookieTest, AllCookiesInMemory) { TEST(CookieTest, AllCookiesInMemory) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(CefString(), false, CefCookieManager::CreateManager(CefString(), false,
@ -671,7 +693,9 @@ TEST(CookieTest, AllCookiesOnDisk) {
// Create a new temporary directory. // Create a new temporary directory.
EXPECT_TRUE(temp_dir.CreateUniqueTempDir()); EXPECT_TRUE(temp_dir.CreateUniqueTempDir());
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(temp_dir.path().value(), false, CefCookieManager::CreateManager(temp_dir.path().value(), false,
@ -688,7 +712,9 @@ TEST(CookieTest, AllCookiesOnDisk) {
} }
TEST(CookieTest, ChangeDirectoryGlobal) { TEST(CookieTest, ChangeDirectoryGlobal) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event)); CefCookieManager::GetGlobalManager(new TestCompletionCallback(&event));
@ -702,7 +728,9 @@ TEST(CookieTest, ChangeDirectoryGlobal) {
} }
TEST(CookieTest, ChangeDirectoryCreated) { TEST(CookieTest, ChangeDirectoryCreated) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefCookieManager> manager = CefRefPtr<CefCookieManager> manager =
CefCookieManager::CreateManager(CefString(), false, CefCookieManager::CreateManager(CefString(), false,
@ -715,7 +743,9 @@ TEST(CookieTest, ChangeDirectoryCreated) {
TEST(CookieTest, SessionCookieNoPersist) { TEST(CookieTest, SessionCookieNoPersist) {
base::ScopedTempDir temp_dir; base::ScopedTempDir temp_dir;
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefCookie cookie; CefCookie cookie;
// Create a new temporary directory. // Create a new temporary directory.
@ -749,7 +779,9 @@ TEST(CookieTest, SessionCookieNoPersist) {
TEST(CookieTest, SessionCookieWillPersist) { TEST(CookieTest, SessionCookieWillPersist) {
base::ScopedTempDir temp_dir; base::ScopedTempDir temp_dir;
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefCookie cookie; CefCookie cookie;
// Create a new temporary directory. // Create a new temporary directory.
@ -894,7 +926,9 @@ class CookieTestJSHandler : public TestHandler {
const std::string& name, const std::string& name,
const std::string& value, const std::string& value,
TrackCallback& callback) { TrackCallback& callback) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CookieVector cookies; CookieVector cookies;
// Get the cookie. // Get the cookie.
@ -1170,7 +1204,9 @@ class CookieTestSchemeHandler : public TestHandler {
const std::string& name, const std::string& name,
const std::string& value, const std::string& value,
TrackCallback& callback) { TrackCallback& callback) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CookieVector cookies; CookieVector cookies;
// Get the cookie. // Get the cookie.

View File

@ -210,7 +210,9 @@ private:
} // namespace } // namespace
TEST(GeolocationTest, GetGeolocation) { TEST(GeolocationTest, GetGeolocation) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefGetGeolocation(new TestGetGeolocationCallback(&event)); CefGetGeolocation(new TestGetGeolocationCallback(&event));
event.Wait(); event.Wait();
} }

View File

@ -73,7 +73,7 @@ const CefRect kExpectedRectLI[] = {
const CefRect kEditBoxRect(412, 245, 60, 22); const CefRect kEditBoxRect(412, 245, 60, 22);
const CefRect kNavigateButtonRect(360, 271, 140, 22); const CefRect kNavigateButtonRect(360, 271, 140, 22);
const CefRect kSelectRect(467, 22, 75, 20); const CefRect kSelectRect(467, 22, 75, 20);
const CefRect kExpandedSelectRect(463, 42, 81, 342); const CefRect kExpandedSelectRect(463, 47, 81, 342);
const CefRect kDropDivRect(8, 332, 52, 52); const CefRect kDropDivRect(8, 332, 52, 52);
const CefRect kDragDivRect(71, 342, 30, 30); const CefRect kDragDivRect(71, 342, 30, 30);
const int kDefaultVerticalScrollbarWidth = 17; const int kDefaultVerticalScrollbarWidth = 17;
@ -82,14 +82,14 @@ const int kVerticalScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL);
const CefRect kEditBoxRect(442, 251, 46, 16); const CefRect kEditBoxRect(442, 251, 46, 16);
const CefRect kNavigateButtonRect(375, 275, 130, 20); const CefRect kNavigateButtonRect(375, 275, 130, 20);
const CefRect kSelectRect(461, 21, 87, 26); const CefRect kSelectRect(461, 21, 87, 26);
const CefRect kExpandedSelectRect(463, 42, 78, 286); const CefRect kExpandedSelectRect(463, 42, 75, 286);
const CefRect kDropDivRect(9, 330, 52, 52); const CefRect kDropDivRect(9, 330, 52, 52);
const CefRect kDragDivRect(60, 330, 52, 52); const CefRect kDragDivRect(60, 330, 52, 52);
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
const CefRect kEditBoxRect(434, 246, 60, 20); const CefRect kEditBoxRect(434, 246, 60, 20);
const CefRect kNavigateButtonRect(380, 271, 140, 22); const CefRect kNavigateButtonRect(380, 271, 140, 22);
const CefRect kSelectRect(467, 22, 75, 20); const CefRect kSelectRect(467, 22, 75, 20);
const CefRect kExpandedSelectRect(463, 42, 81, 342); const CefRect kExpandedSelectRect(463, 47, 81, 342);
const CefRect kDropDivRect(8, 332, 52, 52); const CefRect kDropDivRect(8, 332, 52, 52);
const CefRect kDragDivRect(71, 342, 30, 30); const CefRect kDragDivRect(71, 342, 30, 30);
const int kDefaultVerticalScrollbarWidth = 14; const int kDefaultVerticalScrollbarWidth = 14;

View File

@ -402,7 +402,9 @@ class TestRequestContextHandler : public CefRequestContextHandler {
// Verify default preference values on the global context. // Verify default preference values on the global context.
TEST(PreferenceTest, GlobalDefaults) { TEST(PreferenceTest, GlobalDefaults) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefRequestContext> context = CefRequestContext::GetGlobalContext(); CefRefPtr<CefRequestContext> context = CefRequestContext::GetGlobalContext();
EXPECT_TRUE(context.get()); EXPECT_TRUE(context.get());
@ -413,7 +415,9 @@ TEST(PreferenceTest, GlobalDefaults) {
// Verify setting/getting preference values on the global context. // Verify setting/getting preference values on the global context.
TEST(PreferenceTest, GlobalSetGet) { TEST(PreferenceTest, GlobalSetGet) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefRequestContext> context = CefRequestContext::GetGlobalContext(); CefRefPtr<CefRequestContext> context = CefRequestContext::GetGlobalContext();
EXPECT_TRUE(context.get()); EXPECT_TRUE(context.get());
@ -428,7 +432,9 @@ TEST(PreferenceTest, GlobalSetGet) {
// Verify setting/getting preference values on shared global contexts. // Verify setting/getting preference values on shared global contexts.
TEST(PreferenceTest, GlobalSetGetShared) { TEST(PreferenceTest, GlobalSetGetShared) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRefPtr<CefRequestContext> context = CefRequestContext::GetGlobalContext(); CefRefPtr<CefRequestContext> context = CefRequestContext::GetGlobalContext();
EXPECT_TRUE(context.get()); EXPECT_TRUE(context.get());
@ -470,7 +476,9 @@ TEST(PreferenceTest, GlobalSetGetShared) {
// Verify default preference values on a custom context. // Verify default preference values on a custom context.
TEST(PreferenceTest, CustomDefaults) { TEST(PreferenceTest, CustomDefaults) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRequestContextSettings settings; CefRequestContextSettings settings;
CefRefPtr<CefRequestContext> context = CefRefPtr<CefRequestContext> context =
@ -483,7 +491,9 @@ TEST(PreferenceTest, CustomDefaults) {
// Verify setting/getting preference values on a custom context. // Verify setting/getting preference values on a custom context.
TEST(PreferenceTest, CustomSetGet) { TEST(PreferenceTest, CustomSetGet) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);;
CefRequestContextSettings settings; CefRequestContextSettings settings;
CefRefPtr<CefRequestContext> context = CefRefPtr<CefRequestContext> context =
@ -500,7 +510,9 @@ TEST(PreferenceTest, CustomSetGet) {
// Verify setting/getting preference values on shared custom contexts. // Verify setting/getting preference values on shared custom contexts.
TEST(PreferenceTest, CustomSetGetShared) { TEST(PreferenceTest, CustomSetGetShared) {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefRequestContextSettings settings; CefRequestContextSettings settings;
CefRefPtr<CefRequestContext> context = CefRefPtr<CefRequestContext> context =

View File

@ -100,7 +100,8 @@ class TestBrowserViewDelegate : public CefBrowserViewDelegate {
TestHandler::CompletionState::CompletionState(int total) TestHandler::CompletionState::CompletionState(int total)
: total_(total), : total_(total),
count_(0), count_(0),
event_(true, false) { event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED) {
} }
void TestHandler::CompletionState::TestComplete() { void TestHandler::CompletionState::TestComplete() {

View File

@ -301,7 +301,9 @@ class TestHandler : public CefClient,
// all Handler references have been released on test completion. // all Handler references have been released on test completion.
template<typename T> template<typename T>
void ReleaseAndWaitForDestructor(CefRefPtr<T>& handler, int delay_ms = 2000) { void ReleaseAndWaitForDestructor(CefRefPtr<T>& handler, int delay_ms = 2000) {
base::WaitableEvent event(true, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
handler->SetDestroyEvent(&event); handler->SetDestroyEvent(&event);
T* _handler_ptr = handler.get(); T* _handler_ptr = handler.get();
handler = NULL; handler = NULL;

View File

@ -11,13 +11,17 @@ void SignalEvent(base::WaitableEvent* event) {
} }
void WaitForThread(CefThreadId thread_id) { void WaitForThread(CefThreadId thread_id) {
base::WaitableEvent event(true, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
CefPostTask(thread_id, base::Bind(SignalEvent, &event)); CefPostTask(thread_id, base::Bind(SignalEvent, &event));
event.Wait(); event.Wait();
} }
void WaitForThread(CefRefPtr<CefTaskRunner> task_runner) { void WaitForThread(CefRefPtr<CefTaskRunner> task_runner) {
base::WaitableEvent event(true, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
task_runner->PostTask(CefCreateClosureTask(base::Bind(SignalEvent, &event))); task_runner->PostTask(CefCreateClosureTask(base::Bind(SignalEvent, &event)));
event.Wait(); event.Wait();
} }

View File

@ -37,7 +37,9 @@ void RunOnThread(CefThreadId thread_id,
#define NAMED_THREAD_TEST(thread_id, test_case_name, test_name) \ #define NAMED_THREAD_TEST(thread_id, test_case_name, test_name) \
TEST(test_case_name, test_name) { \ TEST(test_case_name, test_name) { \
base::WaitableEvent event(false, false); \ base::WaitableEvent event( \
base::WaitableEvent::ResetPolicy::AUTOMATIC, \
base::WaitableEvent::InitialState::NOT_SIGNALED); \
RunOnThread(thread_id, base::Bind(test_name##Impl), &event); \ RunOnThread(thread_id, base::Bind(test_name##Impl), &event); \
event.Wait(); \ event.Wait(); \
} }
@ -55,7 +57,9 @@ void RunOnThreadAsync(
#define NAMED_THREAD_TEST_ASYNC(thread_id, test_case_name, test_name) \ #define NAMED_THREAD_TEST_ASYNC(thread_id, test_case_name, test_name) \
TEST(test_case_name, test_name) { \ TEST(test_case_name, test_name) { \
base::WaitableEvent event(false, false); \ base::WaitableEvent event( \
base::WaitableEvent::ResetPolicy::AUTOMATIC, \
base::WaitableEvent::InitialState::NOT_SIGNALED); \
RunOnThreadAsync(thread_id, base::Bind(test_name##Impl), &event); \ RunOnThreadAsync(thread_id, base::Bind(test_name##Impl), &event); \
event.Wait(); \ event.Wait(); \
} }

View File

@ -74,7 +74,8 @@ class TracingTestHandler : public CefEndTracingCallback,
public CefCompletionCallback { public CefCompletionCallback {
public: public:
TracingTestHandler(TracingTestType type, const char* trace_type) TracingTestHandler(TracingTestType type, const char* trace_type)
: completion_event_(true, false), : completion_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED),
trace_type_(trace_type), trace_type_(trace_type),
type_(type) { type_(type) {
} }

View File

@ -1040,7 +1040,9 @@ class RequestTestHandler : public TestHandler,
// register any scheme handlers. // register any scheme handlers.
test_runner_->SetupTest(test_mode_); test_runner_->SetupTest(test_mode_);
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
SetTestCookie(test_runner_->GetRequestContext(), &event); SetTestCookie(test_runner_->GetRequestContext(), &event);
if (test_in_browser_) { if (test_in_browser_) {
@ -1094,7 +1096,9 @@ class RequestTestHandler : public TestHandler,
} }
void DestroyTest(const RequestRunSettings& settings) override { void DestroyTest(const RequestRunSettings& settings) override {
base::WaitableEvent event(false, false); base::WaitableEvent event(
base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
bool has_save_cookie = false; bool has_save_cookie = false;
GetTestCookie(test_runner_->GetRequestContext(), &event, &has_save_cookie); GetTestCookie(test_runner_->GetRequestContext(), &event, &has_save_cookie);
@ -1244,7 +1248,8 @@ namespace {
class InvalidURLTestClient : public CefURLRequestClient { class InvalidURLTestClient : public CefURLRequestClient {
public: public:
InvalidURLTestClient() InvalidURLTestClient()
: event_(false, false) { : event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED) {
} }
void RunTest() { void RunTest() {