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_UTIL_H_ 6 #define CEF_LIBCEF_BROWSER_VIEWS_LAYOUT_UTIL_H_ 7 #pragma once 8 9 #include "include/views/cef_layout.h" 10 11 #include "ui/views/layout/layout_manager.h" 12 13 namespace views { 14 class View; 15 } 16 17 // The below functions manage the relationship between CefLayout and 18 // views::LayoutManager instances. See comments in view_impl.h for a usage 19 // overview. 20 21 namespace layout_util { 22 23 // Returns the CefLayout object associated with |owner_view|. 24 CefRefPtr<CefLayout> GetFor(const views::View* owner_view); 25 26 // Assign ownership of |layout| to |owner_view|. If a CefLayout is already 27 // associated with |owner_view| it will be invalidated. 28 void Assign(CefRefPtr<CefLayout> layout, views::View* owner_view); 29 30 } // namespace layout_util 31 32 #endif // CEF_LIBCEF_BROWSER_VIEWS_LAYOUT_UTIL_H_ 33