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
|
|
|
|
|
|
|
|
#include "include/views/cef_scroll_view.h"
|
|
|
|
#include "include/views/cef_view_delegate.h"
|
|
|
|
|
|
|
|
#include "libcef/browser/views/scroll_view_view.h"
|
|
|
|
#include "libcef/browser/views/view_impl.h"
|
|
|
|
|
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.
|
|
|
|
CefScrollViewImpl(CefRefPtr<CefViewDelegate> delegate);
|
|
|
|
|
|
|
|
// 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_
|