mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	cefsimple: Fix sizing of popup windows with --use-views (see issue #2854)
This commit is contained in:
		| @@ -54,6 +54,27 @@ class SimpleWindowDelegate : public CefWindowDelegate { | ||||
|   DISALLOW_COPY_AND_ASSIGN(SimpleWindowDelegate); | ||||
| }; | ||||
|  | ||||
| class SimpleBrowserViewDelegate : public CefBrowserViewDelegate { | ||||
|  public: | ||||
|   SimpleBrowserViewDelegate() {} | ||||
|  | ||||
|   bool OnPopupBrowserViewCreated(CefRefPtr<CefBrowserView> browser_view, | ||||
|                                  CefRefPtr<CefBrowserView> popup_browser_view, | ||||
|                                  bool is_devtools) OVERRIDE { | ||||
|     // Create a new top-level Window for the popup. It will show itself after | ||||
|     // creation. | ||||
|     CefWindow::CreateTopLevelWindow( | ||||
|         new SimpleWindowDelegate(popup_browser_view)); | ||||
|  | ||||
|     // We created the Window. | ||||
|     return true; | ||||
|   } | ||||
|  | ||||
|  private: | ||||
|   IMPLEMENT_REFCOUNTING(SimpleBrowserViewDelegate); | ||||
|   DISALLOW_COPY_AND_ASSIGN(SimpleBrowserViewDelegate); | ||||
| }; | ||||
|  | ||||
| }  // namespace | ||||
|  | ||||
| SimpleApp::SimpleApp() {} | ||||
| @@ -91,7 +112,8 @@ void SimpleApp::OnContextInitialized() { | ||||
|   if (use_views) { | ||||
|     // Create the BrowserView. | ||||
|     CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView( | ||||
|         handler, url, browser_settings, NULL, NULL, NULL); | ||||
|         handler, url, browser_settings, nullptr, nullptr, | ||||
|         new SimpleBrowserViewDelegate()); | ||||
|  | ||||
|     // Create the Window. It will show itself after creation. | ||||
|     CefWindow::CreateTopLevelWindow(new SimpleWindowDelegate(browser_view)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user