Skip to content
This repository was archived by the owner on Jan 4, 2019. It is now read-only.

Chromium ContentBrowserclient Embedder api IsHandledUrl was not impl… #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions brave/browser/brave_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "gpu/config/gpu_switches.h"
#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
#include "net/base/filename_util.h"
#include "net/url_request/url_request.h"
#include "services/data_decoder/public/interfaces/constants.mojom.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
Expand Down Expand Up @@ -713,4 +714,28 @@ void BraveContentBrowserClient::InitFrameInterfaces() {
BindPasswordManagerDriver));
}

bool BraveContentBrowserClient::IsHandledURL(const GURL& url) {
if (!url.is_valid())
return false;
// Keep in sync with ProtocolHandlers added by
// AtomBrowserContext::GetURLRequestContext().
static const char* const kProtocolList[] = {
url::kDataScheme,
url::kFileScheme,
url::kFtpScheme,
content::kChromeDevToolsScheme,
#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::kExtensionScheme,
#endif
content::kChromeUIScheme,
url::kAboutScheme,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also have url::kDataScheme and url::kBlobScheme?

};

for (size_t i = 0; i < arraysize(kProtocolList); ++i) {
if (url.scheme() == kProtocolList[i])
return true;
}
return net::URLRequest::IsHandledProtocol(url.scheme());
}

} // namespace brave
2 changes: 2 additions & 0 deletions brave/browser/brave_content_browser_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ class BraveContentBrowserClient : public atom::AtomBrowserClient {
CreateThrottlesForNavigation(
content::NavigationHandle* handle) override;

bool IsHandledURL(const GURL& url) override;

protected:
bool IsValidStoragePartitionId(
content::BrowserContext* browser_context,
Expand Down