1 // Copyright 2016 The Chromium Embedded Framework Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be found 3 // in the LICENSE file. 4 5 #ifndef CEF_LIBCEF_BROWSER_VIEWS_BASIC_LABEL_BUTTON_IMPL_H_ 6 #define CEF_LIBCEF_BROWSER_VIEWS_BASIC_LABEL_BUTTON_IMPL_H_ 7 #pragma once 8 9 #include "include/views/cef_button_delegate.h" 10 #include "include/views/cef_label_button.h" 11 12 #include "libcef/browser/views/label_button_impl.h" 13 14 #include "ui/views/controls/button/label_button.h" 15 16 class CefBasicLabelButtonImpl : public CefLabelButtonImpl<views::LabelButton, 17 CefLabelButton, 18 CefButtonDelegate> { 19 public: 20 using ParentClass = 21 CefLabelButtonImpl<views::LabelButton, CefLabelButton, CefButtonDelegate>; 22 23 CefBasicLabelButtonImpl(const CefBasicLabelButtonImpl&) = delete; 24 CefBasicLabelButtonImpl& operator=(const CefBasicLabelButtonImpl&) = delete; 25 26 // Create a new CefLabelButton instance. |delegate| may be nullptr. 27 static CefRefPtr<CefBasicLabelButtonImpl> Create( 28 CefRefPtr<CefButtonDelegate> delegate, 29 const CefString& text); 30 31 // CefViewAdapter methods: GetDebugType()32 std::string GetDebugType() override { return "LabelButton"; } 33 34 private: 35 // Create a new implementation object. 36 // Always call Initialize() after creation. 37 // |delegate| may be nullptr. 38 explicit CefBasicLabelButtonImpl(CefRefPtr<CefButtonDelegate> delegate); 39 40 // CefViewImpl methods: 41 views::LabelButton* CreateRootView() override; 42 void InitializeRootView() override; 43 44 IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefBasicLabelButtonImpl); 45 }; 46 47 #endif // CEF_LIBCEF_BROWSER_VIEWS_BASIC_LABEL_BUTTON_IMPL_H_ 48