mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	The cefclient sample app will persist window state across application restart if run with views, cache_path and persist_user_references enabled. To test: 1. Run `cefclient --use-views --cache-path=/path/to/cache --persist-user-preferences` 2. Move or resize the window, maximize, minimize, etc. 3. Exit cefclient. 4. Run cefclient again with the same arguments. The previous window state will be restored.
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
// Copyright (c) 2015 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 "tests/cefclient/browser/root_window.h"
 | 
						|
 | 
						|
#include "include/base/cef_callback_helpers.h"
 | 
						|
 | 
						|
#include "tests/cefclient/browser/main_context.h"
 | 
						|
#include "tests/cefclient/browser/root_window_manager.h"
 | 
						|
 | 
						|
namespace client {
 | 
						|
 | 
						|
RootWindowConfig::RootWindowConfig() : url(MainContext::Get()->GetMainURL()) {}
 | 
						|
 | 
						|
RootWindow::RootWindow() : delegate_(nullptr) {}
 | 
						|
 | 
						|
RootWindow::~RootWindow() {}
 | 
						|
 | 
						|
// static
 | 
						|
scoped_refptr<RootWindow> RootWindow::GetForBrowser(int browser_id) {
 | 
						|
  return MainContext::Get()->GetRootWindowManager()->GetWindowForBrowser(
 | 
						|
      browser_id);
 | 
						|
}
 | 
						|
 | 
						|
void RootWindow::OnExtensionsChanged(const ExtensionSet& extensions) {
 | 
						|
  REQUIRE_MAIN_THREAD();
 | 
						|
  DCHECK(delegate_);
 | 
						|
  DCHECK(!WithExtension());
 | 
						|
 | 
						|
  if (extensions.empty())
 | 
						|
    return;
 | 
						|
 | 
						|
  ExtensionSet::const_iterator it = extensions.begin();
 | 
						|
  for (; it != extensions.end(); ++it) {
 | 
						|
    delegate_->CreateExtensionWindow(*it, CefRect(), nullptr, base::DoNothing(),
 | 
						|
                                     WithWindowlessRendering());
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
}  // namespace client
 |