remove unnecessary static_cast

This commit is contained in:
Cheng Zhao 2018-04-25 16:16:31 +09:00
parent 2225cc9608
commit e07ea24610

View file

@ -373,7 +373,7 @@ bool NativeWindowViews::IsFocused() {
void NativeWindowViews::Show() { void NativeWindowViews::Show() {
if (is_modal() && NativeWindow::parent() && if (is_modal() && NativeWindow::parent() &&
!widget()->native_widget_private()->IsVisible()) !widget()->native_widget_private()->IsVisible())
static_cast<NativeWindowViews*>(NativeWindow::parent())->SetEnabled(false); NativeWindow::parent()->SetEnabled(false);
widget()->native_widget_private()->ShowWithWindowState(GetRestoredState()); widget()->native_widget_private()->ShowWithWindowState(GetRestoredState());
@ -398,7 +398,7 @@ void NativeWindowViews::ShowInactive() {
void NativeWindowViews::Hide() { void NativeWindowViews::Hide() {
if (is_modal() && NativeWindow::parent()) if (is_modal() && NativeWindow::parent())
static_cast<NativeWindowViews*>(NativeWindow::parent())->SetEnabled(true); NativeWindow::parent()->SetEnabled(true);
widget()->Hide(); widget()->Hide();
@ -1163,10 +1163,9 @@ void NativeWindowViews::SetIcon(HICON window_icon, HICON app_icon) {
} }
#elif defined(USE_X11) #elif defined(USE_X11)
void NativeWindowViews::SetIcon(const gfx::ImageSkia& icon) { void NativeWindowViews::SetIcon(const gfx::ImageSkia& icon) {
views::DesktopWindowTreeHostX11* tree_host = auto* tree_host = static_cast<views::DesktopWindowTreeHost*>(
views::DesktopWindowTreeHostX11::GetHostForXID(GetAcceleratedWidget()); views::DesktopWindowTreeHostX11::GetHostForXID(GetAcceleratedWidget()));
static_cast<views::DesktopWindowTreeHost*>(tree_host)->SetWindowIcons(icon, tree_host->SetWindowIcons(icon, icon);
icon);
} }
#endif #endif
@ -1224,8 +1223,7 @@ void NativeWindowViews::OnWidgetBoundsChanged(views::Widget* changed_widget,
void NativeWindowViews::DeleteDelegate() { void NativeWindowViews::DeleteDelegate() {
if (is_modal() && NativeWindow::parent()) { if (is_modal() && NativeWindow::parent()) {
NativeWindowViews* parent = auto* parent = NativeWindow::parent();
static_cast<NativeWindowViews*>(NativeWindow::parent());
// Enable parent window after current window gets closed. // Enable parent window after current window gets closed.
parent->SetEnabled(true); parent->SetEnabled(true);
// Focus on parent window. // Focus on parent window.