Commit Graph

24 Commits

Author SHA1 Message Date
Marshall Greenblatt dad9bf87ef Stop using CefStructBase for POD types (fixes issue #3357) 2022-07-14 08:13:29 +00:00
Marshall Greenblatt d8db6fa9da mac: cefclient: Use RootWindowManager to track key window status (fixes issue #3307)
This change provides a generic solution for active (key) window tracking that
works with both Views-hosted and native windows on MacOS. With this new approach
we can now successfully route top menu actions to the currently active window.

Prior to this change CEF's Views API was using focus notifications as a proxy
for window activation notifications. That doesn't work on MacOS where NSWindow
activation (key status) is independent of NSView focus (first responder) status,
and changes in activation don't necessarily generate focus notifications (see
NativeWidgetMac::OnWindowKeyStatusChanged). To make this work reliably on all
platforms we now expose a CefWindowDelegate::OnWindowActivationChanged callback.

This change also fixes an uninitialized variable
(RootWindowMacImpl::with_extension_) that was causing flaky behavior in
RootWindowManager::OnRootWindowActivated.

To test:
1. Run `cefclient [--use-views]`
2. Select Popup Window from the Tests menu. Do not explicitly activate the popup
   window (e.g. don't click on it).
3. Verify that further Tests menu actions go to the popup window.
4. Change activation to a first window by clicking on it. Verify that Test
   menu actions go to that window.
5. Close the currently active window. Do not explicitly activate the remaining
   window (e.g. don't click on it).
6. Verify that Test menu actions go to the only remaining window.
2022-04-12 16:37:01 -04:00
Sergey Markelov ce891b57e1 Update generated files for check C API structure sizes (fixes issue #3238) 2022-02-17 12:46:38 -05:00
Marshall Greenblatt 2b9a06933b Update copyright year in generated files 2022-01-06 13:34:35 -05:00
Marshall Greenblatt dc1f934865 views: Support configuration of initial window show state
Known issues:
- Exiting full-screen mode currently crashes with the Chrome runtime
  (see issue #3182).
2021-09-23 14:41:47 +03:00
Marshall Greenblatt 4a44e16a09 views: Add support for absolute positioned overlay views.
To test:
Run `cefclient.exe --use-views --hide-frame --hide-controls`
Add `--enable-chrome-runtime` for the same behavior using the Chrome location
bar instead of a text field.
2021-09-16 18:25:43 +03:00
Marshall Greenblatt a4603c6f1a chrome: Support usage of the Chrome toolbar from Views (see issue #2969) 2021-04-11 20:44:28 -04:00
Marshall Greenblatt 119415b8e9 Update copyright year on generated files 2021-01-27 13:36:54 -05:00
Marshall Greenblatt b579b37db4 views: Support specification of screen bounds for CefWindow creation (fixes issue #2980) 2020-09-03 17:51:57 -04:00
Marshall Greenblatt 97d559982e Update generated files for NULL to nullptr conversion (see issue #2861) 2020-01-15 14:53:19 +01:00
Marshall Greenblatt beb005138a Update copyright year 2020-01-06 11:59:05 +02:00
Marshall Greenblatt 6bfb5ab33b Remove old approach for debugging leaked wrapper object references (issue #2593) 2019-02-14 17:08:44 -05:00
Marshall Greenblatt 3fe062a5b6 Implement new approach for debugging leaked wrapper object references (issue #2593) 2019-02-14 17:08:43 -05:00
Marshall Greenblatt bac8fb5e61 Update copyright year on generated files 2019-01-10 15:22:19 +01:00
Marshall Greenblatt 1c7391b70a Update generated file copyright year 2018-01-03 15:46:26 -05:00
Marshall Greenblatt 9cff99dc4e Add support for loading extensions (issue #1947)
- Add CefRequestContext::LoadExtension, CefExtension, CefExtensionHandler and
  related methods/interfaces.
- Add chrome://extensions-support that lists supported Chrome APIs.
- Add CefBrowserHost::SetAutoResizeEnabled and CefDisplayHandler::OnAutoResize
  to support browser resize based on preferred web contents size.
- views: Add support for custom CefMenuButton popups.
- cefclient: Run with `--load-extension=set_page_color` command-line flag for
  an extension loading example. Add `--use-views` on Windows and Linux for an
  even better example.
2017-08-25 18:40:32 -04:00
Marshall Greenblatt f229796a39 Update to Chromium revision ff259bab (#488528) 2017-07-28 18:30:34 -04:00
Marshall Greenblatt 31d9407ee2 Apply clang-format to all C, C++ and ObjC files (issue #2171) 2017-05-18 12:30:05 +02:00
Marshall Greenblatt 6ed4fe96b8 views: Add groups and focus/blur callbacks (issue #2102)
- cefclient: Only make menus focusable when ALT is pressed.
- cefclient: Display sample top menu when passed the `--show-top-menu`
  command-line flag.
2017-02-17 21:08:55 -05:00
Marshall Greenblatt bd1b80198f views: Add support for accelerators (issue #2102) 2017-02-17 14:11:19 -08:00
Marshall Greenblatt 0afcb82ee6 Rename CefBase to CefBaseRefCounted (issue #2090) 2017-02-09 17:50:59 -05:00
Marshall Greenblatt c990b5d877 Update copyright year on generated files 2017-01-10 18:00:30 -05:00
Marshall Greenblatt 5068b50b48 Use DCHECK_IS_ON() instead of !NDEBUG for debug logic (issue #1961) 2016-09-01 14:24:30 +03:00
Marshall Greenblatt 06e73fff15 Implement Views framework on Windows and Linux (issue #1749).
- Add Views header files in a new include/views directory.
- Add initial top-level window (CefWindow), control (CefBrowserView,
  CefLabelButton, CefMenuButton, CefPanel, CefScrollView,
  CefTextfield) and layout (CefBoxLayout, CefFlowLayout) support.
  See libcef/browser/views/view_impl.h comments for implementation
  details.
- Add Views example usage in cefclient and cefsimple and Views unit
  tests in cef_unittests. Pass the `--use-views` command-line flag to
  cefclient, cefsimple and cef_unittests to run using the Views
  framework instead of platform APIs. For cefclient and cefsimple
  this will create the browser window and all related functionality
  using the Views framework. For cef_unittests this will run all
  tests (except OSR tests) in a Views-based browser window. Views-
  specific unit tests (`--gtest_filter=Views*`) will be run even if
  the the `--use-views` flag is not specified.
- Pass the `--hide-frame` command-line flag to cefclient to demo a
  frameless Views-based browser window.
- Pass the `--hide-controls` command-line flag to cefclient to demo a
  browser window without top controls. This also works in non-Views
  mode.
- Pass the `--enable-high-dpi-support` command-line flag to
  cef_unittests on Windows to test high-DPI support on a display
  that supports it.
- Add CefImage for reading/writing image file formats.
- Add CefBrowser::DownloadImage() for downloading image URLs as a
  CefImage representation. This is primarily for loading favicons.
- Add CefMenuModel::CreateMenuModel() and CefMenuModelDelegate for
  creating custom menus. This is primarily for use with
  CefMenuButton.
- Add CefBrowser::TryCloseBrowser() helper for closing a browser.
  Also improve related documentation in cef_life_span_handler.h.
- Rename cef_page_range_t to cef_range_t. It is now also used by
  CefTextfield.
- Remove CefLifeSpanHandler::RunModal() which is never called.
- Add draggable regions example to cefclient.
2016-04-26 11:58:13 -04:00