2016-01-19 21:09:01 +01:00
|
|
|
// Copyright 2016 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_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
2024-04-30 17:45:07 +02:00
|
|
|
#include "cef/include/views/cef_scroll_view.h"
|
|
|
|
#include "cef/include/views/cef_view_delegate.h"
|
|
|
|
#include "cef/libcef/browser/views/scroll_view_view.h"
|
|
|
|
#include "cef/libcef/browser/views/view_impl.h"
|
2016-01-19 21:09:01 +01:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
class CefScrollViewImpl
|
|
|
|
: public CefViewImpl<CefScrollViewView, CefScrollView, CefViewDelegate> {
|
2016-01-19 21:09:01 +01:00
|
|
|
public:
|
2021-12-06 21:40:25 +01:00
|
|
|
using ParentClass =
|
|
|
|
CefViewImpl<CefScrollViewView, CefScrollView, CefViewDelegate>;
|
|
|
|
|
|
|
|
CefScrollViewImpl(const CefScrollViewImpl&) = delete;
|
|
|
|
CefScrollViewImpl& operator=(const CefScrollViewImpl&) = delete;
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
// Create a new CefScrollView instance. |delegate| may be nullptr.
|
|
|
|
static CefRefPtr<CefScrollViewImpl> Create(
|
|
|
|
CefRefPtr<CefViewDelegate> delegate);
|
|
|
|
|
|
|
|
// CefScrollView methods:
|
|
|
|
CefRefPtr<CefScrollView> AsScrollView() override { return this; }
|
|
|
|
void SetContentView(CefRefPtr<CefView> view) override;
|
|
|
|
CefRefPtr<CefView> GetContentView() override;
|
|
|
|
CefRect GetVisibleContentRect() override;
|
|
|
|
bool HasHorizontalScrollbar() override;
|
|
|
|
int GetHorizontalScrollbarHeight() override;
|
|
|
|
bool HasVerticalScrollbar() override;
|
|
|
|
int GetVerticalScrollbarWidth() override;
|
|
|
|
|
|
|
|
// CefViewAdapter methods:
|
|
|
|
std::string GetDebugType() override { return "ScrollView"; }
|
2023-01-30 22:42:40 +01:00
|
|
|
void GetDebugInfo(base::Value::Dict* info, bool include_children) override;
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Create a new implementation object.
|
|
|
|
// Always call Initialize() after creation.
|
|
|
|
// |delegate| may be nullptr.
|
2024-01-20 23:48:57 +01:00
|
|
|
explicit CefScrollViewImpl(CefRefPtr<CefViewDelegate> delegate);
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
// CefViewImpl methods:
|
|
|
|
CefScrollViewView* CreateRootView() override;
|
2016-07-21 23:21:32 +02:00
|
|
|
void InitializeRootView() override;
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefScrollViewImpl);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_VIEWS_SCROLL_VIEW_IMPL_H_
|