mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-05 22:48:06 +01:00
49a34d9160
Add "cef/" prefix for CEF #includes in libcef/ directory. Sort #includes by following https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
32 lines
986 B
C++
32 lines
986 B
C++
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights
|
|
// reserved. Use of this source code is governed by a BSD-style license that can
|
|
// be found in the LICENSE file.
|
|
|
|
#include "base/logging.h"
|
|
#include "cef/include/cef_scheme.h"
|
|
#include "cef/libcef/browser/context.h"
|
|
|
|
bool CefRegisterSchemeHandlerFactory(
|
|
const CefString& scheme_name,
|
|
const CefString& domain_name,
|
|
CefRefPtr<CefSchemeHandlerFactory> factory) {
|
|
// Verify that the context is in a valid state.
|
|
if (!CONTEXT_STATE_VALID()) {
|
|
DCHECK(false) << "context not valid";
|
|
return false;
|
|
}
|
|
|
|
return CefRequestContext::GetGlobalContext()->RegisterSchemeHandlerFactory(
|
|
scheme_name, domain_name, factory);
|
|
}
|
|
|
|
bool CefClearSchemeHandlerFactories() {
|
|
// Verify that the context is in a valid state.
|
|
if (!CONTEXT_STATE_VALID()) {
|
|
DCHECK(false) << "context not valid";
|
|
return false;
|
|
}
|
|
|
|
return CefRequestContext::GetGlobalContext()->ClearSchemeHandlerFactories();
|
|
}
|