Skip to content

CefLayout

Header: cef_layout.h
Category: Views Framework

Overview

Browser-process UI toolkit: windows, panels, layouts, buttons, textfields, and their delegates.

CefLayout

Source File: include/views/cef_layout.h

Process / Thread Context: Browser Process / UI Thread. Header states:

Purpose: Base class for layout managers. A CefLayout handles the sizing

Methods

virtual CefRefPtr<CefBoxLayout> AsBoxLayout() = 0

Parameters:

  • none.

Return Value: This layout as a CefBoxLayout, or NULL.

Usage Instruction: Down-cast helper.

Threading Constraint: Browser process UI thread.

virtual CefRefPtr<CefFillLayout> AsFillLayout() = 0

Parameters:

  • none.

Return Value: This layout as a CefFillLayout, or NULL.

Usage Instruction: Down-cast helper.

Threading Constraint: Browser process UI thread.

virtual bool IsValid() = 0

Parameters:

  • none.

Return Value: True if this layout is valid.

Usage Instruction: Verify that the underlying layout object is still

Threading Constraint: Browser process UI thread.

Usage Example

cpp
CefRefPtr<CefLayout> layout = panel->GetLayout();
if (layout && layout->IsValid()) {
  if (auto box = layout->AsBoxLayout()) {
    box->SetFlexForView(child, 1);
  }
}

Derived from the CEF C++ headers — © Marshall A. Greenblatt, Google Inc. & contributors (BSD-style license). Not an official CEF project.