mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Add a CefBrowser::ClearHistory() method for clearing back/forward browsing history (issue #352).
- Move RegisterDevToolsSchemeHandler() call to CefContext::Initialize() to fix assertion when using multi-threaded message loop on Windows. - Add new NavigationTest.History test. - Remove unused RequestTest.HistoryNav test. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@301 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -307,6 +307,29 @@ void CefBrowserImpl::SetZoomLevel(double zoomLevel)
|
||||
&CefBrowserImpl::UIT_SetZoomLevel, zoomLevel));
|
||||
}
|
||||
|
||||
void CefBrowserImpl::ClearHistory()
|
||||
{
|
||||
if (CefThread::CurrentlyOn(CefThread::UI)) {
|
||||
bool old_can_go_back = !nav_controller_->IsAtStart();
|
||||
bool old_can_go_forward = !nav_controller_->IsAtEnd();
|
||||
nav_controller_->Reset();
|
||||
|
||||
if (old_can_go_back || old_can_go_forward) {
|
||||
set_nav_state(false, false);
|
||||
if (client_.get()) {
|
||||
CefRefPtr<CefDisplayHandler> handler = client_->GetDisplayHandler();
|
||||
if (handler.get()) {
|
||||
// Notify the handler of a navigation state change
|
||||
handler->OnNavStateChange(this, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this,
|
||||
&CefBrowserImpl::ClearHistory));
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserImpl::ShowDevTools()
|
||||
{
|
||||
CefThread::PostTask(CefThread::UI, FROM_HERE, NewRunnableMethod(this,
|
||||
|
Reference in New Issue
Block a user