Move disable counter to NativeWindow from api::Window

This commit is contained in:
Cheng Zhao 2016-06-20 11:48:46 +09:00
parent 946d246aea
commit 1866dbe608
8 changed files with 36 additions and 40 deletions

View file

@ -77,8 +77,7 @@ v8::Local<v8::Value> ToBuffer(v8::Isolate* isolate, void* val, int size) {
Window::Window(v8::Isolate* isolate, const mate::Dictionary& options)
: disable_count_(0),
is_modal_(false) {
: is_modal_(false) {
// Use options.webPreferences to create WebContents.
mate::Dictionary web_preferences = mate::Dictionary::CreateEmpty(isolate);
options.Get(options::kWebPreferences, &web_preferences);
@ -325,15 +324,11 @@ bool Window::IsVisible() {
}
void Window::Disable() {
++disable_count_;
if (disable_count_ == 1)
window_->Disable();
window_->Disable();
}
void Window::Enable() {
--disable_count_;
if (disable_count_ == 0)
window_->Enable();
window_->Enable();
}
bool Window::IsEnabled() {