mirror of
https://github.com/electron/electron.git
synced 2026-01-28 08:48:14 -05:00
WebContentsObserver no longer provides explicit_set, we can calculate it
This commit is contained in:
committed by
Aleksei Kuzmin
parent
fb55db665c
commit
4666879f94
@@ -893,9 +893,16 @@ void WebContents::DidFinishNavigation(
|
||||
}
|
||||
}
|
||||
|
||||
void WebContents::TitleWasSet(content::NavigationEntry* entry,
|
||||
bool explicit_set) {
|
||||
void WebContents::TitleWasSet(content::NavigationEntry* entry) {
|
||||
auto title = entry ? entry->GetTitle() : base::string16();
|
||||
bool explicit_set;
|
||||
if (entry && entry->GetURL().SchemeIsFile() && title.empty()) {
|
||||
final_title = base::UTF8ToUTF16(entry->GetURL().ExtractFileName());
|
||||
explicit_set = false;
|
||||
} else {
|
||||
base::TrimWhitespace(title, base::TRIM_ALL, &final_title);
|
||||
explicit_set = true;
|
||||
}
|
||||
Emit("page-title-updated", title, explicit_set);
|
||||
}
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||
void WebContentsDestroyed() override;
|
||||
void NavigationEntryCommitted(
|
||||
const content::LoadCommittedDetails& load_details) override;
|
||||
void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override;
|
||||
void TitleWasSet(content::NavigationEntry* entry) override;
|
||||
void DidUpdateFaviconURL(
|
||||
const std::vector<content::FaviconURL>& urls) override;
|
||||
void PluginCrashed(const base::FilePath& plugin_path,
|
||||
|
||||
Reference in New Issue
Block a user