migrate to virtual void and start mac impl
This commit is contained in:
parent
97589bbe33
commit
ae632193c0
4 changed files with 11 additions and 3 deletions
|
@ -391,8 +391,7 @@ bool Window::IsEnabled() {
|
|||
}
|
||||
|
||||
void Window::SetEnabled(bool enable) {
|
||||
auto window = static_cast<NativeWindowViews*>(window_.get());
|
||||
window->SetEnabled(enable);
|
||||
window_->SetEnabled(enable);
|
||||
}
|
||||
|
||||
void Window::Maximize() {
|
||||
|
|
|
@ -80,6 +80,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
virtual void Hide() = 0;
|
||||
virtual bool IsVisible() = 0;
|
||||
virtual bool IsEnabled() = 0;
|
||||
virtual void SetEnabled(bool enable) = 0;
|
||||
virtual void Maximize() = 0;
|
||||
virtual void Unmaximize() = 0;
|
||||
virtual bool IsMaximized() = 0;
|
||||
|
|
|
@ -1135,6 +1135,14 @@ bool NativeWindowMac::IsEnabled() {
|
|||
return [window_ attachedSheet] == nil;
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetEnabled(bool enable) {
|
||||
if (enable == false){
|
||||
[window_ attachedSheet] = nil;
|
||||
} else {
|
||||
[window_ beginSheet:window_];
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::Maximize() {
|
||||
if (IsMaximized())
|
||||
return;
|
||||
|
|
|
@ -132,7 +132,7 @@ class NativeWindowViews : public NativeWindow,
|
|||
void SetIcon(const gfx::ImageSkia& icon);
|
||||
#endif
|
||||
|
||||
void SetEnabled(bool enable);
|
||||
void SetEnabled(bool enable) override;
|
||||
|
||||
views::Widget* widget() const { return window_.get(); }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue