diff --git a/BUILD.gn b/BUILD.gn index 270ae31f5a..57a8831cd0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -355,20 +355,12 @@ source_set("native_mate") { ] } -electron_framework_sources = [ - "$root_out_dir/chrome_100_percent.pak", -] +electron_framework_sources = [] electron_framework_public_deps = [ ":packed_resources", ] -if (enable_hidpi) { - electron_framework_sources += [ - "$root_out_dir/chrome_200_percent.pak", - ] -} - if (icu_use_data_file) { electron_framework_sources += [ "$root_out_dir/icudtl.dat" diff --git a/app/mac/BUILD.gn b/app/mac/BUILD.gn index 3a118ca5e8..7439b6f0d4 100644 --- a/app/mac/BUILD.gn +++ b/app/mac/BUILD.gn @@ -103,7 +103,6 @@ mac_framework_bundle("electron_framework") { deps = [ "//chrome:chrome_framework_helpers", - "//chrome:chrome_framework_locales", "//electron/build/node:node_resources", ":widevine_cdm_adapter", ":external_binaries_resources", diff --git a/atom/app/BUILD.gn b/atom/app/BUILD.gn index d45176bdc8..eaac5cee8d 100644 --- a/atom/app/BUILD.gn +++ b/atom/app/BUILD.gn @@ -24,6 +24,7 @@ source_set("app") { } deps = [ + "//content/public/common:interfaces", "//third_party/widevine/cdm:headers", "//third_party/kasko", ] diff --git a/atom/browser/api/atom_api_session.cc b/atom/browser/api/atom_api_session.cc index f04769dc02..f937f05dbf 100644 --- a/atom/browser/api/atom_api_session.cc +++ b/atom/browser/api/atom_api_session.cc @@ -222,7 +222,7 @@ class ResolveProxyHelper { // Start the request. int result = proxy_service->ResolveProxy( url, "GET", &proxy_info_, completion_callback, - &pac_req_, nullptr, net::BoundNetLog()); + &pac_req_, nullptr, net::NetLogWithSource()); // Completed synchronously. if (result != net::ERR_IO_PENDING) @@ -299,7 +299,7 @@ void SetProxyInIO(net::URLRequestContextGetter* getter, new net::ProxyConfigServiceFixed(config))); // Refetches and applies the new pac script if provided. proxy_service->ForceReloadProxyConfig(); - RunCallbackInUI(callback); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(&base::DoNothing)); } void SetCertVerifyProcInIO( @@ -319,7 +319,8 @@ void ClearHostResolverCacheInIO( cache->clear(); DCHECK_EQ(0u, cache->size()); if (!callback.is_null()) - RunCallbackInUI(callback); + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, + base::Bind(&base::DoNothing)); } } diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 7a20208408..1633a992f5 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -467,12 +467,14 @@ bool WebContents::ShouldCreateWebContents( } void WebContents::WebContentsCreated(content::WebContents* source_contents, + int opener_render_process_id, int opener_render_frame_id, const std::string& frame_name, const GURL& target_url, content::WebContents* new_contents) { if (guest_delegate_) { guest_delegate_->WebContentsCreated(source_contents, + opener_render_process_id, opener_render_frame_id, frame_name, target_url, @@ -865,7 +867,6 @@ void WebContents::DidGetResourceResponseStart( } void WebContents::DidGetRedirectForResourceRequest( - content::RenderFrameHost* render_frame_host, const content::ResourceRedirectDetails& details) { Emit("did-get-redirect-request", details.url, @@ -916,7 +917,7 @@ void WebContents::DidFinishNavigation( void WebContents::SecurityStyleChanged( content::SecurityStyle security_style, const content::SecurityStyleExplanations& explanations) { - if (explanations.displayed_insecure_content && + if (explanations.displayed_mixed_content && security_style == content::SECURITY_STYLE_UNAUTHENTICATED) { Emit("security-style-changed", "passive-mixed-content"); } else { @@ -1380,7 +1381,7 @@ void WebContents::InspectServiceWorker() { for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) { if (agent_host->GetType() == - content::DevToolsAgentHost::TYPE_SERVICE_WORKER) { + content::DevToolsAgentHost::kTypeServiceWorker) { OpenDevTools(nullptr); managed_web_contents()->AttachTo(agent_host); break; @@ -2086,7 +2087,7 @@ void WebContents::OnTabCreated(const mate::Dictionary& options, bool was_blocked = false; AddNewContents(source, tab, - active ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB, + active ? WindowOpenDisposition::NEW_FOREGROUND_TAB : WindowOpenDisposition::NEW_BACKGROUND_TAB, gfx::Rect(), user_gesture, &was_blocked); diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 1403b06a0c..30dffcb3e1 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -53,11 +53,16 @@ struct Converter { WindowOpenDisposition val) { std::string disposition = "other"; switch (val) { - case CURRENT_TAB: disposition = "default"; break; - case NEW_FOREGROUND_TAB: disposition = "foreground-tab"; break; - case NEW_BACKGROUND_TAB: disposition = "background-tab"; break; - case NEW_POPUP: disposition = "new-popup"; break; - case NEW_WINDOW: disposition = "new-window"; break; + case WindowOpenDisposition::CURRENT_TAB: + disposition = "default"; break; + case WindowOpenDisposition::NEW_FOREGROUND_TAB: + disposition = "foreground-tab"; break; + case WindowOpenDisposition::NEW_BACKGROUND_TAB: + disposition = "background-tab"; break; + case WindowOpenDisposition::NEW_POPUP: + disposition = "new-popup"; break; + case WindowOpenDisposition::NEW_WINDOW: + disposition = "new-window"; break; default: disposition = "other"; break; } return mate::ConvertToV8(isolate, disposition); @@ -307,6 +312,7 @@ class WebContents : public mate::TrackableObject, const std::string& partition_id, content::SessionStorageNamespace* session_storage_namespace) override; void WebContentsCreated(content::WebContents* source_contents, + int opener_render_process_id, int opener_render_frame_id, const std::string& frame_name, const GURL& target_url, @@ -388,7 +394,6 @@ class WebContents : public mate::TrackableObject, void DidGetResourceResponseStart( const content::ResourceRequestDetails& details) override; void DidGetRedirectForResourceRequest( - content::RenderFrameHost* render_frame_host, const content::ResourceRedirectDetails& details) override; void DidStartNavigation( content::NavigationHandle* navigation_handle) override; diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index 8bba61d231..93dcb15ca9 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -111,7 +111,6 @@ void AtomBrowserClient::OverrideWebkitPrefs( prefs->allow_universal_access_from_file_urls = false; prefs->allow_file_access_from_file_urls = false; prefs->experimental_webgl_enabled = true; - prefs->allow_displaying_insecure_content = false; prefs->allow_running_insecure_content = false; // Custom preferences of guest page. diff --git a/atom/browser/atom_security_state_model_client.cc b/atom/browser/atom_security_state_model_client.cc index fc8144f3c1..aac16309c7 100644 --- a/atom/browser/atom_security_state_model_client.cc +++ b/atom/browser/atom_security_state_model_client.cc @@ -4,11 +4,10 @@ #include "atom/browser/atom_security_state_model_client.h" -#include "content/public/browser/cert_store.h" #include "content/public/browser/navigation_entry.h" +#include "content/public/browser/ssl_status.h" #include "content/public/browser/web_contents.h" #include "content/public/common/origin_util.h" -#include "content/public/common/ssl_status.h" #include "net/cert/x509_certificate.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(atom::AtomSecurityStateModelClient); @@ -27,7 +26,7 @@ SecurityStateModel::SecurityLevel GetSecurityLevelForSecurityStyle( case content::SECURITY_STYLE_UNAUTHENTICATED: return SecurityStateModel::NONE; case content::SECURITY_STYLE_AUTHENTICATION_BROKEN: - return SecurityStateModel::SECURITY_ERROR; + return SecurityStateModel::DANGEROUS; case content::SECURITY_STYLE_WARNING: return SecurityStateModel::SECURITY_WARNING; case content::SECURITY_STYLE_AUTHENTICATED: @@ -48,19 +47,19 @@ AtomSecurityStateModelClient::AtomSecurityStateModelClient( AtomSecurityStateModelClient::~AtomSecurityStateModelClient() { } -const SecurityStateModel::SecurityInfo& -AtomSecurityStateModelClient::GetSecurityInfo() const { - return security_state_model_->GetSecurityInfo(); +void AtomSecurityStateModelClient::GetSecurityInfo( + SecurityStateModel::SecurityInfo* result) const { + security_state_model_->GetSecurityInfo(result); } bool AtomSecurityStateModelClient::RetrieveCert( scoped_refptr* cert) { content::NavigationEntry* entry = web_contents_->GetController().GetVisibleEntry(); - if (!entry) + if (!entry || !entry->GetSSL().certificate) return false; - return content::CertStore::GetInstance()->RetrieveCert( - entry->GetSSL().cert_id, cert); + *cert = entry->GetSSL().certificate; + return true; } bool AtomSecurityStateModelClient::UsedPolicyInstalledCertificate() { @@ -86,7 +85,7 @@ void AtomSecurityStateModelClient::GetVisibleSecurityState( const content::SSLStatus& ssl = entry->GetSSL(); state->initial_security_level = GetSecurityLevelForSecurityStyle(ssl.security_style); - state->cert_id = ssl.cert_id; + state->certificate = ssl.certificate; state->cert_status = ssl.cert_status; state->connection_status = ssl.connection_status; state->security_bits = ssl.security_bits; diff --git a/atom/browser/atom_security_state_model_client.h b/atom/browser/atom_security_state_model_client.h index 310e034f8b..552d05675e 100644 --- a/atom/browser/atom_security_state_model_client.h +++ b/atom/browser/atom_security_state_model_client.h @@ -19,8 +19,8 @@ class AtomSecurityStateModelClient public: ~AtomSecurityStateModelClient() override; - const security_state::SecurityStateModel::SecurityInfo& - GetSecurityInfo() const; + void GetSecurityInfo( + security_state::SecurityStateModel::SecurityInfo* result) const; // security_state::SecurityStateModelClient: void GetVisibleSecurityState( diff --git a/atom/browser/autofill/atom_autofill_client.cc b/atom/browser/autofill/atom_autofill_client.cc index be365e5dda..78ca7f73ae 100644 --- a/atom/browser/autofill/atom_autofill_client.cc +++ b/atom/browser/autofill/atom_autofill_client.cc @@ -99,7 +99,7 @@ PrefService* AtomAutofillClient::GetPrefs() { return user_prefs::UserPrefs::Get(web_contents()->GetBrowserContext()); } -sync_driver::SyncService* AtomAutofillClient::GetSyncService() { +syncer::SyncService* AtomAutofillClient::GetSyncService() { return nullptr; } diff --git a/atom/browser/autofill/atom_autofill_client.h b/atom/browser/autofill/atom_autofill_client.h index 4b5906bbae..d2f9d2e725 100644 --- a/atom/browser/autofill/atom_autofill_client.h +++ b/atom/browser/autofill/atom_autofill_client.h @@ -49,7 +49,7 @@ class AtomAutofillClient PersonalDataManager* GetPersonalDataManager() override; scoped_refptr GetDatabase() override; PrefService* GetPrefs() override; - sync_driver::SyncService* GetSyncService() override; + syncer::SyncService* GetSyncService() override; IdentityProvider* GetIdentityProvider() override; rappor::RapporService* GetRapporService() override; void ShowAutofillSettings() override; diff --git a/atom/browser/browser.cc b/atom/browser/browser.cc index 1e576dfe62..4717c5fd8f 100644 --- a/atom/browser/browser.cc +++ b/atom/browser/browser.cc @@ -10,8 +10,10 @@ #include "atom/browser/native_window.h" #include "atom/browser/window_list.h" #include "base/files/file_util.h" +#include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "base/threading/thread_task_runner_handle.h" +#include "base/trace_event/trace_event_impl.h" #include "brightray/browser/brightray_paths.h" namespace atom { diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index 230f95c7d1..1239af2a01 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -170,14 +170,15 @@ content::SecurityStyle SecurityLevelToSecurityStyle( SecurityStateModel::SecurityLevel security_level) { switch (security_level) { case SecurityStateModel::NONE: + case SecurityStateModel::HTTP_SHOW_WARNING: return content::SECURITY_STYLE_UNAUTHENTICATED; case SecurityStateModel::SECURITY_WARNING: - case SecurityStateModel::SECURITY_POLICY_WARNING: + case SecurityStateModel::SECURE_WITH_POLICY_INSTALLED_CERT: return content::SECURITY_STYLE_WARNING; case SecurityStateModel::EV_SECURE: case SecurityStateModel::SECURE: return content::SECURITY_STYLE_AUTHENTICATED; - case SecurityStateModel::SECURITY_ERROR: + case SecurityStateModel::DANGEROUS: return content::SECURITY_STYLE_AUTHENTICATION_BROKEN; } @@ -190,8 +191,8 @@ void AddConnectionExplanation( // Avoid showing TLS details when we couldn't even establish a TLS connection // (e.g. for net errors) or if there was no real connection (some tests). We - // check the |cert_id| to see if there was a connection. - if (security_info.cert_id == 0 || security_info.connection_status == 0) { + // check the |certificate| to see if there was a connection. + if (!security_info.certificate || security_info.connection_status == 0) { return; } @@ -482,7 +483,8 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle( content::SecurityStyleExplanations* security_style_explanations) { auto model_client = AtomSecurityStateModelClient::FromWebContents(web_contents); - auto security_info = model_client->GetSecurityInfo(); + security_state::SecurityStateModel::SecurityInfo security_info; + model_client->GetSecurityInfo(&security_info); const content::SecurityStyle security_style = SecurityLevelToSecurityStyle(security_info.security_level); @@ -513,22 +515,22 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle( content::SecurityStyleExplanation( l10n_util::GetStringUTF8(IDS_MAJOR_SHA1), l10n_util::GetStringUTF8(IDS_MAJOR_SHA1_DESCRIPTION), - security_info.cert_id)); + !!security_info.certificate)); } else if (security_info.sha1_deprecation_status == SecurityStateModel::DEPRECATED_SHA1_MINOR) { security_style_explanations->unauthenticated_explanations.push_back( content::SecurityStyleExplanation( l10n_util::GetStringUTF8(IDS_MINOR_SHA1), l10n_util::GetStringUTF8(IDS_MINOR_SHA1_DESCRIPTION), - security_info.cert_id)); + !!security_info.certificate)); } - security_style_explanations->ran_insecure_content = + security_style_explanations->ran_mixed_content = security_info.mixed_content_status == SecurityStateModel::CONTENT_STATUS_RAN || security_info.mixed_content_status == SecurityStateModel::CONTENT_STATUS_DISPLAYED_AND_RAN; - security_style_explanations->displayed_insecure_content = + security_style_explanations->displayed_mixed_content = security_info.mixed_content_status == SecurityStateModel::CONTENT_STATUS_DISPLAYED || security_info.mixed_content_status == @@ -542,7 +544,7 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle( l10n_util::GetStringUTF8(IDS_CERTIFICATE_CHAIN_ERROR), l10n_util::GetStringFUTF8( IDS_CERTIFICATE_CHAIN_ERROR_DESCRIPTION_FORMAT, error_string), - security_info.cert_id); + !!security_info.certificate); if (net::IsCertStatusMinorError(security_info.cert_status)) security_style_explanations->unauthenticated_explanations.push_back( @@ -560,7 +562,7 @@ content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle( l10n_util::GetStringUTF8(IDS_VALID_SERVER_CERTIFICATE), l10n_util::GetStringUTF8( IDS_VALID_SERVER_CERTIFICATE_DESCRIPTION), - security_info.cert_id)); + !!security_info.certificate)); } } diff --git a/atom/browser/extensions/api/atom_extensions_api_client.cc b/atom/browser/extensions/api/atom_extensions_api_client.cc index b6e483bd71..b763fc6f45 100644 --- a/atom/browser/extensions/api/atom_extensions_api_client.cc +++ b/atom/browser/extensions/api/atom_extensions_api_client.cc @@ -122,7 +122,8 @@ class AtomManagementAPIDelegate : public ManagementAPIDelegate { // Creates an app shortcut. bool CreateAppShortcutFunctionDelegate( ManagementCreateAppShortcutFunction* function, - const Extension* extension) const override { + const Extension* extension, + std::string* error) const override { NOTIMPLEMENTED(); return false; } diff --git a/atom/browser/extensions/atom_extensions_browser_client.cc b/atom/browser/extensions/atom_extensions_browser_client.cc index b1efb72050..7e789506d8 100644 --- a/atom/browser/extensions/atom_extensions_browser_client.cc +++ b/atom/browser/extensions/atom_extensions_browser_client.cc @@ -54,6 +54,7 @@ #include "extensions/common/features/feature.h" #include "extensions/common/features/feature_provider.h" #include "extensions/common/manifest_handlers/incognito_info.h" +#include "extensions/shell/browser/delegates/shell_kiosk_delegate.h" #include "ui/base/resource/resource_bundle.h" // URLRequestResourceBundleJob @@ -493,6 +494,10 @@ AtomExtensionsBrowserClient::GetExtensionWebContentsObserver( return AtomExtensionWebContentsObserver::FromWebContents(web_contents);; } +KioskDelegate* AtomExtensionsBrowserClient::GetKioskDelegate() { + return nullptr; +} + void AtomExtensionsBrowserClient::CleanUpWebView( content::BrowserContext* browser_context, int embedder_process_id, diff --git a/atom/browser/extensions/atom_extensions_browser_client.h b/atom/browser/extensions/atom_extensions_browser_client.h index ecd07f1689..fdd2cf5520 100644 --- a/atom/browser/extensions/atom_extensions_browser_client.h +++ b/atom/browser/extensions/atom_extensions_browser_client.h @@ -16,6 +16,7 @@ #include "build/build_config.h" #include "extensions/browser/extension_host_delegate.h" #include "extensions/browser/extensions_browser_client.h" +#include "extensions/browser/kiosk/kiosk_delegate.h" namespace base { class CommandLine; @@ -110,6 +111,7 @@ class AtomExtensionsBrowserClient : public ExtensionsBrowserClient { bool IsMinBrowserVersionSupported(const std::string& min_version) override; ExtensionWebContentsObserver* GetExtensionWebContentsObserver( content::WebContents* web_contents) override; + KioskDelegate* GetKioskDelegate() override; void CleanUpWebView(content::BrowserContext* browser_context, int embedder_process_id, int view_instance_id) override; diff --git a/atom/browser/extensions/atom_extensions_network_delegate.cc b/atom/browser/extensions/atom_extensions_network_delegate.cc index 9765719271..1ced244da5 100644 --- a/atom/browser/extensions/atom_extensions_network_delegate.cc +++ b/atom/browser/extensions/atom_extensions_network_delegate.cc @@ -6,9 +6,11 @@ #include "base/stl_util.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/resource_request_info.h" #include "extensions/browser/api/web_request/web_request_api.h" +#include "extensions/browser/extension_navigation_ui_data.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/process_manager.h" @@ -20,6 +22,19 @@ namespace { bool g_accept_all_cookies = true; } +extensions::ExtensionNavigationUIData* GetExtensionNavigationUIData( + net::URLRequest* request) { + const content::ResourceRequestInfo* info = + content::ResourceRequestInfo::ForRequest(request); + if (!info) + return nullptr; + ChromeNavigationUIData* navigation_data = + static_cast(info->GetNavigationUIData()); + if (!navigation_data) + return nullptr; + return navigation_data->GetExtensionNavigationUIData(); +} + AtomExtensionsNetworkDelegate::AtomExtensionsNetworkDelegate( Profile* browser_context) { browser_context_ = browser_context; @@ -87,6 +102,7 @@ int AtomExtensionsNetworkDelegate::OnBeforeURLRequest( int result = ExtensionWebRequestEventRouter::GetInstance()->OnBeforeRequest( browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request, ui_wrapper, new_url); @@ -127,6 +143,7 @@ int AtomExtensionsNetworkDelegate::OnBeforeStartTransaction( int result = ExtensionWebRequestEventRouter::GetInstance()-> OnBeforeSendHeaders(browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request, ui_wrapper, headers); @@ -142,7 +159,8 @@ void AtomExtensionsNetworkDelegate::OnStartTransaction( const net::HttpRequestHeaders& headers) { atom::AtomNetworkDelegate::OnStartTransaction(request, headers); ExtensionWebRequestEventRouter::GetInstance()->OnSendHeaders( - browser_context_, extension_info_map_.get(), request, headers); + browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request, headers); } int AtomExtensionsNetworkDelegate::OnHeadersReceivedInternal( @@ -183,6 +201,7 @@ int AtomExtensionsNetworkDelegate::OnHeadersReceived( int result = ExtensionWebRequestEventRouter::GetInstance()->OnHeadersReceived( browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request, ui_wrapper, original_response_headers, @@ -200,14 +219,16 @@ void AtomExtensionsNetworkDelegate::OnBeforeRedirect( const GURL& new_location) { atom::AtomNetworkDelegate::OnBeforeRedirect(request, new_location); ExtensionWebRequestEventRouter::GetInstance()->OnBeforeRedirect( - browser_context_, extension_info_map_.get(), request, new_location); + browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request, new_location); } void AtomExtensionsNetworkDelegate::OnResponseStarted( net::URLRequest* request) { atom::AtomNetworkDelegate::OnResponseStarted(request); ExtensionWebRequestEventRouter::GetInstance()->OnResponseStarted( - browser_context_, extension_info_map_.get(), request); + browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request); } void AtomExtensionsNetworkDelegate::OnCompleted( @@ -222,7 +243,8 @@ void AtomExtensionsNetworkDelegate::OnCompleted( request->response_headers()->response_code()); if (!is_redirect) { ExtensionWebRequestEventRouter::GetInstance()->OnCompleted( - browser_context_, extension_info_map_.get(), request); + browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request); } return; } @@ -230,7 +252,8 @@ void AtomExtensionsNetworkDelegate::OnCompleted( if (request->status().status() == net::URLRequestStatus::FAILED || request->status().status() == net::URLRequestStatus::CANCELED) { ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred( - browser_context_, extension_info_map_.get(), request, started); + browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request, started); return; } @@ -257,7 +280,8 @@ AtomExtensionsNetworkDelegate::OnAuthRequired( const AuthCallback& callback, net::AuthCredentials* credentials) { return ExtensionWebRequestEventRouter::GetInstance()->OnAuthRequired( - browser_context_, extension_info_map_.get(), request, auth_info, callback, + browser_context_, extension_info_map_.get(), + GetExtensionNavigationUIData(request), request, auth_info, callback, credentials); } diff --git a/atom/browser/extensions/tab_helper.cc b/atom/browser/extensions/tab_helper.cc index bf0a95d0fb..9b49317b77 100644 --- a/atom/browser/extensions/tab_helper.cc +++ b/atom/browser/extensions/tab_helper.cc @@ -193,6 +193,7 @@ bool TabHelper::ExecuteScriptInTab(mate::Arguments* args) { } else { scoped_refptr file_reader(new FileReader( resource, + FileReader::OptionalFileThreadTaskCallback(), // null callback. base::Bind(&TabHelper::ExecuteScript, base::Unretained(this), extension_id, base::Passed(©), result, callback, file_url))); file_reader->Start(); diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index d315b0bcb3..45c9a2cb5e 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -194,7 +194,7 @@ - (void)windowDidEndLiveResize:(NSNotification*)notification { - (void)windowWillEnterFullScreen:(NSNotification*)notification { // Hide the native toolbar before entering fullscreen, so there is no visual // artifacts. - if (base::mac::IsOSYosemiteOrLater() && + if (base::mac::IsAtLeastOS10_10() && shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) { NSWindow* window = shell_->GetNativeWindow(); [window setToolbar:nil]; @@ -209,7 +209,7 @@ - (void)windowDidEnterFullScreen:(NSNotification*)notification { // have to set one, because title bar is visible here. NSWindow* window = shell_->GetNativeWindow(); if (!shell_->has_frame() && - base::mac::IsOSYosemiteOrLater() && + base::mac::IsAtLeastOS10_10() && // FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under // fullscreen mode. shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET) { @@ -218,7 +218,7 @@ - (void)windowDidEnterFullScreen:(NSNotification*)notification { // Restore the native toolbar immediately after entering fullscreen, if we do // this before leaving fullscreen, traffic light buttons will be jumping. - if (base::mac::IsOSYosemiteOrLater() && + if (base::mac::IsAtLeastOS10_10() && shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) { base::scoped_nsobject toolbar( [[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]); @@ -235,13 +235,13 @@ - (void)windowWillExitFullScreen:(NSNotification*)notification { // Restore the titlebar visibility. NSWindow* window = shell_->GetNativeWindow(); if (!shell_->has_frame() && - base::mac::IsOSYosemiteOrLater() && + base::mac::IsAtLeastOS10_10() && shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET) { [window setTitleVisibility:NSWindowTitleHidden]; } // Turn off the style for toolbar. - if (base::mac::IsOSYosemiteOrLater() && + if (base::mac::IsAtLeastOS10_10() && shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) { shell_->SetStyleMask(false, NSFullSizeContentViewWindowMask); } @@ -617,7 +617,7 @@ static bool FromV8(v8::Isolate* isolate, v8::Handle val, [window_ setDisableKeyOrMainWindow:YES]; if (!has_frame()) { - if (base::mac::IsOSYosemiteOrLater()) { + if (base::mac::IsAtLeastOS10_10()) { // Don't show title bar. [window_ setTitleVisibility:NSWindowTitleHidden]; } @@ -630,7 +630,7 @@ static bool FromV8(v8::Isolate* isolate, v8::Handle val, // Hide the title bar. if (title_bar_style_ == HIDDEN_INSET) { - if (base::mac::IsOSYosemiteOrLater()) { + if (base::mac::IsAtLeastOS10_10()) { [window_ setTitlebarAppearsTransparent:YES]; base::scoped_nsobject toolbar( [[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]); @@ -964,7 +964,7 @@ static bool FromV8(v8::Isolate* isolate, v8::Handle val, void NativeWindowMac::SetTitle(const std::string& title) { // For macOS <= 10.9, the setTitleVisibility API is not available, we have // to avoid calling setTitle for frameless window. - if (!base::mac::IsOSYosemiteOrLater() && !has_frame()) + if (!base::mac::IsAtLeastOS10_10() && !has_frame()) return; [window_ setTitle:base::SysUTF8ToNSString(title)]; @@ -1248,7 +1248,7 @@ static bool FromV8(v8::Isolate* isolate, v8::Handle val, [[window_ standardWindowButton:NSWindowFullScreenButton] setHidden:YES]; if (title_bar_style_ != NORMAL) { - if (base::mac::IsOSMavericks()) { + if (base::mac::IsOS10_9()) { ShowWindowButton(NSWindowZoomButton); ShowWindowButton(NSWindowMiniaturizeButton); ShowWindowButton(NSWindowCloseButton); diff --git a/atom/browser/net/atom_cert_verifier.cc b/atom/browser/net/atom_cert_verifier.cc index 7fb2ce7229..62ace401c9 100644 --- a/atom/browser/net/atom_cert_verifier.cc +++ b/atom/browser/net/atom_cert_verifier.cc @@ -45,7 +45,7 @@ int AtomCertVerifier::Verify( net::CertVerifyResult* verify_result, const net::CompletionCallback& callback, std::unique_ptr* out_req, - const net::BoundNetLog& net_log) { + const net::NetLogWithSource& net_log) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (verify_proc_.is_null()) diff --git a/atom/browser/net/atom_cert_verifier.h b/atom/browser/net/atom_cert_verifier.h index 74b8f2784c..8073e151b1 100644 --- a/atom/browser/net/atom_cert_verifier.h +++ b/atom/browser/net/atom_cert_verifier.h @@ -31,7 +31,7 @@ class AtomCertVerifier : public net::CertVerifier { net::CertVerifyResult* verify_result, const net::CompletionCallback& callback, std::unique_ptr* out_req, - const net::BoundNetLog& net_log) override; + const net::NetLogWithSource& net_log) override; bool SupportsOCSPStapling() override; private: diff --git a/atom/browser/net/atom_ssl_config_service.cc b/atom/browser/net/atom_ssl_config_service.cc index 1c9d39258f..6a1243621e 100644 --- a/atom/browser/net/atom_ssl_config_service.cc +++ b/atom/browser/net/atom_ssl_config_service.cc @@ -50,11 +50,6 @@ std::vector ParseCipherSuites( AtomSSLConfigService::AtomSSLConfigService() { auto cmd_line = base::CommandLine::ForCurrentProcess(); - if (cmd_line->HasSwitch(switches::kSSLVersionFallbackMin)) { - auto version_string = - cmd_line->GetSwitchValueASCII(switches::kSSLVersionFallbackMin); - config_.version_fallback_min = GetSSLProtocolVersion(version_string); - } if (cmd_line->HasSwitch(switches::kCipherSuiteBlacklist)) { auto cipher_strings = base::SplitString( diff --git a/atom/browser/net/url_request_fetch_job.cc b/atom/browser/net/url_request_fetch_job.cc index 5f11c67476..901e930eba 100644 --- a/atom/browser/net/url_request_fetch_job.cc +++ b/atom/browser/net/url_request_fetch_job.cc @@ -62,7 +62,7 @@ class ResponsePiper : public net::URLFetcherResponseWriter { } return job_->DataAvailable(buffer, num_bytes, callback); } - int Finish(const net::CompletionCallback& callback) override { + int Finish(int net_error, const net::CompletionCallback& callback) override { return net::OK; } diff --git a/atom/browser/ui/atom_menu_model.cc b/atom/browser/ui/atom_menu_model.cc index 3f0d1bbfa8..b6a9ba6a72 100644 --- a/atom/browser/ui/atom_menu_model.cc +++ b/atom/browser/ui/atom_menu_model.cc @@ -40,9 +40,9 @@ bool AtomMenuModel::GetAcceleratorAtWithParams( return false; } -void AtomMenuModel::MenuClosed() { - ui::SimpleMenuModel::MenuClosed(); - FOR_EACH_OBSERVER(Observer, observers_, MenuClosed()); +void AtomMenuModel::MenuWillClose() { + ui::SimpleMenuModel::MenuWillClose(); + FOR_EACH_OBSERVER(Observer, observers_, MenuWillClose()); } AtomMenuModel* AtomMenuModel::GetSubmenuModelAt(int index) { diff --git a/atom/browser/ui/atom_menu_model.h b/atom/browser/ui/atom_menu_model.h index e7d6fc92c0..7bf734b74c 100644 --- a/atom/browser/ui/atom_menu_model.h +++ b/atom/browser/ui/atom_menu_model.h @@ -37,7 +37,7 @@ class AtomMenuModel : public ui::SimpleMenuModel { virtual ~Observer() {} // Notifies the menu has been closed. - virtual void MenuClosed() {} + virtual void MenuWillClose() {} }; explicit AtomMenuModel(Delegate* delegate); @@ -53,7 +53,7 @@ class AtomMenuModel : public ui::SimpleMenuModel { ui::Accelerator* accelerator) const; // ui::SimpleMenuModel: - void MenuClosed() override; + void MenuWillClose() override; using SimpleMenuModel::GetSubmenuModelAt; AtomMenuModel* GetSubmenuModelAt(int index); diff --git a/atom/browser/ui/cocoa/atom_menu_controller.mm b/atom/browser/ui/cocoa/atom_menu_controller.mm index 365317f653..6bdaa4c780 100644 --- a/atom/browser/ui/cocoa/atom_menu_controller.mm +++ b/atom/browser/ui/cocoa/atom_menu_controller.mm @@ -90,7 +90,7 @@ - (void)populateWithModel:(atom::AtomMenuModel*)model { - (void)cancel { if (isMenuOpen_) { [menu_ cancelTracking]; - model_->MenuClosed(); + model_->MenuWillClose(); isMenuOpen_ = NO; } } @@ -265,7 +265,7 @@ - (void)menuWillOpen:(NSMenu*)menu { - (void)menuDidClose:(NSMenu*)menu { if (isMenuOpen_) { - model_->MenuClosed(); + model_->MenuWillClose(); isMenuOpen_ = NO; } } diff --git a/atom/browser/ui/tray_icon_cocoa.h b/atom/browser/ui/tray_icon_cocoa.h index fb66a6b3f1..7680b6f30f 100644 --- a/atom/browser/ui/tray_icon_cocoa.h +++ b/atom/browser/ui/tray_icon_cocoa.h @@ -35,7 +35,7 @@ class TrayIconCocoa : public TrayIcon, protected: // AtomMenuModel::Observer: - void MenuClosed() override; + void MenuWillClose() override; private: // Atom custom view for NSStatusItem. diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index 5ac9050b62..0f672b0386 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -405,7 +405,7 @@ - (BOOL)shouldHighlight { return bounds; } -void TrayIconCocoa::MenuClosed() { +void TrayIconCocoa::MenuWillClose() { [status_item_view_ setNeedsDisplay:YES]; } diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 5969cda370..1f31dce4fa 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -157,8 +157,6 @@ void WebContentsPreferences::OverrideWebkitPrefs( prefs->allow_file_access_from_file_urls = b; if (self->web_preferences_.GetBoolean("allowUniversalAccessFromFileUrls", &b)) prefs->allow_universal_access_from_file_urls = b; - if (self->web_preferences_.GetBoolean("allowDisplayingInsecureContent", &b)) - prefs->allow_displaying_insecure_content = b; if (self->web_preferences_.GetBoolean("allowRunningInsecureContent", &b)) prefs->allow_running_insecure_content = b; if (self->web_preferences_.GetBoolean("hyperlinkAuditingEnabled", &b)) diff --git a/atom/common/native_mate_converters/blink_converter.cc b/atom/common/native_mate_converters/blink_converter.cc index 7a7fb985d5..c0b6182118 100644 --- a/atom/common/native_mate_converters/blink_converter.cc +++ b/atom/common/native_mate_converters/blink_converter.cc @@ -425,8 +425,6 @@ v8::Local Converter::ToV8( dict.Set("size", static_cast(stat.size)); dict.Set("liveSize", static_cast(stat.liveSize)); dict.Set("decodedSize", static_cast(stat.decodedSize)); - dict.Set("purgedSize", static_cast(stat.purgedSize)); - dict.Set("purgeableSize", static_cast(stat.purgeableSize)); return dict.GetHandle(); } diff --git a/atom/renderer/content_settings_manager.cc b/atom/renderer/content_settings_manager.cc index 63898ff3ab..00ac16156c 100644 --- a/atom/renderer/content_settings_manager.cc +++ b/atom/renderer/content_settings_manager.cc @@ -65,8 +65,6 @@ ContentSetting ContentSettingsManager::GetSetting( default_value = web_preferences_.images_enabled; else if (content_type == "javascript") default_value = web_preferences_.javascript_enabled; - else if (content_type == "displayInsecureContent") - default_value = web_preferences_.allow_displaying_insecure_content; else if (content_type == "runInsecureContent") default_value = web_preferences_.allow_running_insecure_content; diff --git a/atom/utility/atom_content_utility_client.cc b/atom/utility/atom_content_utility_client.cc index c3c4721874..a58b1c5cf3 100644 --- a/atom/utility/atom_content_utility_client.cc +++ b/atom/utility/atom_content_utility_client.cc @@ -38,19 +38,14 @@ namespace atom { namespace { void CreateProxyResolverFactory( - mojo::InterfaceRequest request) { - // MojoProxyResolverFactoryImpl is strongly bound to the Mojo message pipe it - // is connected to. When that message pipe is closed, either explicitly on the - // other end (in the browser process), or by a connection error, this object - // will be destroyed. - new net::MojoProxyResolverFactoryImpl(std::move(request)); + net::interfaces::ProxyResolverFactoryRequest request) { + mojo::MakeStrongBinding(base::MakeUnique(), + std::move(request)); } class ResourceUsageReporterImpl : public mojom::ResourceUsageReporter { public: - explicit ResourceUsageReporterImpl( - mojo::InterfaceRequest req) - : binding_(this, std::move(req)) {} + ResourceUsageReporterImpl() {} ~ResourceUsageReporterImpl() override {} private: @@ -65,12 +60,12 @@ class ResourceUsageReporterImpl : public mojom::ResourceUsageReporter { callback.Run(std::move(data)); } - mojo::StrongBinding binding_; }; void CreateResourceUsageReporter( mojo::InterfaceRequest request) { - new ResourceUsageReporterImpl(std::move(request)); + mojo::MakeStrongBinding(base::MakeUnique(), + std::move(request)); } } // namespace diff --git a/brave/browser/brave_content_browser_client.cc b/brave/browser/brave_content_browser_client.cc index 0f6a8a95b5..0be9b5d7af 100644 --- a/brave/browser/brave_content_browser_client.cc +++ b/brave/browser/brave_content_browser_client.cc @@ -512,8 +512,8 @@ BraveContentBrowserClient::GetGpuChannelEstablishFactory() { return nullptr; } -void BraveContentBrowserClient::RegisterInProcessMojoApplications( - StaticMojoApplicationMap* apps) { +void BraveContentBrowserClient::RegisterInProcessServices( + StaticServiceMap* apps) { #if (ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) content::MojoApplicationInfo app_info; app_info.application_factory = base::Bind(&media::CreateMojoMediaApplication); @@ -521,8 +521,8 @@ void BraveContentBrowserClient::RegisterInProcessMojoApplications( #endif } -void BraveContentBrowserClient::RegisterOutOfProcessMojoApplications( - OutOfProcessMojoApplicationMap* apps) { +void BraveContentBrowserClient::RegisterOutOfProcessServices( + OutOfProcessServiceMap* apps) { #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) apps->insert(std::make_pair("mojo:media", base::ASCIIToUTF16("Media App"))); diff --git a/brave/browser/brave_content_browser_client.h b/brave/browser/brave_content_browser_client.h index a9dd444962..e32b2a1285 100644 --- a/brave/browser/brave_content_browser_client.h +++ b/brave/browser/brave_content_browser_client.h @@ -104,9 +104,8 @@ class BraveContentBrowserClient : public atom::AtomBrowserClient { base::FilePath GetShaderDiskCacheDirectory() override; gpu::GpuChannelEstablishFactory* GetGpuChannelEstablishFactory() override; -void RegisterInProcessMojoApplications(StaticMojoApplicationMap* apps) override; -void RegisterOutOfProcessMojoApplications( - OutOfProcessMojoApplicationMap* apps) override; +void RegisterInProcessServices(StaticServiceMap* apps) override; +void RegisterOutOfProcessServices(OutOfProcessServiceMap* apps) override; ScopedVector CreateThrottlesForNavigation( diff --git a/brave/browser/component_updater/brave_component_updater_configurator.cc b/brave/browser/component_updater/brave_component_updater_configurator.cc index 383e57370c..1901050f5e 100644 --- a/brave/browser/component_updater/brave_component_updater_configurator.cc +++ b/brave/browser/component_updater/brave_component_updater_configurator.cc @@ -40,6 +40,7 @@ class BraveConfigurator : public update_client::Configurator { int UpdateDelay() const override; std::vector UpdateUrl() const override; std::vector PingUrl() const override; + std::string GetProdId() const override; base::Version GetBrowserVersion() const override; std::string GetChannel() const override; std::string GetBrand() const override; @@ -57,6 +58,7 @@ class BraveConfigurator : public update_client::Configurator { scoped_refptr GetSequencedTaskRunner() const override; PrefService* GetPrefService() const override; + bool IsPerUserInstall() const override; private: friend class base::RefCountedThreadSafe; @@ -113,6 +115,10 @@ std::vector BraveConfigurator::PingUrl() const { return UpdateUrl(); } +std::string BraveConfigurator::GetProdId() const { + return std::string(); +} + base::Version BraveConfigurator::GetBrowserVersion() const { return configurator_impl_.GetBrowserVersion(); } @@ -187,6 +193,10 @@ PrefService* BraveConfigurator::GetPrefService() const { return nullptr; } +bool BraveConfigurator::IsPerUserInstall() const { + return false; +} + } // namespace scoped_refptr diff --git a/brave/browser/guest_view/tab_view/tab_view_guest.cc b/brave/browser/guest_view/tab_view/tab_view_guest.cc index a433c49568..eda5dbf4dc 100644 --- a/brave/browser/guest_view/tab_view/tab_view_guest.cc +++ b/brave/browser/guest_view/tab_view/tab_view_guest.cc @@ -73,6 +73,7 @@ void TabViewGuest::GuestDestroyed() { } void TabViewGuest::WebContentsCreated(WebContents* source_contents, + int opener_render_process_id, int opener_render_frame_id, const std::string& frame_name, const GURL& target_url, diff --git a/brave/browser/guest_view/tab_view/tab_view_guest.h b/brave/browser/guest_view/tab_view/tab_view_guest.h index 37b7ae07ff..2775e585e8 100644 --- a/brave/browser/guest_view/tab_view/tab_view_guest.h +++ b/brave/browser/guest_view/tab_view/tab_view_guest.h @@ -33,6 +33,7 @@ class TabViewGuest : public guest_view::GuestView { ~TabViewGuest() override; void WebContentsCreated(content::WebContents* source_contents, + int opener_render_process_id, int opener_render_frame_id, const std::string& frame_name, const GURL& target_url, diff --git a/brave/browser/notifications/platform_notification_service_impl.cc b/brave/browser/notifications/platform_notification_service_impl.cc index f9c5b13483..eb6d89e0ce 100644 --- a/brave/browser/notifications/platform_notification_service_impl.cc +++ b/brave/browser/notifications/platform_notification_service_impl.cc @@ -109,6 +109,7 @@ blink::mojom::PermissionStatus void PlatformNotificationServiceImpl::DisplayNotification( content::BrowserContext* browser_context, + const std::string& notification_id, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources, @@ -141,7 +142,7 @@ void PlatformNotificationServiceImpl::DisplayNotification( void PlatformNotificationServiceImpl::DisplayPersistentNotification( content::BrowserContext* browser_context, - int64_t persistent_notification_id, + const std::string& notification_id, const GURL& service_worker_origin, const GURL& origin, const content::PlatformNotificationData& notification_data, @@ -150,7 +151,7 @@ void PlatformNotificationServiceImpl::DisplayPersistentNotification( void PlatformNotificationServiceImpl::ClosePersistentNotification( content::BrowserContext* browser_context, - int64_t persistent_notification_id) { + const std::string& notification_id) { } bool PlatformNotificationServiceImpl::GetDisplayedPersistentNotifications( diff --git a/brave/browser/notifications/platform_notification_service_impl.h b/brave/browser/notifications/platform_notification_service_impl.h index 14dec8d907..2759f8b539 100644 --- a/brave/browser/notifications/platform_notification_service_impl.h +++ b/brave/browser/notifications/platform_notification_service_impl.h @@ -36,6 +36,7 @@ class PlatformNotificationServiceImpl const GURL& origin, int render_process_id) override; void DisplayNotification(content::BrowserContext* browser_context, + const std::string& notification_id, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources, @@ -43,14 +44,13 @@ class PlatformNotificationServiceImpl base::Closure* cancel_callback) override; void DisplayPersistentNotification( content::BrowserContext* browser_context, - int64_t persistent_notification_id, + const std::string& notification_id, const GURL& service_worker_origin, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources) override; - void ClosePersistentNotification( - content::BrowserContext* browser_context, - int64_t persistent_notification_id) override; + void ClosePersistentNotification(content::BrowserContext* browser_context, + const std::string& notification_id) override; bool GetDisplayedPersistentNotifications( content::BrowserContext* browser_context, std::set* displayed_notifications) override; diff --git a/chromium_src/chrome/browser/process_singleton_posix.cc b/chromium_src/chrome/browser/process_singleton_posix.cc index 358a25c0be..a53b5b2575 100644 --- a/chromium_src/chrome/browser/process_singleton_posix.cc +++ b/chromium_src/chrome/browser/process_singleton_posix.cc @@ -969,16 +969,16 @@ bool ProcessSingleton::Create() { // Check that the directory was created with the correct permissions. int dir_mode = 0; - CHECK(base::GetPosixFilePermissions(socket_dir_.path(), &dir_mode) && + CHECK(base::GetPosixFilePermissions(socket_dir_.GetPath(), &dir_mode) && dir_mode == base::FILE_PERMISSION_USER_MASK) << "Temp directory mode is not 700: " << std::oct << dir_mode; // Setup the socket symlink and the two cookies. base::FilePath socket_target_path = - socket_dir_.path().Append(kSingletonSocketFilename); + socket_dir_.GetPath().Append(kSingletonSocketFilename); base::FilePath cookie(GenerateCookie()); base::FilePath remote_cookie_path = - socket_dir_.path().Append(kSingletonCookieFilename); + socket_dir_.GetPath().Append(kSingletonCookieFilename); UnlinkPath(socket_path_); UnlinkPath(cookie_path_); if (!SymlinkPath(socket_target_path, socket_path_) || diff --git a/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 9b00c661c6..ce7f527865 100644 --- a/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chromium_src/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc @@ -40,10 +40,10 @@ class BraveDataSource : public content::URLDataSource, return "brave"; } - void StartDataRequest(const std::string& path, - int render_process_id, - int render_frame_id, - const GotDataCallback& callback) override { + void StartDataRequest( + const std::string& path, + const content::ResourceRequestInfo::WebContentsGetter& wc_getter, + const GotDataCallback& callback) override { GURL url = GURL("file:///" + path); if (!url.is_valid()) { DLOG(WARNING) << "Invalid webui resource: brave://" << path; diff --git a/chromium_src/chrome/renderer/content_settings_observer.h b/chromium_src/chrome/renderer/content_settings_observer.h index 6deac58186..6107dbbd1a 100644 --- a/chromium_src/chrome/renderer/content_settings_observer.h +++ b/chromium_src/chrome/renderer/content_settings_observer.h @@ -83,8 +83,6 @@ class ContentSettingsObserver bool allowReadFromClipboard(bool default_value) override; bool allowWriteToClipboard(bool default_value) override; bool allowMutationEvents(bool default_value) override; - bool allowDisplayingInsecureContent(bool allowed_per_settings, - const blink::WebURL& url) override; bool allowRunningInsecureContent(bool allowed_per_settings, const blink::WebSecurityOrigin& context, const blink::WebURL& url) override; @@ -93,9 +91,7 @@ class ContentSettingsObserver void didNotAllowScript() override; private: - void DidDisplayInsecureContent(GURL resource_url); void DidRunInsecureContent(GURL resouce_url); - void DidBlockDisplayInsecureContent(GURL resource_url); void DidBlockRunInsecureContent(GURL resouce_url); // RenderFrameObserver implementation. diff --git a/chromium_src/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc b/chromium_src/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc index 148d63a16a..0f2c36f2fe 100644 --- a/chromium_src/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc +++ b/chromium_src/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc @@ -19,7 +19,6 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/crash_keys.h" #include "chrome/grit/renderer_resources.h" // NOLINT: This file is generated -#include "chrome/renderer/extensions/tabs_custom_bindings.h" #include "content/public/common/bindings_policy.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_view.h" @@ -152,10 +151,6 @@ void ChromeExtensionsDispatcherDelegate::RegisterNativeHandlers( "webFrame", std::unique_ptr( new brave::WebFrameBindings(context))); - module_system->RegisterNativeHandler( - "tabs", - std::unique_ptr( - new extensions::TabsCustomBindings(context))); // The following are native handlers that are defined in //extensions, but // are only used for APIs defined in Chrome. diff --git a/lib/browser/guest-view-manager.js b/lib/browser/guest-view-manager.js index ba3650a468..08e1b3f905 100644 --- a/lib/browser/guest-view-manager.js +++ b/lib/browser/guest-view-manager.js @@ -44,14 +44,11 @@ let supportedWebViewEvents = [ 'repost-form-warning', 'navigation-entry-commited', 'content-blocked', - 'did-display-insecure-content', 'show-autofill-settings', 'update-autofill-popup-data-list-values', 'hide-autofill-popup', 'show-autofill-popup', - 'did-display-insecure-content', 'did-run-insecure-content', - 'did-block-display-insecure-content', 'did-block-run-insecure-content' ] diff --git a/lib/renderer/web-view/guest-view-internal.js b/lib/renderer/web-view/guest-view-internal.js index 508c33068c..74bb64848f 100644 --- a/lib/renderer/web-view/guest-view-internal.js +++ b/lib/renderer/web-view/guest-view-internal.js @@ -43,9 +43,7 @@ var WEB_VIEW_EVENTS = { 'repost-form-warning': [], 'navigation-entry-commited': ['url', 'isInPage', 'didReplaceEntry'], 'content-blocked': ['details'], - 'did-display-insecure-content': ['details'], 'did-run-insecure-content': ['details'], - 'did-block-display-insecure-content': ['details'], 'did-block-run-insecure-content': ['details'], 'show-autofill-settings': [], 'update-autofill-popup-data-list-values': ['values', 'labels'], diff --git a/vendor/brightray/BUILD.gn b/vendor/brightray/BUILD.gn index 48a97f732e..72b3d88fad 100644 --- a/vendor/brightray/BUILD.gn +++ b/vendor/brightray/BUILD.gn @@ -9,6 +9,7 @@ config("brightray_config") { "//gpu", "//skia/config", "//third_party/skia/include/core", + "//third_party/boringssl/src/include", ] if (is_mac) { diff --git a/vendor/brightray/browser/browser_main_parts.cc b/vendor/brightray/browser/browser_main_parts.cc index dd789ff995..7280d304b2 100644 --- a/vendor/brightray/browser/browser_main_parts.cc +++ b/vendor/brightray/browser/browser_main_parts.cc @@ -13,7 +13,7 @@ #include "base/feature_list.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" -#include "components/devtools_http_handler/devtools_http_handler.h" +#include "content/browser/devtools/devtools_http_handler.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_switches.h" #include "media/base/media_resources.h" @@ -217,7 +217,7 @@ void BrowserMainParts::PreMainMessageLoopRun() { // --remote-debugging-port auto command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kRemoteDebuggingPort)) { - devtools_http_handler_.reset(DevToolsManagerDelegate::CreateHttpHandler()); + // DevToolsManagerDelegate::CreateHttpHandler(); } } diff --git a/vendor/brightray/browser/browser_main_parts.h b/vendor/brightray/browser/browser_main_parts.h index a0d58e7609..209e95d87b 100644 --- a/vendor/brightray/browser/browser_main_parts.h +++ b/vendor/brightray/browser/browser_main_parts.h @@ -9,10 +9,6 @@ #include "base/memory/ref_counted.h" #include "content/public/browser/browser_main_parts.h" -namespace devtools_http_handler { -class DevToolsHttpHandler; -} - #if defined(TOOLKIT_VIEWS) namespace brightray { class ViewsDelegate; @@ -48,8 +44,6 @@ class BrowserMainParts : public content::BrowserMainParts { void InitializeMainNib(); #endif - std::unique_ptr devtools_http_handler_; - #if defined(TOOLKIT_VIEWS) std::unique_ptr views_delegate_; #endif diff --git a/vendor/brightray/browser/devtools_manager_delegate.cc b/vendor/brightray/browser/devtools_manager_delegate.cc index 7a7a97a037..d27421905a 100644 --- a/vendor/brightray/browser/devtools_manager_delegate.cc +++ b/vendor/brightray/browser/devtools_manager_delegate.cc @@ -15,18 +15,18 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "common/content_client.h" -#include "components/devtools_discovery/basic_target_descriptor.h" -#include "components/devtools_discovery/devtools_discovery_manager.h" -#include "components/devtools_http_handler/devtools_http_handler.h" +#include "content/browser/devtools/devtools_http_handler.h" #include "content/shell/grit/shell_resources.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_frontend_host.h" +#include "content/public/browser/devtools_socket_factory.h" #include "content/public/browser/favicon_status.h" #include "content/public/browser/navigation_entry.h" #include "content/public/common/content_switches.h" #include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" #include "net/base/net_errors.h" +#include "net/log/net_log_source.h" #include "net/socket/tcp_server_socket.h" #include "net/socket/stream_socket.h" #include "ui/base/resource/resource_bundle.h" @@ -37,17 +37,27 @@ namespace brightray { namespace { class TCPServerSocketFactory - : public devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory { + : public content::DevToolsSocketFactory { public: TCPServerSocketFactory(const std::string& address, int port) : address_(address), port_(port) { } private: - // content::DevToolsHttpHandler::ServerSocketFactory. + // content::DevToolsSocketFactory. std::unique_ptr CreateForHttpServer() override { std::unique_ptr socket( - new net::TCPServerSocket(nullptr, net::NetLog::Source())); + new net::TCPServerSocket(nullptr, net::NetLogSource())); + if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK) + return std::unique_ptr(); + + return socket; + } + + std::unique_ptr CreateForTethering( + std::string* out_name) override { + std::unique_ptr socket( + new net::TCPServerSocket(nullptr, net::NetLogSource())); if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK) return std::unique_ptr(); @@ -60,7 +70,7 @@ class TCPServerSocketFactory DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); }; -std::unique_ptr +std::unique_ptr CreateSocketFactory() { auto& command_line = *base::CommandLine::ForCurrentProcess(); // See if the user specified a port on the command line (useful for @@ -77,82 +87,16 @@ CreateSocketFactory() { DLOG(WARNING) << "Invalid http debugger port number " << temp_port; } } - return std::unique_ptr< - devtools_http_handler::DevToolsHttpHandler::ServerSocketFactory>( + return std::unique_ptr( new TCPServerSocketFactory("127.0.0.1", port)); } - -// DevToolsDelegate -------------------------------------------------------- - -class DevToolsDelegate : - public devtools_http_handler::DevToolsHttpHandlerDelegate { - public: - DevToolsDelegate(); - ~DevToolsDelegate() override; - - // devtools_http_handler::DevToolsHttpHandlerDelegate. - std::string GetDiscoveryPageHTML() override; - std::string GetFrontendResource(const std::string& path) override; - std::string GetPageThumbnailData(const GURL& url) override; - content::DevToolsExternalAgentProxyDelegate* HandleWebSocketConnection( - const std::string& path) override; - - private: - DISALLOW_COPY_AND_ASSIGN(DevToolsDelegate); -}; - -DevToolsDelegate::DevToolsDelegate() { -} - -DevToolsDelegate::~DevToolsDelegate() { -} - -std::string DevToolsDelegate::GetDiscoveryPageHTML() { - return ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string(); -} - - -std::string DevToolsDelegate::GetFrontendResource( - const std::string& path) { - return content::DevToolsFrontendHost::GetFrontendResource(path).as_string(); -} - -std::string DevToolsDelegate::GetPageThumbnailData(const GURL& url) { - return std::string(); -} - -content::DevToolsExternalAgentProxyDelegate* -DevToolsDelegate::HandleWebSocketConnection(const std::string& path) { - return nullptr; -} - } // namespace // DevToolsManagerDelegate --------------------------------------------------- -// static -devtools_http_handler::DevToolsHttpHandler* -DevToolsManagerDelegate::CreateHttpHandler() { - return new devtools_http_handler::DevToolsHttpHandler( - CreateSocketFactory(), - std::string(), - new DevToolsDelegate, - base::FilePath(), - base::FilePath(), - std::string(), - GetBrightrayUserAgent()); -} - DevToolsManagerDelegate::DevToolsManagerDelegate() : handler_(new DevToolsNetworkProtocolHandler) { - // NB(zcbenz): This call does nothing, the only purpose is to make sure the - // devtools_discovery module is linked into the final executable on Linux. - // Though it is possible to achieve this by modifying the gyp settings, it - // would greatly increase gyp file's complexity, so I chose to instead do - // this hack. - devtools_discovery::DevToolsDiscoveryManager::GetInstance(); } DevToolsManagerDelegate::~DevToolsManagerDelegate() { diff --git a/vendor/brightray/browser/devtools_manager_delegate.h b/vendor/brightray/browser/devtools_manager_delegate.h index 23d28c74db..f6918afb9a 100644 --- a/vendor/brightray/browser/devtools_manager_delegate.h +++ b/vendor/brightray/browser/devtools_manager_delegate.h @@ -7,31 +7,35 @@ #include "base/macros.h" #include "base/compiler_specific.h" -#include "components/devtools_http_handler/devtools_http_handler_delegate.h" +#include "content/browser/devtools/devtools_http_handler.h" #include "content/public/browser/devtools_manager_delegate.h" -namespace devtools_http_handler { -class DevToolsHttpHandler; -} - namespace brightray { class DevToolsNetworkProtocolHandler; class DevToolsManagerDelegate : public content::DevToolsManagerDelegate { public: - static devtools_http_handler::DevToolsHttpHandler* CreateHttpHandler(); DevToolsManagerDelegate(); virtual ~DevToolsManagerDelegate(); // DevToolsManagerDelegate implementation. - void Inspect(content::BrowserContext* browser_context, - content::DevToolsAgentHost* agent_host) override {} + void Inspect(content::DevToolsAgentHost* agent_host) override {} void DevToolsAgentStateChanged(content::DevToolsAgentHost* agent_host, bool attached) override; base::DictionaryValue* HandleCommand(content::DevToolsAgentHost* agent_host, base::DictionaryValue* command) override; + std::string GetTargetType(content::RenderFrameHost* host) override + {return std::string();} + std::string GetTargetTitle(content::RenderFrameHost* host) override + {return std::string();} + scoped_refptr CreateNewTarget( + const GURL& url) override {return nullptr;} + std::string GetDiscoveryPageHTML() override + {return std::string();} + std::string GetFrontendResource(const std::string& path) override + {return std::string();} private: std::unique_ptr handler_; diff --git a/vendor/brightray/browser/devtools_ui.cc b/vendor/brightray/browser/devtools_ui.cc index 24d7d4737c..ac67fc2808 100644 --- a/vendor/brightray/browser/devtools_ui.cc +++ b/vendor/brightray/browser/devtools_ui.cc @@ -62,17 +62,17 @@ class BundledDataSource : public content::URLDataSource { return kChromeUIDevToolsHost; } - void StartDataRequest(const std::string& path, - int render_process_id, - int render_frame_id, - const GotDataCallback& callback) override { + void StartDataRequest( + const std::string& path, + const content::ResourceRequestInfo::WebContentsGetter& wc_getter, + const GotDataCallback& callback) override { // Serve request from local bundle. std::string bundled_path_prefix(kChromeUIDevToolsBundledPath); bundled_path_prefix += "/"; if (base::StartsWith(path, bundled_path_prefix, base::CompareCase::INSENSITIVE_ASCII)) { StartBundledDataRequest(path.substr(bundled_path_prefix.length()), - render_process_id, render_frame_id, callback); + wc_getter, callback); return; } callback.Run(nullptr); @@ -96,8 +96,7 @@ class BundledDataSource : public content::URLDataSource { void StartBundledDataRequest( const std::string& path, - int render_process_id, - int render_frame_id, + const content::ResourceRequestInfo::WebContentsGetter& wc_getter, const content::URLDataSource::GotDataCallback& callback) { std::string filename = PathWithoutParams(path); base::StringPiece resource = diff --git a/vendor/brightray/browser/inspectable_web_contents_impl.cc b/vendor/brightray/browser/inspectable_web_contents_impl.cc index 4626bf5b45..edcbf30502 100644 --- a/vendor/brightray/browser/inspectable_web_contents_impl.cc +++ b/vendor/brightray/browser/inspectable_web_contents_impl.cc @@ -149,7 +149,7 @@ class ResponseWriter : public net::URLFetcherResponseWriter { int Write(net::IOBuffer* buffer, int num_bytes, const net::CompletionCallback& callback) override; - int Finish(const net::CompletionCallback& callback) override; + int Finish(int net_error, const net::CompletionCallback& callback) override; private: base::WeakPtr bindings_; @@ -193,7 +193,8 @@ int ResponseWriter::Write(net::IOBuffer* buffer, return num_bytes; } -int ResponseWriter::Finish(const net::CompletionCallback& callback) { +int ResponseWriter::Finish(int net_error, + const net::CompletionCallback& callback) { return net::OK; } @@ -724,7 +725,7 @@ void InspectableWebContentsImpl::OnWebContentsFocused() { void InspectableWebContentsImpl::DidStartNavigationToPendingEntry( const GURL& url, - content::NavigationController::ReloadType reload_type) { + content::ReloadType reload_type) { frontend_host_.reset( content::DevToolsFrontendHost::Create( web_contents()->GetMainFrame(), diff --git a/vendor/brightray/browser/inspectable_web_contents_impl.h b/vendor/brightray/browser/inspectable_web_contents_impl.h index 8d949a91bf..3bcf6f3863 100644 --- a/vendor/brightray/browser/inspectable_web_contents_impl.h +++ b/vendor/brightray/browser/inspectable_web_contents_impl.h @@ -132,7 +132,7 @@ class InspectableWebContentsImpl : void OnWebContentsFocused() override; void DidStartNavigationToPendingEntry( const GURL& url, - content::NavigationController::ReloadType reload_type) override; + content::ReloadType reload_type) override; // content::WebContentsDelegate: bool AddMessageToConsole(content::WebContents* source, diff --git a/vendor/brightray/browser/net/devtools_network_transaction.cc b/vendor/brightray/browser/net/devtools_network_transaction.cc index 0a62346392..5ed9f6e777 100644 --- a/vendor/brightray/browser/net/devtools_network_transaction.cc +++ b/vendor/brightray/browser/net/devtools_network_transaction.cc @@ -8,7 +8,6 @@ #include "browser/net/devtools_network_upload_data_stream.h" #include "net/base/load_timing_info.h" #include "net/base/net_errors.h" -#include "net/base/upload_progress.h" #include "net/http/http_network_transaction.h" #include "net/http/http_request_info.h" #include "net/socket/connection_attempts.h" @@ -106,7 +105,7 @@ bool DevToolsNetworkTransaction::CheckFailed() { int DevToolsNetworkTransaction::Start( const net::HttpRequestInfo* request, const net::CompletionCallback& callback, - const net::BoundNetLog& net_log) { + const net::NetLogWithSource& net_log) { DCHECK(request); request_ = request; @@ -246,10 +245,6 @@ net::LoadState DevToolsNetworkTransaction::GetLoadState() const { return transaction_->GetLoadState(); } -net::UploadProgress DevToolsNetworkTransaction::GetUploadProgress() const { - return transaction_->GetUploadProgress(); -} - void DevToolsNetworkTransaction::SetQuicServerInfo( net::QuicServerInfo* info) { transaction_->SetQuicServerInfo(info); diff --git a/vendor/brightray/browser/net/devtools_network_transaction.h b/vendor/brightray/browser/net/devtools_network_transaction.h index 3648ca71c7..7f01d73cad 100644 --- a/vendor/brightray/browser/net/devtools_network_transaction.h +++ b/vendor/brightray/browser/net/devtools_network_transaction.h @@ -32,7 +32,7 @@ class DevToolsNetworkTransaction : public net::HttpTransaction { // HttpTransaction methods: int Start(const net::HttpRequestInfo* request, const net::CompletionCallback& callback, - const net::BoundNetLog& net_log) override; + const net::NetLogWithSource& net_log) override; int RestartIgnoringLastError( const net::CompletionCallback& callback) override; int RestartWithCertificate(net::X509Certificate* client_cert, @@ -52,7 +52,6 @@ class DevToolsNetworkTransaction : public net::HttpTransaction { void DoneReading() override; const net::HttpResponseInfo* GetResponseInfo() const override; net::LoadState GetLoadState() const override; - net::UploadProgress GetUploadProgress() const override; void SetQuicServerInfo(net::QuicServerInfo* quic_server_info) override; bool GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override; bool GetRemoteEndpoint(net::IPEndPoint* endpoint) const override; diff --git a/vendor/brightray/browser/net/devtools_network_upload_data_stream.cc b/vendor/brightray/browser/net/devtools_network_upload_data_stream.cc index 6eab91c67d..c6369dcb45 100644 --- a/vendor/brightray/browser/net/devtools_network_upload_data_stream.cc +++ b/vendor/brightray/browser/net/devtools_network_upload_data_stream.cc @@ -36,7 +36,7 @@ bool DevToolsNetworkUploadDataStream::IsInMemory() const { } int DevToolsNetworkUploadDataStream::InitInternal( - const net::BoundNetLog& net_log) { + const net::NetLogWithSource& net_log) { throttled_byte_count_ = 0; int result = upload_data_stream_->Init( base::Bind(&DevToolsNetworkUploadDataStream::StreamInitCallback, diff --git a/vendor/brightray/browser/net/devtools_network_upload_data_stream.h b/vendor/brightray/browser/net/devtools_network_upload_data_stream.h index 8db7dd80c8..c3753e8286 100644 --- a/vendor/brightray/browser/net/devtools_network_upload_data_stream.h +++ b/vendor/brightray/browser/net/devtools_network_upload_data_stream.h @@ -27,7 +27,7 @@ class DevToolsNetworkUploadDataStream : public net::UploadDataStream { private: // net::UploadDataStream implementation. bool IsInMemory() const override; - int InitInternal(const net::BoundNetLog& net_log) override; + int InitInternal(const net::NetLogWithSource& net_log) override; int ReadInternal(net::IOBuffer* buf, int buf_len) override; void ResetInternal() override; diff --git a/vendor/brightray/browser/platform_notification_service.cc b/vendor/brightray/browser/platform_notification_service.cc index 5c390db3f1..328e4cb77a 100644 --- a/vendor/brightray/browser/platform_notification_service.cc +++ b/vendor/brightray/browser/platform_notification_service.cc @@ -72,6 +72,7 @@ blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnIOT void PlatformNotificationService::DisplayNotification( content::BrowserContext* browser_context, + const std::string& notification_id, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources, @@ -89,7 +90,7 @@ void PlatformNotificationService::DisplayNotification( void PlatformNotificationService::DisplayPersistentNotification( content::BrowserContext* browser_context, - int64_t persistent_notification_id, + const std::string& notification_id, const GURL& origin, const GURL& service_worker_origin, const content::PlatformNotificationData& notification_data, @@ -98,7 +99,7 @@ void PlatformNotificationService::DisplayPersistentNotification( void PlatformNotificationService::ClosePersistentNotification( content::BrowserContext* browser_context, - int64_t persistent_notification_id) { + const std::string& notification_id) { } bool PlatformNotificationService::GetDisplayedPersistentNotifications( diff --git a/vendor/brightray/browser/platform_notification_service.h b/vendor/brightray/browser/platform_notification_service.h index 1e17a6fbae..7e5f8daa84 100644 --- a/vendor/brightray/browser/platform_notification_service.h +++ b/vendor/brightray/browser/platform_notification_service.h @@ -29,6 +29,7 @@ class PlatformNotificationService const GURL& origin, int render_process_id) override; void DisplayNotification(content::BrowserContext* browser_context, + const std::string& notification_id, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources, @@ -36,14 +37,14 @@ class PlatformNotificationService base::Closure* cancel_callback) override; void DisplayPersistentNotification( content::BrowserContext* browser_context, - int64_t persistent_notification_id, + const std::string& notification_id, const GURL& service_worker_origin, const GURL& origin, const content::PlatformNotificationData& notification_data, const content::NotificationResources& notification_resources) override; void ClosePersistentNotification( content::BrowserContext* browser_context, - int64_t persistent_notification_id) override; + const std::string& notification_id) override; bool GetDisplayedPersistentNotifications( content::BrowserContext* browser_context, std::set* displayed_notifications) override;