diff --git a/brightray/CPPLINT.cfg b/brightray/CPPLINT.cfg index 3ca9f82ea820..01e99482f2b0 100644 --- a/brightray/CPPLINT.cfg +++ b/brightray/CPPLINT.cfg @@ -1,2 +1 @@ filter=-build/header_guard,-build/include_what_you_use,-legal/copyright,-runtime/references -linelength=100 diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index c34b6613d387..8c39df65cc0e 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -68,7 +68,8 @@ content::MediaObserver* BrowserClient::GetMediaObserver() { return MediaCaptureDevicesDispatcher::GetInstance(); } -content::PlatformNotificationService* BrowserClient::GetPlatformNotificationService() { +content::PlatformNotificationService* +BrowserClient::GetPlatformNotificationService() { if (!notification_service_) notification_service_.reset(new PlatformNotificationService(this)); return notification_service_.get(); diff --git a/brightray/browser/browser_client.h b/brightray/browser/browser_client.h index e810a44fadcd..574103b91ca3 100644 --- a/brightray/browser/browser_client.h +++ b/brightray/browser/browser_client.h @@ -39,7 +39,8 @@ class BrowserClient : public content::ContentBrowserClient { content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams&) override; content::MediaObserver* GetMediaObserver() override; - content::PlatformNotificationService* GetPlatformNotificationService() override; + content::PlatformNotificationService* GetPlatformNotificationService() + override; void GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_schemes) override; net::NetLog* GetNetLog() override; diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 2a17e3274532..46f76302d74b 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -94,7 +94,8 @@ BrowserContext::BrowserContext(const std::string& partition, bool in_memory) if (!in_memory_ && !partition.empty()) path_ = path_.Append(FILE_PATH_LITERAL("Partitions")) - .Append(base::FilePath::FromUTF8Unsafe(MakePartitionName(partition))); + .Append(base::FilePath::FromUTF8Unsafe( + MakePartitionName(partition))); content::BrowserContext::Initialize(this, path_); @@ -168,8 +169,8 @@ base::FilePath BrowserContext::GetPath() const { return path_; } -std::unique_ptr BrowserContext::CreateZoomLevelDelegate( - const base::FilePath& partition_path) { +std::unique_ptr +BrowserContext::CreateZoomLevelDelegate(const base::FilePath& partition_path) { if (!IsOffTheRecord()) { return base::MakeUnique(prefs(), partition_path); } @@ -210,7 +211,8 @@ content::PermissionManager* BrowserContext::GetPermissionManager() { return permission_manager_.get(); } -content::BackgroundSyncController* BrowserContext::GetBackgroundSyncController() { +content::BackgroundSyncController* +BrowserContext::GetBackgroundSyncController() { return nullptr; } diff --git a/brightray/browser/inspectable_web_contents.h b/brightray/browser/inspectable_web_contents.h index a862344e2fb3..44c0c22ec647 100644 --- a/brightray/browser/inspectable_web_contents.h +++ b/brightray/browser/inspectable_web_contents.h @@ -18,7 +18,8 @@ class InspectableWebContentsView; class InspectableWebContents { public: - static InspectableWebContents* Create(const content::WebContents::CreateParams&); + static InspectableWebContents* Create( + const content::WebContents::CreateParams&); // The returned InspectableWebContents takes ownership of the passed-in // WebContents. diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 4f4100eb6783..540cb2feb774 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -136,7 +136,8 @@ GURL GetDevToolsURL(bool can_dock) { class ResponseWriter : public net::URLFetcherResponseWriter { public: - ResponseWriter(base::WeakPtr bindings, int stream_id); + ResponseWriter(base::WeakPtr bindings, + int stream_id); ~ResponseWriter() override; // URLFetcherResponseWriter overrides: @@ -153,8 +154,9 @@ class ResponseWriter : public net::URLFetcherResponseWriter { DISALLOW_COPY_AND_ASSIGN(ResponseWriter); }; -ResponseWriter::ResponseWriter(base::WeakPtr bindings, - int stream_id) +ResponseWriter::ResponseWriter( + base::WeakPtr bindings, + int stream_id) : bindings_(bindings), stream_id_(stream_id) { } @@ -207,7 +209,8 @@ InspectableWebContentsImpl::InspectableWebContentsImpl( delegate_(nullptr), web_contents_(web_contents), weak_factory_(this) { - auto context = static_cast(web_contents_->GetBrowserContext()); + auto context = + static_cast(web_contents_->GetBrowserContext()); pref_service_ = context->prefs(); auto bounds_dict = pref_service_->GetDictionary(kDevToolsBoundsPref); if (bounds_dict) { @@ -226,8 +229,10 @@ InspectableWebContentsImpl::InspectableWebContentsImpl( display = display::Screen::GetScreen()->GetPrimaryDisplay().bounds(); } - devtools_bounds_.set_x(display.x() + (display.width() - devtools_bounds_.width()) / 2); - devtools_bounds_.set_y(display.y() + (display.height() - devtools_bounds_.height()) / 2); + devtools_bounds_.set_x(display.x() + + (display.width() - devtools_bounds_.width()) / 2); + devtools_bounds_.set_y( + display.y() + (display.height() - devtools_bounds_.height()) / 2); } } @@ -246,7 +251,8 @@ content::WebContents* InspectableWebContentsImpl::GetWebContents() const { return web_contents_.get(); } -content::WebContents* InspectableWebContentsImpl::GetDevToolsWebContents() const { +content::WebContents* InspectableWebContentsImpl::GetDevToolsWebContents() + const { return devtools_web_contents_.get(); } @@ -255,11 +261,13 @@ void InspectableWebContentsImpl::InspectElement(int x, int y) { agent_host_->InspectElement(this, x, y); } -void InspectableWebContentsImpl::SetDelegate(InspectableWebContentsDelegate* delegate) { +void InspectableWebContentsImpl::SetDelegate( + InspectableWebContentsDelegate* delegate) { delegate_ = delegate; } -InspectableWebContentsDelegate* InspectableWebContentsImpl::GetDelegate() const { +InspectableWebContentsDelegate* InspectableWebContentsImpl::GetDelegate() + const { return delegate_; } @@ -279,7 +287,8 @@ void InspectableWebContentsImpl::ShowDevTools() { embedder_message_dispatcher_.reset( DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend(this)); - content::WebContents::CreateParams create_params(web_contents_->GetBrowserContext()); + content::WebContents::CreateParams create_params( + web_contents_->GetBrowserContext()); devtools_web_contents_.reset(content::WebContents::Create(create_params)); Observe(devtools_web_contents_.get()); @@ -324,10 +333,11 @@ void InspectableWebContentsImpl::Detach() { agent_host_ = nullptr; } -void InspectableWebContentsImpl::CallClientFunction(const std::string& function_name, - const base::Value* arg1, - const base::Value* arg2, - const base::Value* arg3) { +void InspectableWebContentsImpl::CallClientFunction( + const std::string& function_name, + const base::Value* arg1, + const base::Value* arg2, + const base::Value* arg3) { if (!devtools_web_contents_) return; @@ -433,15 +443,17 @@ void InspectableWebContentsImpl::LoadNetworkResource( return; } - auto browser_context = static_cast(devtools_web_contents_->GetBrowserContext()); + auto browser_context = + static_cast(devtools_web_contents_->GetBrowserContext()); net::URLFetcher* fetcher = (net::URLFetcher::Create(gurl, net::URLFetcher::GET, this)).release(); pending_requests_[fetcher] = callback; fetcher->SetRequestContext(browser_context->url_request_context_getter()); fetcher->SetExtraRequestHeaders(headers); - fetcher->SaveResponseWithWriter(std::unique_ptr( - new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); + fetcher->SaveResponseWithWriter( + std::unique_ptr( + new ResponseWriter(weak_factory_.GetWeakPtr(), stream_id))); fetcher->Start(); } @@ -509,7 +521,8 @@ void InspectableWebContentsImpl::SearchInPath( delegate_->DevToolsSearchInPath(request_id, file_system_path, query); } -void InspectableWebContentsImpl::SetWhitelistedShortcuts(const std::string& message) { +void InspectableWebContentsImpl::SetWhitelistedShortcuts( + const std::string& message) { } void InspectableWebContentsImpl::ZoomIn() { @@ -548,16 +561,18 @@ void InspectableWebContentsImpl::DispatchProtocolMessageFromDevToolsFrontend( agent_host_->DispatchProtocolMessage(this, message); } -void InspectableWebContentsImpl::RecordActionUMA(const std::string& name, int action) { +void InspectableWebContentsImpl::RecordActionUMA(const std::string& name, + int action) { if (name == kDevToolsActionTakenHistogram) UMA_HISTOGRAM_ENUMERATION(name, action, kDevToolsActionTakenBoundary); else if (name == kDevToolsPanelShownHistogram) UMA_HISTOGRAM_ENUMERATION(name, action, kDevToolsPanelShownBoundary); } -void InspectableWebContentsImpl::SendJsonRequest(const DispatchCallback& callback, - const std::string& browser_id, - const std::string& url) { +void InspectableWebContentsImpl::SendJsonRequest( + const DispatchCallback& callback, + const std::string& browser_id, + const std::string& url) { callback.Run(nullptr); } @@ -584,7 +599,8 @@ void InspectableWebContentsImpl::ClearPreferences() { update.Get()->Clear(); } -void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend(const std::string& message) { +void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend( + const std::string& message) { std::string method; base::ListValue empty_params; base::ListValue* params = &empty_params; @@ -728,14 +744,14 @@ void InspectableWebContentsImpl::OnWebContentsFocused() { void InspectableWebContentsImpl::DidStartNavigationToPendingEntry( const GURL& url, content::ReloadType reload_type) { - frontend_host_.reset( - content::DevToolsFrontendHost::Create( - web_contents()->GetMainFrame(), - base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend, - base::Unretained(this)))); + frontend_host_.reset(content::DevToolsFrontendHost::Create( + web_contents()->GetMainFrame(), + base::Bind(&InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend, + base::Unretained(this)))); } -void InspectableWebContentsImpl::OnURLFetchComplete(const net::URLFetcher* source) { +void InspectableWebContentsImpl::OnURLFetchComplete( + const net::URLFetcher* source) { DCHECK(source); auto it = pending_requests_.find(source); DCHECK(it != pending_requests_.end()); diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 9b565f0f2ddf..2f000c210227 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -173,7 +173,8 @@ class InspectableWebContentsImpl : bool frontend_loaded_; scoped_refptr agent_host_; std::unique_ptr frontend_host_; - std::unique_ptr embedder_message_dispatcher_; + std::unique_ptr + embedder_message_dispatcher_; DevToolsContentsResizingStrategy contents_resizing_strategy_; gfx::Rect devtools_bounds_; diff --git a/brightray/browser/linux/libnotify_loader.cc b/brightray/browser/linux/libnotify_loader.cc index 747108529ae1..5510bc23cf3b 100644 --- a/brightray/browser/linux/libnotify_loader.cc +++ b/brightray/browser/linux/libnotify_loader.cc @@ -1,5 +1,6 @@ // This is generated file. Do not modify directly. -// Path to the code generator: tools/generate_library_loader/generate_library_loader.py . +// Path to the code generator: +// tools/generate_library_loader/generate_library_loader.py . #include "browser/linux/libnotify_loader.h" @@ -68,9 +69,9 @@ bool LibNotifyLoader::Load(const std::string& library_name) { return false; } - notify_notification_set_image_from_pixbuf = - reinterpret_castnotify_notification_set_image_from_pixbuf)>( - dlsym(library_, "notify_notification_set_image_from_pixbuf")); + notify_notification_set_image_from_pixbuf = reinterpret_castnotify_notification_set_image_from_pixbuf)>( + dlsym(library_, "notify_notification_set_image_from_pixbuf")); if (!notify_notification_set_image_from_pixbuf) { CleanUp(true); return false; diff --git a/brightray/browser/linux/libnotify_loader.h b/brightray/browser/linux/libnotify_loader.h index 48fda0b632ab..a48f4794147f 100644 --- a/brightray/browser/linux/libnotify_loader.h +++ b/brightray/browser/linux/libnotify_loader.h @@ -1,5 +1,6 @@ // This is generated file. Do not modify directly. -// Path to the code generator: tools/generate_library_loader/generate_library_loader.py . +// Path to the code generator: +// tools/generate_library_loader/generate_library_loader.py . #ifndef BRIGHTRAY_BROWSER_LINUX_LIBNOTIFY_LOADER_H_ #define BRIGHTRAY_BROWSER_LINUX_LIBNOTIFY_LOADER_H_ @@ -24,9 +25,11 @@ class LibNotifyLoader { decltype(&::notify_get_server_info) notify_get_server_info; decltype(&::notify_notification_new) notify_notification_new; decltype(&::notify_notification_add_action) notify_notification_add_action; - decltype(&::notify_notification_set_image_from_pixbuf) notify_notification_set_image_from_pixbuf; + decltype(&::notify_notification_set_image_from_pixbuf) + notify_notification_set_image_from_pixbuf; decltype(&::notify_notification_set_timeout) notify_notification_set_timeout; - decltype(&::notify_notification_set_hint_string) notify_notification_set_hint_string; + decltype(&::notify_notification_set_hint_string) + notify_notification_set_hint_string; decltype(&::notify_notification_show) notify_notification_show; decltype(&::notify_notification_close) notify_notification_close; diff --git a/brightray/browser/linux/libnotify_notification.cc b/brightray/browser/linux/libnotify_notification.cc index ab296e21831e..aea7b7cc42d2 100644 --- a/brightray/browser/linux/libnotify_notification.cc +++ b/brightray/browser/linux/libnotify_notification.cc @@ -22,7 +22,8 @@ bool HasCapability(const std::string& capability) { bool result = false; GList* capabilities = libnotify_loader_.notify_get_server_caps(); - if (g_list_find_custom(capabilities, capability.c_str(), (GCompareFunc) g_strcmp0) != NULL) + if (g_list_find_custom(capabilities, capability.c_str(), + (GCompareFunc)g_strcmp0) != NULL) result = true; g_list_free_full(capabilities, g_free); diff --git a/brightray/browser/media/media_stream_devices_controller.cc b/brightray/browser/media/media_stream_devices_controller.cc index a744a08ae4dc..c01749ab43d2 100644 --- a/brightray/browser/media/media_stream_devices_controller.cc +++ b/brightray/browser/media/media_stream_devices_controller.cc @@ -142,10 +142,12 @@ void MediaStreamDevicesController::Accept() { content::MediaResponseCallback cb = callback_; callback_.Reset(); - cb.Run(devices, content::MEDIA_DEVICE_OK, std::unique_ptr()); + cb.Run(devices, content::MEDIA_DEVICE_OK, + std::unique_ptr()); } -void MediaStreamDevicesController::Deny(content::MediaStreamRequestResult result) { +void MediaStreamDevicesController::Deny( + content::MediaStreamRequestResult result) { content::MediaResponseCallback cb = callback_; callback_.Reset(); cb.Run(content::MediaStreamDevices(), diff --git a/brightray/browser/net/devtools_network_controller.h b/brightray/browser/net/devtools_network_controller.h index 02bb69855941..7e6c948b42b9 100644 --- a/brightray/browser/net/devtools_network_controller.h +++ b/brightray/browser/net/devtools_network_controller.h @@ -24,8 +24,9 @@ class DevToolsNetworkController { DevToolsNetworkInterceptor* GetInterceptor(const std::string& client_id); private: - using InterceptorMap = base::ScopedPtrHashMap>; + using InterceptorMap = + base::ScopedPtrHashMap>; std::unique_ptr appcache_interceptor_; InterceptorMap interceptors_; diff --git a/brightray/browser/net/devtools_network_controller_handle.h b/brightray/browser/net/devtools_network_controller_handle.h index b5c861f5cd6c..2d038e837f80 100644 --- a/brightray/browser/net/devtools_network_controller_handle.h +++ b/brightray/browser/net/devtools_network_controller_handle.h @@ -31,8 +31,9 @@ class DevToolsNetworkControllerHandle { private: void LazyInitialize(); - void SetNetworkStateOnIO(const std::string& client_id, - std::unique_ptr conditions); + void SetNetworkStateOnIO( + const std::string& client_id, + std::unique_ptr conditions); std::unique_ptr controller_; diff --git a/brightray/browser/net/devtools_network_protocol_handler.cc b/brightray/browser/net/devtools_network_protocol_handler.cc index 584840533be9..58988577b432 100644 --- a/brightray/browser/net/devtools_network_protocol_handler.cc +++ b/brightray/browser/net/devtools_network_protocol_handler.cc @@ -30,7 +30,8 @@ const char kErrorMessage[] = "message"; } // namespace params const char kEmulateNetworkConditions[] = "Network.emulateNetworkConditions"; -const char kCanEmulateNetworkConditions[] = "Network.canEmulateNetworkConditions"; +const char kCanEmulateNetworkConditions[] = + "Network.canEmulateNetworkConditions"; const char kId[] = "id"; const char kMethod[] = "method"; const char kParams[] = "params"; diff --git a/brightray/browser/net/devtools_network_transaction_factory.h b/brightray/browser/net/devtools_network_transaction_factory.h index a6c8f6a3c2dd..49286a04742d 100644 --- a/brightray/browser/net/devtools_network_transaction_factory.h +++ b/brightray/browser/net/devtools_network_transaction_factory.h @@ -21,13 +21,14 @@ class DevToolsNetworkTransactionFactory : public net::HttpTransactionFactory { ~DevToolsNetworkTransactionFactory() override; // net::HttpTransactionFactory: - int CreateTransaction(net::RequestPriority priority, - std::unique_ptr* transaction) override; + int CreateTransaction( + net::RequestPriority priority, + std::unique_ptr* transaction) override; net::HttpCache* GetCache() override; net::HttpNetworkSession* GetSession() override; private: - DevToolsNetworkController* controller_; + DevToolsNetworkController* controller_; std::unique_ptr network_layer_; DISALLOW_COPY_AND_ASSIGN(DevToolsNetworkTransactionFactory); diff --git a/brightray/browser/net_log.cc b/brightray/browser/net_log.cc index f141c7ef2e43..6b41eb738c1b 100644 --- a/brightray/browser/net_log.cc +++ b/brightray/browser/net_log.cc @@ -40,7 +40,8 @@ void NetLog::StartLogging(net::URLRequestContext* url_request_context) { if (!command_line->HasSwitch(switches::kLogNetLog)) return; - base::FilePath log_path = command_line->GetSwitchValuePath(switches::kLogNetLog); + base::FilePath log_path = + command_line->GetSwitchValuePath(switches::kLogNetLog); #if defined(OS_WIN) log_file_.reset(_wfopen(log_path.value().c_str(), L"w")); #elif defined(OS_POSIX) diff --git a/brightray/browser/network_delegate.cc b/brightray/browser/network_delegate.cc index e0ef20bb57bb..2af03e0f959f 100644 --- a/brightray/browser/network_delegate.cc +++ b/brightray/browser/network_delegate.cc @@ -25,7 +25,8 @@ const char kIgnoreConnectionsLimit[] = "ignore-connections-limit"; NetworkDelegate::NetworkDelegate() { auto command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(kIgnoreConnectionsLimit)) { - std::string value = command_line->GetSwitchValueASCII(kIgnoreConnectionsLimit); + std::string value = + command_line->GetSwitchValueASCII(kIgnoreConnectionsLimit); ignore_connections_limit_domains_ = base::SplitString( value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); } diff --git a/brightray/browser/permission_manager.h b/brightray/browser/permission_manager.h index 67168ed2b312..7e9a283913f3 100644 --- a/brightray/browser/permission_manager.h +++ b/brightray/browser/permission_manager.h @@ -22,14 +22,16 @@ class PermissionManager : public content::PermissionManager { content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, bool user_gesture, - const base::Callback& callback) override; + const base::Callback& callback) + override; int RequestPermissions( const std::vector& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, bool user_gesture, - const base::Callback&)>& callback) override; + const base::Callback< + void(const std::vector&)>& callback) + override; void CancelPermissionRequest(int request_id) override; void ResetPermission(content::PermissionType permission, const GURL& requesting_origin, @@ -45,7 +47,8 @@ class PermissionManager : public content::PermissionManager { content::PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin, - const base::Callback& callback) override; + const base::Callback& callback) + override; void UnsubscribePermissionStatusChange(int subscription_id) override; private: diff --git a/brightray/browser/platform_notification_service.cc b/brightray/browser/platform_notification_service.cc index 3fa04e0814cf..8f9f16a2c17f 100644 --- a/brightray/browser/platform_notification_service.cc +++ b/brightray/browser/platform_notification_service.cc @@ -45,7 +45,8 @@ PlatformNotificationService::PlatformNotificationService( PlatformNotificationService::~PlatformNotificationService() {} -blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnUIThread( +blink::mojom::PermissionStatus +PlatformNotificationService::CheckPermissionOnUIThread( content::BrowserContext* browser_context, const GURL& origin, int render_process_id) { @@ -53,7 +54,8 @@ blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnUIT return blink::mojom::PermissionStatus::GRANTED; } -blink::mojom::PermissionStatus PlatformNotificationService::CheckPermissionOnIOThread( +blink::mojom::PermissionStatus +PlatformNotificationService::CheckPermissionOnIOThread( content::ResourceContext* resource_context, const GURL& origin, int render_process_id) { diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 3510d00b8448..a9e0a22756b1 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -69,7 +69,8 @@ std::string URLRequestContextGetter::Delegate::GetUserAgent() { std::unique_ptr URLRequestContextGetter::Delegate::CreateURLRequestJobFactory( content::ProtocolHandlerMap* protocol_handlers) { - std::unique_ptr job_factory(new net::URLRequestJobFactoryImpl); + std::unique_ptr job_factory( + new net::URLRequestJobFactoryImpl); for (auto& it : *protocol_handlers) { job_factory->SetProtocolHandler( @@ -89,7 +90,8 @@ URLRequestContextGetter::Delegate::CreateURLRequestJobFactory( } net::HttpCache::BackendFactory* -URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory(const base::FilePath& base_path) { +URLRequestContextGetter::Delegate::CreateHttpCacheBackendFactory( + const base::FilePath& base_path) { base::FilePath cache_path = base_path.Append(FILE_PATH_LITERAL("Cache")); return new net::HttpCache::DefaultBackend( net::DISK_CACHE, @@ -104,11 +106,13 @@ URLRequestContextGetter::Delegate::CreateCertVerifier() { return net::CertVerifier::CreateDefault(); } -net::SSLConfigService* URLRequestContextGetter::Delegate::CreateSSLConfigService() { +net::SSLConfigService* +URLRequestContextGetter::Delegate::CreateSSLConfigService() { return new net::SSLConfigServiceDefaults; } -std::vector URLRequestContextGetter::Delegate::GetCookieableSchemes() { +std::vector +URLRequestContextGetter::Delegate::GetCookieableSchemes() { return { "http", "https", "ws", "wss" }; } @@ -177,7 +181,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { network_delegate_.reset(delegate_->CreateNetworkDelegate()); url_request_context_->set_network_delegate(network_delegate_.get()); - storage_.reset(new net::URLRequestContextStorage(url_request_context_.get())); + storage_.reset( + new net::URLRequestContextStorage(url_request_context_.get())); auto cookie_path = in_memory_ ? base::FilePath() : base_path_.Append(FILE_PATH_LITERAL("Cookies")); @@ -261,7 +266,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { // --auth-negotiate-delegate-whitelist if (command_line.HasSwitch(switches::kAuthNegotiateDelegateWhitelist)) { http_auth_preferences_->set_delegate_whitelist( - command_line.GetSwitchValueASCII(switches::kAuthNegotiateDelegateWhitelist)); + command_line.GetSwitchValueASCII( + switches::kAuthNegotiateDelegateWhitelist)); } auto auth_handler_factory = @@ -309,7 +315,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { // Give |storage_| ownership at the end in case it's |mapped_host_resolver|. storage_->set_host_resolver(std::move(host_resolver)); - network_session_params.host_resolver = url_request_context_->host_resolver(); + network_session_params.host_resolver = + url_request_context_->host_resolver(); http_network_session_.reset( new net::HttpNetworkSession(network_session_params)); @@ -324,7 +331,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { storage_->set_http_transaction_factory(base::WrapUnique( new net::HttpCache( base::WrapUnique(new DevToolsNetworkTransactionFactory( - network_controller_handle_->GetController(), http_network_session_.get())), + network_controller_handle_->GetController(), + http_network_session_.get())), std::move(backend), false))); } else { @@ -356,7 +364,8 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { return url_request_context_.get(); } -scoped_refptr URLRequestContextGetter::GetNetworkTaskRunner() const { +scoped_refptr +URLRequestContextGetter::GetNetworkTaskRunner() const { return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); } diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index e08189d862d4..c09824d44bea 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -47,8 +47,7 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { } virtual std::string GetUserAgent(); virtual std::unique_ptr - CreateURLRequestJobFactory( - content::ProtocolHandlerMap* protocol_handlers); + CreateURLRequestJobFactory(content::ProtocolHandlerMap* protocol_handlers); virtual net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory( const base::FilePath& base_path); virtual std::unique_ptr CreateCertVerifier(); @@ -75,7 +74,8 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { // net::URLRequestContextGetter: net::URLRequestContext* GetURLRequestContext() override; - scoped_refptr GetNetworkTaskRunner() const override; + scoped_refptr GetNetworkTaskRunner() + const override; net::HostResolver* host_resolver(); net::URLRequestJobFactory* job_factory() const { return job_factory_; } diff --git a/brightray/browser/views/inspectable_web_contents_view_views.cc b/brightray/browser/views/inspectable_web_contents_view_views.cc index fb1f8493cd9f..13efd4be7527 100644 --- a/brightray/browser/views/inspectable_web_contents_view_views.cc +++ b/brightray/browser/views/inspectable_web_contents_view_views.cc @@ -48,7 +48,9 @@ class DevToolsWindowDelegate : public views::ClientView, views::Widget* GetWidget() override { return widget_; } const views::Widget* GetWidget() const override { return widget_; } views::View* GetContentsView() override { return view_; } - views::ClientView* CreateClientView(views::Widget* widget) override { return this; } + views::ClientView* CreateClientView(views::Widget* widget) override { + return this; + } // views::ClientView: bool CanClose() override { @@ -85,10 +87,12 @@ InspectableWebContentsViewViews::InspectableWebContentsViewViews( if (inspectable_web_contents_->GetWebContents()->GetNativeView()) { views::WebView* contents_web_view = new views::WebView(nullptr); - contents_web_view->SetWebContents(inspectable_web_contents_->GetWebContents()); + contents_web_view->SetWebContents( + inspectable_web_contents_->GetWebContents()); contents_web_view_ = contents_web_view; } else { - contents_web_view_ = new views::Label(base::ASCIIToUTF16("No content under offscreen mode")); + contents_web_view_ = new views::Label( + base::ASCIIToUTF16("No content under offscreen mode")); } devtools_web_view_->SetVisible(false); @@ -98,7 +102,8 @@ InspectableWebContentsViewViews::InspectableWebContentsViewViews( InspectableWebContentsViewViews::~InspectableWebContentsViewViews() { if (devtools_window_) - inspectable_web_contents()->SaveDevToolsBounds(devtools_window_->GetWindowBoundsInScreen()); + inspectable_web_contents()->SaveDevToolsBounds( + devtools_window_->GetWindowBoundsInScreen()); } views::View* InspectableWebContentsViewViews::GetView() { @@ -117,7 +122,8 @@ void InspectableWebContentsViewViews::ShowDevTools() { if (devtools_window_) { devtools_window_web_view_->SetWebContents( inspectable_web_contents_->GetDevToolsWebContents()); - devtools_window_->SetBounds(inspectable_web_contents()->GetDevToolsBounds()); + devtools_window_->SetBounds( + inspectable_web_contents()->GetDevToolsBounds()); devtools_window_->Show(); } else { devtools_web_view_->SetVisible(true); @@ -134,7 +140,8 @@ void InspectableWebContentsViewViews::CloseDevTools() { devtools_visible_ = false; if (devtools_window_) { - inspectable_web_contents()->SaveDevToolsBounds(devtools_window_->GetWindowBoundsInScreen()); + inspectable_web_contents()->SaveDevToolsBounds( + devtools_window_->GetWindowBoundsInScreen()); devtools_window_.reset(); devtools_window_web_view_ = nullptr; devtools_window_delegate_ = nullptr; @@ -164,9 +171,10 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked) { if (!docked) { devtools_window_.reset(new views::Widget); devtools_window_web_view_ = new views::WebView(NULL); - devtools_window_delegate_ = new DevToolsWindowDelegate(this, - devtools_window_web_view_, - devtools_window_.get()); + devtools_window_delegate_ = new DevToolsWindowDelegate( + this, + devtools_window_web_view_ + devtools_window_.get()); views::Widget::InitParams params; params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; @@ -176,7 +184,8 @@ void InspectableWebContentsViewViews::SetIsDocked(bool docked) { #if defined(USE_X11) params.wm_role_name = "devtools"; if (GetDelegate()) - GetDelegate()->GetDevToolsWindowWMClass(¶ms.wm_class_name, ¶ms.wm_class_class); + GetDelegate()->GetDevToolsWindowWMClass(¶ms.wm_class_name, + ¶ms.wm_class_class); #endif devtools_window_->Init(params); diff --git a/brightray/browser/views/views_delegate.cc b/brightray/browser/views/views_delegate.cc index 8dcbe38ae209..99797dea4adc 100644 --- a/brightray/browser/views/views_delegate.cc +++ b/brightray/browser/views/views_delegate.cc @@ -48,7 +48,8 @@ void ViewsDelegate::NotifyMenuItemFocused( #if defined(OS_WIN) HICON ViewsDelegate::GetDefaultWindowIcon() const { // Use current exe's icon as default window icon. - return LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(1 /* IDR_MAINFRAME */)); + return LoadIcon(GetModuleHandle(NULL), + MAKEINTRESOURCE(1 /* IDR_MAINFRAME */)); } HICON ViewsDelegate::GetSmallWindowIcon() const { diff --git a/brightray/browser/win/notification_presenter_win.cc b/brightray/browser/win/notification_presenter_win.cc index 6e913ea37ff8..c185246809e3 100644 --- a/brightray/browser/win/notification_presenter_win.cc +++ b/brightray/browser/win/notification_presenter_win.cc @@ -38,7 +38,8 @@ bool SaveIconToPath(const SkBitmap& bitmap, const base::FilePath& path) { NotificationPresenter* NotificationPresenter::Create() { if (!WindowsToastNotification::Initialize()) return nullptr; - std::unique_ptr presenter(new NotificationPresenterWin); + std::unique_ptr presenter( + new NotificationPresenterWin); if (!presenter->Init()) return nullptr; return presenter.release(); diff --git a/brightray/browser/win/notification_presenter_win.h b/brightray/browser/win/notification_presenter_win.h index 69b89f4ae5da..c3e6a9ad43f5 100644 --- a/brightray/browser/win/notification_presenter_win.h +++ b/brightray/browser/win/notification_presenter_win.h @@ -10,9 +10,15 @@ // icon: "file:///C:/Path/To/Your/Image.png" // }); -// windowsNotification.onshow = function () { console.log("Notification shown") }; -// windowsNotification.onclick = function () { console.log("Notification clicked") }; -// windowsNotification.onclose = function () { console.log("Notification dismissed") }; +// windowsNotification.onshow = function () { +// console.log("Notification shown") +// }; +// windowsNotification.onclick = function () { +// console.log("Notification clicked") +// }; +// windowsNotification.onclose = function () { +// console.log("Notification dismissed") +// }; #ifndef BRIGHTRAY_BROWSER_WIN_NOTIFICATION_PRESENTER_WIN_H_ #define BRIGHTRAY_BROWSER_WIN_NOTIFICATION_PRESENTER_WIN_H_ diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index 3645f53f478b..4551ddfa0aa1 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -61,9 +61,9 @@ void InitializeResourceBundle(const std::string& locale) { bundle.AddDataPackFromPath( pak_dir.Append(FILE_PATH_LITERAL("pdf_viewer_resources.pak")), ui::GetSupportedScaleFactors()[0]); - bundle.AddDataPackFromPath( - pak_dir.Append(FILE_PATH_LITERAL("blink_image_resources_200_percent.pak")), - ui::SCALE_FACTOR_200P); + bundle.AddDataPackFromPath(pak_dir.Append(FILE_PATH_LITERAL( + "blink_image_resources_200_percent.pak")), + ui::SCALE_FACTOR_200P); bundle.AddDataPackFromPath( pak_dir.Append(FILE_PATH_LITERAL("content_resources_200_percent.pak")), ui::SCALE_FACTOR_200P); @@ -76,7 +76,6 @@ void InitializeResourceBundle(const std::string& locale) { #endif } - MainDelegate::MainDelegate() { } diff --git a/brightray/common/switches.cc b/brightray/common/switches.cc index c46fe3bda974..1f0da2adfddf 100644 --- a/brightray/common/switches.cc +++ b/brightray/common/switches.cc @@ -47,7 +47,8 @@ const char kDisableHttp2[] = "disable-http2"; const char kAuthServerWhitelist[] = "auth-server-whitelist"; // Whitelist containing servers for which Kerberos delegation is allowed. -const char kAuthNegotiateDelegateWhitelist[] = "auth-negotiate-delegate-whitelist"; +const char kAuthNegotiateDelegateWhitelist[] = + "auth-negotiate-delegate-whitelist"; // Ignores certificate-related errors. const char kIgnoreCertificateErrors[] = "ignore-certificate-errors";