Fixing coding style

This commit is contained in:
Ahmed Mohamed Ali 2017-10-14 11:17:52 +02:00
parent 5030db000a
commit 8763e8ee35

View file

@ -14,8 +14,8 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h" #include "content/public/browser/download_manager.h"
#include "content/public/browser/stream_info.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/browser/stream_info.h"
#include "net/base/escape.h" #include "net/base/escape.h"
#include "net/ssl/client_cert_store.h" #include "net/ssl/client_cert_store.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
@ -35,8 +35,7 @@ namespace atom {
namespace { namespace {
void OnOpenExternal(const GURL& escaped_url, void OnOpenExternal(const GURL& escaped_url, bool allowed) {
bool allowed) {
if (allowed) if (allowed)
platform_util::OpenExternal( platform_util::OpenExternal(
#if defined(OS_WIN) #if defined(OS_WIN)
@ -95,8 +94,7 @@ void OnPdfResourceIntercepted(
content::RenderFrameHost* frame_host = content::RenderFrameHost* frame_host =
content::RenderFrameHost::FromID(render_process_host_id, render_frame_id); content::RenderFrameHost::FromID(render_process_host_id, render_frame_id);
if (!frame_host) if (!frame_host) {
{
return; return;
} }
@ -106,15 +104,13 @@ void OnPdfResourceIntercepted(
} // namespace } // namespace
AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() { AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {}
}
bool AtomResourceDispatcherHostDelegate::HandleExternalProtocol( bool AtomResourceDispatcherHostDelegate::HandleExternalProtocol(
const GURL& url, const GURL& url,
content::ResourceRequestInfo* info) { content::ResourceRequestInfo* info) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&HandleExternalProtocolInUI, base::Bind(&HandleExternalProtocolInUI, url,
url,
info->GetWebContentsGetterForRequest(), info->GetWebContentsGetterForRequest(),
info->HasUserGesture())); info->HasUserGesture()));
return true; return true;
@ -130,16 +126,16 @@ AtomResourceDispatcherHostDelegate::CreateLoginDelegate(
std::unique_ptr<net::ClientCertStore> std::unique_ptr<net::ClientCertStore>
AtomResourceDispatcherHostDelegate::CreateClientCertStore( AtomResourceDispatcherHostDelegate::CreateClientCertStore(
content::ResourceContext* resource_context) { content::ResourceContext* resource_context) {
#if defined(USE_NSS_CERTS) #if defined(USE_NSS_CERTS)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS( return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
net::ClientCertStoreNSS::PasswordDelegateFactory())); net::ClientCertStoreNSS::PasswordDelegateFactory()));
#elif defined(OS_WIN) #elif defined(OS_WIN)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin()); return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac()); return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#elif defined(USE_OPENSSL) #elif defined(USE_OPENSSL)
return std::unique_ptr<net::ClientCertStore>(); return std::unique_ptr<net::ClientCertStore>();
#endif #endif
} }
bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream( bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
@ -153,8 +149,8 @@ bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
int render_process_host_id; int render_process_host_id;
int render_frame_id; int render_frame_id;
if (!info->GetAssociatedRenderFrame(&render_process_host_id, &render_frame_id)) if (!info->GetAssociatedRenderFrame(&render_process_host_id,
{ &render_frame_id)) {
return false; return false;
} }
@ -163,7 +159,8 @@ bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
content::BrowserThread::PostTask( content::BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE, BrowserThread::UI, FROM_HERE,
base::Bind(&OnPdfResourceIntercepted, request->url(), base::Bind(&OnPdfResourceIntercepted, request->url(),
render_process_host_id, render_frame_id, info->GetWebContentsGetterForRequest())); render_process_host_id, render_frame_id,
info->GetWebContentsGetterForRequest()));
return true; return true;
} }
return false; return false;