mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Allow title change notifications after the document has loaded (issue #704).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@812 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -1077,13 +1077,8 @@ void CefBrowserHostImpl::WebContentsCreated(
|
|||||||
|
|
||||||
void CefBrowserHostImpl::DidNavigateMainFramePostCommit(
|
void CefBrowserHostImpl::DidNavigateMainFramePostCommit(
|
||||||
content::WebContents* tab) {
|
content::WebContents* tab) {
|
||||||
{
|
base::AutoLock lock_scope(state_lock_);
|
||||||
base::AutoLock lock_scope(state_lock_);
|
has_document_ = false;
|
||||||
has_document_ = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow the new page to set the title again.
|
|
||||||
received_page_title_ = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
content::JavaScriptDialogCreator*
|
content::JavaScriptDialogCreator*
|
||||||
@ -1358,9 +1353,6 @@ void CefBrowserHostImpl::Observe(int type,
|
|||||||
content::Details<std::pair<content::NavigationEntry*, bool> >(
|
content::Details<std::pair<content::NavigationEntry*, bool> >(
|
||||||
details).ptr();
|
details).ptr();
|
||||||
|
|
||||||
if (received_page_title_)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (title->first) {
|
if (title->first) {
|
||||||
if (client_.get()) {
|
if (client_.get()) {
|
||||||
CefRefPtr<CefDisplayHandler> handler = client_->GetDisplayHandler();
|
CefRefPtr<CefDisplayHandler> handler = client_->GetDisplayHandler();
|
||||||
@ -1369,8 +1361,6 @@ void CefBrowserHostImpl::Observe(int type,
|
|||||||
handler->OnTitleChange(this, title_str);
|
handler->OnTitleChange(this, title_str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
received_page_title_ = title->second;
|
|
||||||
}
|
}
|
||||||
} else if (type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE) {
|
} else if (type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE) {
|
||||||
focus_on_editable_field_ = *content::Details<bool>(details).ptr();
|
focus_on_editable_field_ = *content::Details<bool>(details).ptr();
|
||||||
@ -1394,7 +1384,6 @@ CefBrowserHostImpl::CefBrowserHostImpl(const CefWindowInfo& window_info,
|
|||||||
render_process_id_(0),
|
render_process_id_(0),
|
||||||
render_view_id_(0),
|
render_view_id_(0),
|
||||||
unique_id_(0),
|
unique_id_(0),
|
||||||
received_page_title_(false),
|
|
||||||
is_loading_(false),
|
is_loading_(false),
|
||||||
can_go_back_(false),
|
can_go_back_(false),
|
||||||
can_go_forward_(false),
|
can_go_forward_(false),
|
||||||
|
@ -377,9 +377,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
// Unique id for the browser.
|
// Unique id for the browser.
|
||||||
int unique_id_;
|
int unique_id_;
|
||||||
|
|
||||||
// True if the browser has received the page title for the current load.
|
|
||||||
bool received_page_title_;
|
|
||||||
|
|
||||||
// Used when creating a new popup window.
|
// Used when creating a new popup window.
|
||||||
CefWindowInfo pending_window_info_;
|
CefWindowInfo pending_window_info_;
|
||||||
CefBrowserSettings pending_settings_;
|
CefBrowserSettings pending_settings_;
|
||||||
|
Reference in New Issue
Block a user