Commit 8aac2338 authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision cb947c01 (#352221)

- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle
  instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest
  object passed to OnBeforeBrowse will no longer have an associated request
  identifier.
- Mac: Remove additional helper apps which are no longer required (see
  http://crbug.com/520680)
- Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see
  http://crbug.com/517114)
- Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and
  NPAPI plugins are no longer supported (see http://crbug.com/470301#c11)
- Add CefFormatUrlForSecurityDisplay function in cef_parser.h
- Fix crash when passing `--disable-extensions` command-line flag (issue #1721)
- Linux: Fix NSS handler loading (issue #1727)
parent 5780ea8b
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': '788460a4da28f888f290def06948d35bf7219235',
'chromium_checkout': 'cb947c0153db0ec02a8abbcb3ca086d88bf6006f',
}
......@@ -7,7 +7,6 @@
'pkg-config': 'pkg-config',
'chromium_code': 1,
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/cef',
'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html',
'framework_name': 'Chromium Embedded Framework',
'commit_number': '<!(python tools/commit_number.py)',
'chrome_version': '<!(python ../build/util/version.py -f ../chrome/VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
......@@ -153,22 +152,6 @@
'action': ['../build/mac/tweak_info_plist.py',
'--scm=1'],
},
{
# This postbuid step is responsible for creating the following
# helpers:
#
# cefclient Helper EH.app and cefclient Helper NP.app are created
# from cefclient Helper.app.
#
# The EH helper is marked for an executable heap. The NP helper
# is marked for no PIE (ASLR).
'postbuild_name': 'Make More Helpers',
'action': [
'../build/mac/make_more_helpers.sh',
'Frameworks',
'cefclient',
],
},
],
'link_settings': {
'libraries': [
......@@ -337,22 +320,6 @@
'action': ['../build/mac/tweak_info_plist.py',
'--scm=1'],
},
{
# This postbuid step is responsible for creating the following
# helpers:
#
# cefsimple Helper EH.app and cefsimple Helper NP.app are created
# from cefsimple Helper.app.
#
# The EH helper is marked for an executable heap. The NP helper
# is marked for no PIE (ASLR).
'postbuild_name': 'Make More Helpers',
'action': [
'../build/mac/make_more_helpers.sh',
'Frameworks',
'cefsimple',
],
},
],
'link_settings': {
'libraries': [
......@@ -558,22 +525,6 @@
'action': ['../build/mac/tweak_info_plist.py',
'--scm=1'],
},
{
# This postbuid step is responsible for creating the following
# helpers:
#
# cefclient Helper EH.app and cefclient Helper NP.app are created
# from cefclient Helper.app.
#
# The EH helper is marked for an executable heap. The NP helper
# is marked for no PIE (ASLR).
'postbuild_name': 'Make More Helpers',
'action': [
'../build/mac/make_more_helpers.sh',
'Frameworks',
'cef_unittests',
],
},
],
'link_settings': {
'libraries': [
......@@ -687,47 +638,15 @@
},
],
},
{
'target_name': 'about_credits',
'type': 'none',
'actions': [
{
'variables': {
'generator_path': '../tools/licenses.py',
},
'action_name': 'generate_about_credits',
'inputs': [
# TODO(phajdan.jr): make licenses.py print inputs too.
'<(generator_path)',
],
'outputs': [
'<(about_credits_file)',
],
'hard_dependency': 1,
'action': ['python',
'<(generator_path)',
'credits',
'<(about_credits_file)',
],
'message': 'Generating about:credits.',
},
],
},
{
# Create the pack file for CEF resources.
'target_name': 'cef_resources',
'type': 'none',
'dependencies': [
'about_credits',
],
'actions': [
{
'action_name': 'cef_resources',
'variables': {
'grit_grd_file': 'libcef/resources/cef_resources.grd',
'grit_additional_defines': [
'-E', 'about_credits_file=<(about_credits_file)',
],
},
'includes': [ '../build/grit_action.gypi' ],
},
......@@ -931,9 +850,9 @@
'<(DEPTH)/cef/libcef/resources/grit_stub',
'<(DEPTH)/cef/libcef/resources/grit_stub/chrome',
'<(grit_out_dir)',
'<(SHARED_INTERMEDIATE_DIR)/components',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources',
'<(SHARED_INTERMEDIATE_DIR)/ui/strings',
'<(SHARED_INTERMEDIATE_DIR)/webkit',
],
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
......@@ -951,6 +870,7 @@
'<(DEPTH)/components/components.gyp:content_settings_core_common',
'<(DEPTH)/components/components.gyp:crash_component_breakpad_mac_to_be_deleted',
'<(DEPTH)/components/components.gyp:crx_file',
'<(DEPTH)/components/components.gyp:data_use_measurement_core',
'<(DEPTH)/components/components.gyp:devtools_discovery',
'<(DEPTH)/components/components.gyp:devtools_http_handler',
'<(DEPTH)/components/components.gyp:keyed_service_content',
......@@ -1301,10 +1221,6 @@
# Include sources for proxy support.
'<(DEPTH)/base/prefs/testing_pref_store.cc',
'<(DEPTH)/base/prefs/testing_pref_store.h',
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker.cc',
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker.h',
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.cc',
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.h',
'<(DEPTH)/chrome/browser/net/proxy_service_factory.cc',
'<(DEPTH)/chrome/browser/net/proxy_service_factory.h',
'<(DEPTH)/chrome/browser/net/utility_process_mojo_proxy_resolver_factory.cc',
......
......@@ -176,7 +176,8 @@ typedef struct _cef_frame_t {
cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self);
///
// Returns the globally unique identifier for this frame.
// Returns the globally unique identifier for this frame or < 0 if the
// underlying frame does not yet exist.
///
int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self);
......
......@@ -76,19 +76,21 @@ typedef struct _cef_jsdialog_handler_t {
cef_base_t base;
///
// Called to run a JavaScript dialog. The |default_prompt_text| value will be
// specified for prompt dialogs only. Set |suppress_message| to true (1) and
// return false (0) to suppress the message (suppressing messages is
// preferable to immediately executing the callback as this is used to detect
// presumably malicious behavior like spamming alert messages in
// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
// to use the default implementation (the default implementation will show one
// modal dialog at a time and suppress any additional dialog requests until
// the displayed dialog is dismissed). Return true (1) if the application will
// use a custom dialog or if the callback has been executed immediately.
// Custom dialogs may be either modal or modeless. If a custom dialog is used
// the application must execute |callback| once the custom dialog is
// dismissed.
// Called to run a JavaScript dialog. If |origin_url| and |accept_lang| are
// non-NULL they can be passed to the CefFormatUrlForSecurityDisplay function
// to retrieve a secure and user-friendly display string. The
// |default_prompt_text| value will be specified for prompt dialogs only. Set
// |suppress_message| to true (1) and return false (0) to suppress the message
// (suppressing messages is preferable to immediately executing the callback
// as this is used to detect presumably malicious behavior like spamming alert
// messages in onbeforeunload). Set |suppress_message| to false (0) and return
// false (0) to use the default implementation (the default implementation
// will show one modal dialog at a time and suppress any additional dialog
// requests until the displayed dialog is dismissed). Return true (1) if the
// application will use a custom dialog or if the callback has been executed
// immediately. Custom dialogs may be either modal or modeless. If a custom
// dialog is used the application must execute |callback| once the custom
// dialog is dismissed.
///
int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self,
struct _cef_browser_t* browser, const cef_string_t* origin_url,
......
......@@ -60,6 +60,20 @@ CEF_EXPORT int cef_parse_url(const cef_string_t* url,
CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts,
cef_string_t* url);
///
// This is a convenience function for formatting a URL in a concise and human-
// friendly way to help users make security-related decisions (or in other
// circumstances when people need to distinguish sites, origins, or otherwise-
// simplified URLs from each other). Internationalized domain names (IDN) may be
// presented in Unicode if |languages| accepts the Unicode representation. The
// returned value will (a) omit the path for standard schemes, excepting file
// and filesystem, and (b) omit the port if it is the default for the scheme. Do
// not use this for URLs which will be parsed or sent to other applications.
///
// The resulting string must be freed by calling cef_string_userfree_free().
CEF_EXPORT cef_string_userfree_t cef_format_url_for_security_display(
const cef_string_t* origin_url, const cef_string_t* languages);
///
// Returns the mime type for the specified file extension or an NULL string if
// unknown.
......
......@@ -182,7 +182,8 @@ class CefFrame : public virtual CefBase {
virtual CefString GetName() =0;
///
// Returns the globally unique identifier for this frame.
// Returns the globally unique identifier for this frame or < 0 if the
// underlying frame does not yet exist.
///
/*--cef()--*/
virtual int64 GetIdentifier() =0;
......
......@@ -68,18 +68,21 @@ class CefJSDialogHandler : public virtual CefBase {
typedef cef_jsdialog_type_t JSDialogType;
///
// Called to run a JavaScript dialog. The |default_prompt_text| value will be
// specified for prompt dialogs only. Set |suppress_message| to true and
// return false to suppress the message (suppressing messages is preferable
// to immediately executing the callback as this is used to detect presumably
// malicious behavior like spamming alert messages in onbeforeunload). Set
// |suppress_message| to false and return false to use the default
// implementation (the default implementation will show one modal dialog at a
// time and suppress any additional dialog requests until the displayed dialog
// is dismissed). Return true if the application will use a custom dialog or
// if the callback has been executed immediately. Custom dialogs may be either
// modal or modeless. If a custom dialog is used the application must execute
// |callback| once the custom dialog is dismissed.
// Called to run a JavaScript dialog. If |origin_url| and |accept_lang| are
// non-empty they can be passed to the CefFormatUrlForSecurityDisplay function
// to retrieve a secure and user-friendly display string. The
// |default_prompt_text| value will be specified for prompt dialogs only. Set
// |suppress_message| to true and return false to suppress the message
// (suppressing messages is preferable to immediately executing the callback
// as this is used to detect presumably malicious behavior like spamming alert
// messages in onbeforeunload). Set |suppress_message| to false and return
// false to use the default implementation (the default implementation will
// show one modal dialog at a time and suppress any additional dialog requests
// until the displayed dialog is dismissed). Return true if the application
// will use a custom dialog or if the callback has been executed immediately.
// Custom dialogs may be either modal or modeless. If a custom dialog is used
// the application must execute |callback| once the custom dialog is
// dismissed.
///
/*--cef(optional_param=origin_url,optional_param=accept_lang,
optional_param=message_text,optional_param=default_prompt_text)--*/
......
......@@ -60,6 +60,20 @@ bool CefParseURL(const CefString& url,
bool CefCreateURL(const CefURLParts& parts,
CefString& url);
///
// This is a convenience function for formatting a URL in a concise and human-
// friendly way to help users make security-related decisions (or in other
// circumstances when people need to distinguish sites, origins, or otherwise-
// simplified URLs from each other). Internationalized domain names (IDN) may be
// presented in Unicode if |languages| accepts the Unicode representation. The
// returned value will (a) omit the path for standard schemes, excepting file
// and filesystem, and (b) omit the port if it is the default for the scheme. Do
// not use this for URLs which will be parsed or sent to other applications.
///
/*--cef(optional_param=languages)--*/
CefString CefFormatUrlForSecurityDisplay(const CefString& origin_url,
const CefString& languages);
///
// Returns the mime type for the specified file extension or an empty string if
// unknown.
......
......@@ -513,12 +513,6 @@ typedef struct _cef_browser_settings_t {
///
cef_state_t caret_browsing;
///
// Controls whether the Java plugin will be loaded. Also configurable using
// the "disable-java" command-line switch.
///
cef_state_t java;
///
// Controls whether any plugins will be loaded. Also configurable using the
// "disable-plugins" command-line switch.
......@@ -1151,11 +1145,6 @@ typedef enum {
///
UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3,
///
// If set the headers sent and received for the request will be recorded.
///
UR_FLAG_REPORT_RAW_HEADERS = 1 << 5,
///
// If set the CefURLRequestClient::OnDownloadData method will not be called.
///
......
......@@ -605,7 +605,6 @@ struct CefBrowserSettingsTraits {
target->javascript_access_clipboard = src->javascript_access_clipboard;
target->javascript_dom_paste = src->javascript_dom_paste;
target->caret_browsing = src->caret_browsing;
target->java = src->java;
target->plugins = src->plugins;
target->universal_access_from_file_urls =
src->universal_access_from_file_urls;
......
......@@ -328,8 +328,7 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
DCHECK(!url_request_getter_.get());
// Initialize the proxy configuration service.
scoped_ptr<net::ProxyConfigService> proxy_config_service;
proxy_config_service.reset(
scoped_ptr<net::ProxyConfigService> proxy_config_service(
ProxyServiceFactory::CreateProxyConfigService(
pref_proxy_config_tracker_.get()));
......
......@@ -14,7 +14,7 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/net/pref_proxy_config_tracker.h"
#include "components/proxy_config/pref_proxy_config_tracker.h"
namespace content {
class DownloadManagerDelegate;
......
......@@ -414,15 +414,10 @@ bool CefBrowserHost::CreateBrowser(
}
// Verify windowless rendering requirements.
if (windowInfo.windowless_rendering_enabled) {
if (!client->GetRenderHandler().get()) {
NOTREACHED() << "CefRenderHandler implementation is required";
return false;
}
if (!content::IsDelegatedRendererEnabled()) {
NOTREACHED() << "Delegated renderer must be enabled";
return false;
}
if (windowInfo.windowless_rendering_enabled &&
!client->GetRenderHandler().get()) {
NOTREACHED() << "CefRenderHandler implementation is required";
return false;
}
// Create the browser on the UI thread.
......@@ -479,15 +474,10 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::Create(
bool is_popup,
CefRefPtr<CefRequestContext> request_context) {
// Verify windowless rendering requirements.
if (windowInfo.windowless_rendering_enabled) {
if (!client->GetRenderHandler().get()) {
NOTREACHED() << "CefRenderHandler implementation is required";
return NULL;
}
if (!content::IsDelegatedRendererEnabled()) {
NOTREACHED() << "Delegated renderer must be enabled";
return NULL;
}
if (windowInfo.windowless_rendering_enabled &&
!client->GetRenderHandler().get()) {
NOTREACHED() << "CefRenderHandler implementation is required";
return NULL;
}
scoped_refptr<CefBrowserInfo> info =
......
......@@ -28,7 +28,6 @@
#include "grit/ui_strings.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/mac/WebInputEventFactory.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
......
......@@ -13,12 +13,12 @@
#include "base/prefs/pref_registry_simple.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/browser/net/pref_proxy_config_tracker_impl.h"
#include "chrome/browser/prefs/command_line_pref_store.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "extensions/browser/extension_prefs.h"
#include "grit/cef_strings.h"
......
......@@ -106,7 +106,6 @@ void BrowserToWebSettings(const CefBrowserSettings& cef,
web.javascript_can_access_clipboard);
SET_STATE(cef.javascript_dom_paste, web.dom_paste_enabled);
SET_STATE(cef.caret_browsing, web.caret_browsing_enabled);
SET_STATE(cef.java, web.java_enabled);
SET_STATE(cef.plugins, web.plugins_enabled);
SET_STATE(cef.universal_access_from_file_urls,
web.allow_universal_access_from_file_urls);
......
......@@ -307,9 +307,6 @@ class CefBrowserURLRequest::Context
upload_data_size_ = upload_data_size;
}
if (cef_flags & UR_FLAG_REPORT_RAW_HEADERS)
load_flags |= net::LOAD_REPORT_RAW_HEADERS;
fetcher_->SetLoadFlags(load_flags);
fetcher_->SetExtraRequestHeaders(
......
......@@ -66,13 +66,14 @@ net::URLRequestContextGetter*
return NULL;
}
chrome_variations::VariationsService*
variations::VariationsService*
ChromeBrowserProcessStub::variations_service() {
NOTIMPLEMENTED();
return NULL;
}
PromoResourceService* ChromeBrowserProcessStub::promo_resource_service() {
web_resource::PromoResourceService*
ChromeBrowserProcessStub::promo_resource_service() {
NOTIMPLEMENTED();
return NULL;
}
......@@ -217,7 +218,7 @@ void ChromeBrowserProcessStub::StartAutoupdateTimer() {
}
#endif
ChromeNetLog* ChromeBrowserProcessStub::net_log() {
net_log::ChromeNetLog* ChromeBrowserProcessStub::net_log() {
NOTIMPLEMENTED();
return NULL;
}
......@@ -273,13 +274,13 @@ gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() {
return NULL;
}
memory::OomPriorityManager* ChromeBrowserProcessStub::GetOomPriorityManager() {
NOTIMPLEMENTED();
return NULL;
}
ShellIntegration::DefaultWebClientState
ChromeBrowserProcessStub::CachedDefaultWebClientState() {
NOTIMPLEMENTED();
return ShellIntegration::UNKNOWN_DEFAULT;
}
memory::TabManager* ChromeBrowserProcessStub::GetTabManager() {
NOTIMPLEMENTED();
return NULL;
}
......@@ -39,8 +39,8 @@ class ChromeBrowserProcessStub : public BrowserProcess {
ProfileManager* profile_manager() override;
PrefService* local_state() override;
net::URLRequestContextGetter* system_request_context() override;
chrome_variations::VariationsService* variations_service() override;
PromoResourceService* promo_resource_service() override;
variations::VariationsService* variations_service() override;
web_resource::PromoResourceService* promo_resource_service() override;
BrowserProcessPlatformPart* platform_part() override;
extensions::EventRouterForwarder*
extension_event_router_forwarder() override;
......@@ -80,7 +80,7 @@ class ChromeBrowserProcessStub : public BrowserProcess {
void StartAutoupdateTimer() override;
#endif
ChromeNetLog* net_log() override;
net_log::ChromeNetLog* net_log() override;
component_updater::ComponentUpdateService*
component_updater() override;
CRLSetFetcher* crl_set_fetcher() override;
......@@ -96,9 +96,9 @@ class ChromeBrowserProcessStub : public BrowserProcess {
#endif
network_time::NetworkTimeTracker* network_time_tracker() override;
gcm::GCMDriver* gcm_driver() override;
memory::OomPriorityManager* GetOomPriorityManager() override;
ShellIntegration::DefaultWebClientState
CachedDefaultWebClientState() override;
memory::TabManager* GetTabManager() override;
private:
std::string locale_;
......
......@@ -29,6 +29,7 @@
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
#include "grit/cef_resources.h"
#include "grit/components_resources.h"
#include "ipc/ipc_channel.h"
#include "net/url_request/url_request.h"
#include "ui/base/webui/web_ui_util.h"
......@@ -274,10 +275,10 @@ class Delegate : public InternalHandlerDelegate {
bool OnCredits(const std::string& path, Action* action) {
if (path == "credits.js") {
action->resource_id = IDR_CEF_CREDITS_JS;
action->resource_id = IDR_ABOUT_UI_CREDITS_JS;
} else {
action->mime_type = "text/html";
action->resource_id = IDR_CEF_CREDITS_HTML;
action->resource_id = IDR_ABOUT_UI_CREDITS_HTML;
}
return true;
}
......
......@@ -30,6 +30,7 @@
#include "libcef/common/command_line_impl.h"
#include "libcef/common/content_client.h"
#include "libcef/common/extensions/extensions_util.h"
#include "libcef/common/request_impl.h"
#include "libcef/common/scheme_registration.h"
#include "base/base_switches.h"
......@@ -38,13 +39,19 @@
#include "base/path_service.h"
#include "chrome/browser/spellchecker/spellcheck_message_filter.h"
#include "chrome/common/chrome_switches.h"
#include "components/navigation_interception/intercept_navigation_throttle.h"
#include "components/navigation_interception/navigation_params.h"
#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/plugin_service_impl.h"
#include "content/public/browser/access_token_store.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/browser_url_handler.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/quota_permission_context.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
......@@ -70,8 +77,8 @@
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#include "base/debug/leak_annotations.h"
#include "components/crash/app/breakpad_linux.h"
#include "components/crash/browser/crash_handler_host_linux.h"
#include "components/crash/content/app/breakpad_linux.h"
#include "components/crash/content/browser/crash_handler_host_linux.h"
#include "content/public/common/content_descriptors.h"
#endif
......@@ -353,6 +360,67 @@ int GetCrashSignalFD(const base::CommandLine& command_line) {
}
#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
// TODO(cef): We can't currently trust NavigationParams::is_main_frame() because
// it's always set to true in
// InterceptNavigationThrottle::CheckIfShouldIgnoreNavigation. Remove the
// |is_main_frame| argument once this problem is fixed.
bool NavigationOnUIThread(
bool is_main_frame,
int64 frame_id,
int64 parent_frame_id,
content::WebContents* source,
const navigation_interception::NavigationParams& params) {
CEF_REQUIRE_UIT();
bool ignore_navigation = false;
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(source);
if (browser.get()) {
CefRefPtr<CefClient> client = browser->GetClient();
if (client.get()) {
CefRefPtr<CefRequestHandler> handler = client->GetRequestHandler();
if (handler.get()) {
CefRefPtr<CefFrame> frame;
if (is_main_frame) {
frame = browser->GetMainFrame();
} else if (frame_id >= 0) {
frame = browser->GetFrame(frame_id);
DCHECK(frame);
} else {
// Create a temporary frame object for navigation of sub-frames that
// don't yet exist.
frame = new CefFrameHostImpl(browser.get(),
CefFrameHostImpl::kInvalidFrameId,
false,
CefString(),
CefString(),
parent_frame_id);
}
CefRefPtr<CefRequestImpl> request = new CefRequestImpl();
request->Set(params, is_main_frame);
request->SetReadOnly(true);
ignore_navigation = handler->OnBeforeBrowse(
browser.get(), frame, request.get(), params.is_redirect());
}
}
}
return ignore_navigation;
}
void FindFrameHostForNavigationHandle(
content::NavigationHandle* navigation_handle,
content::RenderFrameHost** matching_frame_host,
content::RenderFrameHost* current_frame_host) {
content::RenderFrameHostImpl* current_impl =
static_cast<content::RenderFrameHostImpl*>(current_frame_host);
if (current_impl->navigation_handle() == navigation_handle)
*matching_frame_host = current_frame_host;
}
} // namespace
......@@ -964,6 +1032,51 @@ content::DevToolsManagerDelegate*
return new CefDevToolsManagerDelegate();
}
ScopedVector<content::NavigationThrottle>
CefContentBrowserClient::CreateThrottlesForNavigation(
content::NavigationHandle* navigation_handle) {
CEF_REQUIRE_UIT();
ScopedVector<content::NavigationThrottle> throttles;
const bool is_main_frame = navigation_handle->IsInMainFrame();
int64 parent_frame_id = CefFrameHostImpl::kUnspecifiedFrameId;
if (!is_main_frame) {
// Identify the RenderFrameHostImpl that originated the navigation.
// TODO(cef): It would be better if NavigationHandle could directly report
// the owner RenderFrameHostImpl.
// There is additional complexity here if PlzNavigate is enabled. See
// comments in content/browser/frame_host/navigation_handle_impl.h.
content::WebContents* web_contents = navigation_handle->GetWebContents();
content::RenderFrameHost* parent_frame_host = NULL;
web_contents->ForEachFrame(
base::Bind(FindFrameHostForNavigationHandle,
navigation_handle, &parent_frame_host));
DCHECK(parent_frame_host);
parent_frame_id = parent_frame_host->GetRoutingID();