Files
cef/tests/cefclient/browser/default_client_handler.h
Marshall Greenblatt f3f516c2d1 Replace DISALLOW_COPY_AND_ASSIGN with explicit deleted declarations (see #3590)
Apply the DISALLOW_COPY_AND_ASSIGN transformation to all CEF source files.
Per Chromium style guide, deleted copy/move declarations are placed in
the public section after constructors.

Changes:
- Transform 97 files in tests/ceftests/, tests/cefclient/, tests/shared/
- Update code examples in tools/claude/*.md documentation
2026-01-22 12:08:50 -05:00

63 lines
2.1 KiB
C++

// Copyright (c) 2023 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.
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_DEFAULT_CLIENT_HANDLER_H_
#define CEF_TESTS_CEFCLIENT_BROWSER_DEFAULT_CLIENT_HANDLER_H_
#pragma once
#include <optional>
#include "tests/cefclient/browser/base_client_handler.h"
namespace client {
// Default client handler for unmanaged browser windows. Used with Chrome
// style only.
class DefaultClientHandler : public BaseClientHandler {
public:
// If |use_alloy_style| is nullopt the global default will be used.
explicit DefaultClientHandler(
std::optional<bool> use_alloy_style = std::nullopt);
DefaultClientHandler(const DefaultClientHandler&) = delete;
DefaultClientHandler& operator=(const DefaultClientHandler&) = delete;
// Returns the DefaultClientHandler for |client|, or nullptr if |client| is
// not a DefaultClientHandler.
static CefRefPtr<DefaultClientHandler> GetForClient(
CefRefPtr<CefClient> client);
protected:
bool OnBeforePopup(
CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int popup_id,
const CefString& target_url,
const CefString& target_frame_name,
CefLifeSpanHandler::WindowOpenDisposition target_disposition,
bool user_gesture,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
CefRefPtr<CefClient>& client,
CefBrowserSettings& settings,
CefRefPtr<CefDictionaryValue>& extra_info,
bool* no_javascript_access) override;
void OnBeforePopupAborted(CefRefPtr<CefBrowser> browser,
int popup_id) override;
void OnBeforeClose(CefRefPtr<CefBrowser> browser) override;
private:
// Used to determine the object type.
virtual const void* GetTypeKey() const override { return &kTypeKey; }
static constexpr int kTypeKey = 0;
const bool use_alloy_style_;
IMPLEMENT_REFCOUNTING(DefaultClientHandler);
};
} // namespace client
#endif // CEF_TESTS_CEFCLIENT_BROWSER_DEFAULT_CLIENT_HANDLER_H_