Just use visible state in CanFocus delegate

This commit is contained in:
Kevin Sawicki 2017-02-14 12:52:19 -08:00
parent 86007fe61d
commit bda8af8dd3
4 changed files with 4 additions and 11 deletions

View file

@ -149,8 +149,7 @@ NativeWindowViews::NativeWindowViews(
resizable_(true),
maximizable_(true),
minimizable_(true),
fullscreenable_(true),
focusable_(true) {
fullscreenable_(true) {
options.Get(options::kTitle, &title_);
options.Get(options::kAutoHideMenuBar, &menu_bar_autohide_);
@ -198,7 +197,8 @@ NativeWindowViews::NativeWindowViews(
if (transparent() && !has_frame())
params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
if (options.Get(options::kFocusable, &focusable_) && !focusable_)
bool focusable;
if (options.Get(options::kFocusable, &focusable) && !focusable)
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
#if defined(OS_WIN)
@ -806,7 +806,6 @@ void NativeWindowViews::SetContentProtection(bool enable) {
}
void NativeWindowViews::SetFocusable(bool focusable) {
focusable_ = focusable;
#if defined(OS_WIN)
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
if (focusable)

View file

@ -130,7 +130,6 @@ class NativeWindowViews : public NativeWindow,
#if defined(OS_WIN)
TaskbarHost& taskbar_host() { return taskbar_host_; }
bool CanFocus();
#endif
private:
@ -263,7 +262,6 @@ class NativeWindowViews : public NativeWindow,
bool maximizable_;
bool minimizable_;
bool fullscreenable_;
bool focusable_;
std::string title_;
gfx::Size widget_size_;

View file

@ -202,8 +202,4 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
}
}
bool NativeWindowViews::CanFocus() {
return focusable_ && IsVisible();
}
} // namespace atom

View file

@ -14,7 +14,7 @@ AtomDeskopNativeWidgetAura::AtomDeskopNativeWidgetAura(
}
bool AtomDeskopNativeWidgetAura::CanFocus() {
return window_->CanFocus();
return window_->IsVisible();
}
} // namespace atom