mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
refactor: use WidgetDelegate::SetAccessibleTitle() (#46765)
* refactor: use WidgetDelegate::SetAccessibleTitle() * test: add window.accessibleTitle tests
This commit is contained in:
@@ -781,14 +781,6 @@ const views::Widget* NativeWindow::GetWidget() const {
|
||||
return widget();
|
||||
}
|
||||
|
||||
std::u16string NativeWindow::GetAccessibleWindowTitle() const {
|
||||
if (accessible_title_.empty()) {
|
||||
return views::WidgetDelegate::GetAccessibleWindowTitle();
|
||||
}
|
||||
|
||||
return accessible_title_;
|
||||
}
|
||||
|
||||
std::string NativeWindow::GetTitle() const {
|
||||
return base::UTF16ToUTF8(WidgetDelegate::GetWindowTitle());
|
||||
}
|
||||
@@ -802,11 +794,11 @@ void NativeWindow::SetTitle(const std::string_view title) {
|
||||
}
|
||||
|
||||
void NativeWindow::SetAccessibleTitle(const std::string& title) {
|
||||
accessible_title_ = base::UTF8ToUTF16(title);
|
||||
WidgetDelegate::SetAccessibleTitle(base::UTF8ToUTF16(title));
|
||||
}
|
||||
|
||||
std::string NativeWindow::GetAccessibleTitle() {
|
||||
return base::UTF16ToUTF8(accessible_title_);
|
||||
return base::UTF16ToUTF8(GetAccessibleWindowTitle());
|
||||
}
|
||||
|
||||
void NativeWindow::HandlePendingFullscreenTransitions() {
|
||||
|
||||
@@ -447,7 +447,6 @@ class NativeWindow : public base::SupportsUserData,
|
||||
// views::WidgetDelegate:
|
||||
views::Widget* GetWidget() override;
|
||||
const views::Widget* GetWidget() const override;
|
||||
std::u16string GetAccessibleWindowTitle() const override;
|
||||
|
||||
void set_content_view(views::View* view) { content_view_ = view; }
|
||||
|
||||
@@ -532,9 +531,6 @@ class NativeWindow : public base::SupportsUserData,
|
||||
absl::flat_hash_set<BackgroundThrottlingSource*>
|
||||
background_throttling_sources_;
|
||||
|
||||
// Accessible title.
|
||||
std::u16string accessible_title_;
|
||||
|
||||
std::string vibrancy_;
|
||||
std::string background_material_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user