mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-14 02:24:03 +01:00
1d39ff720e
The Chrome browser can now be hosted in a Views-based application on Mac (see issue #2969). To launch a fully-featured Chrome window using cefsimple: $ open cefsimple.app --args --enable-chrome-runtime To launch a minimally-styled Views-hosted window using cefsimple: $ open cefsimple.app --args --use-views [--enable-chrome-runtime] To launch a fully-styled Views-hosted window using cefclient: $ open cefclient.app --args --use-views [--enable-chrome-runtime] Known issues: - Some Views unit tests are currently failing on Mac.
33 lines
847 B
Plaintext
33 lines
847 B
Plaintext
// Copyright 2021 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.
|
|
|
|
#include "libcef/browser/views/view_util.h"
|
|
|
|
#include "include/internal/cef_types_mac.h"
|
|
|
|
#include "ui/views/widget/widget.h"
|
|
|
|
namespace view_util {
|
|
|
|
gfx::NativeWindow GetNativeWindow(views::Widget* widget) {
|
|
if (widget)
|
|
return widget->GetNativeWindow();
|
|
return gfx::NativeWindow();
|
|
}
|
|
|
|
gfx::NativeView GetNativeView(views::Widget* widget) {
|
|
if (widget)
|
|
return widget->GetNativeView();
|
|
return gfx::NativeView();
|
|
}
|
|
|
|
CefWindowHandle GetWindowHandle(views::Widget* widget) {
|
|
auto view = GetNativeView(widget);
|
|
if (view)
|
|
return CAST_NSVIEW_TO_CEF_WINDOW_HANDLE(view.GetNativeNSView());
|
|
return kNullWindowHandle;
|
|
}
|
|
|
|
} // namespace view_util
|