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_LAYOUT_ADAPTER_H_ 6 #define CEF_LIBCEF_BROWSER_VIEWS_LAYOUT_ADAPTER_H_ 7 #pragma once 8 9 #include "include/views/cef_layout.h" 10 11 namespace views { 12 class LayoutManager; 13 } 14 15 // Exposes a common interface from all CefLayout implementation objects to 16 // simplify the layout_util implementation. See comments in view_impl.h for a 17 // usage overview. 18 class CefLayoutAdapter { 19 public: CefLayoutAdapter()20 CefLayoutAdapter() {} 21 22 // Returns the CefLayoutAdapter for the specified |layout|. 23 static CefLayoutAdapter* GetFor(CefRefPtr<CefLayout> layout); 24 25 // Returns the underlying views::LayoutManager object. Does not transfer 26 // ownership. 27 virtual views::LayoutManager* Get() const = 0; 28 29 // Release all references to the views::LayoutManager object. This is called 30 // when the views::LayoutManager is deleted after being assigned to a 31 // views::View. 32 virtual void Detach() = 0; 33 34 protected: ~CefLayoutAdapter()35 virtual ~CefLayoutAdapter() {} 36 }; 37 38 #endif // CEF_LIBCEF_BROWSER_VIEWS_LAYOUT_ADAPTER_H_ 39