Implement BrowserWindow::ShowInactive

This commit is contained in:
Cheng Zhao 2014-10-17 22:51:20 +08:00
parent cb9bdbf247
commit 141894aacd
7 changed files with 17 additions and 0 deletions

View file

@ -153,6 +153,10 @@ void Window::Show() {
window_->Show();
}
void Window::ShowInactive() {
window_->ShowInactive();
}
void Window::Hide() {
window_->Hide();
}
@ -388,6 +392,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("focus", &Window::Focus)
.SetMethod("isFocused", &Window::IsFocused)
.SetMethod("show", &Window::Show)
.SetMethod("showInactive", &Window::ShowInactive)
.SetMethod("hide", &Window::Hide)
.SetMethod("isVisible", &Window::IsVisible)
.SetMethod("maximize", &Window::Maximize)

View file

@ -59,6 +59,7 @@ class Window : public mate::EventEmitter,
void Focus();
bool IsFocused();
void Show();
void ShowInactive();
void Hide();
bool IsVisible();
void Maximize();

View file

@ -101,6 +101,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
virtual void Focus(bool focus) = 0;
virtual bool IsFocused() = 0;
virtual void Show() = 0;
virtual void ShowInactive() = 0;
virtual void Hide() = 0;
virtual bool IsVisible() = 0;
virtual void Maximize() = 0;

View file

@ -28,6 +28,7 @@ class NativeWindowMac : public NativeWindow {
virtual void Focus(bool focus) OVERRIDE;
virtual bool IsFocused() OVERRIDE;
virtual void Show() OVERRIDE;
virtual void ShowInactive() OVERRIDE;
virtual void Hide() OVERRIDE;
virtual bool IsVisible() OVERRIDE;
virtual void Maximize() OVERRIDE;

View file

@ -334,6 +334,10 @@ bool NativeWindowMac::IsFocused() {
}
void NativeWindowMac::Show() {
[window_ makeKeyAndOrderFront:nil];
}
void NativeWindowMac::ShowInactive() {
[window_ orderFrontRegardless];
}

View file

@ -232,6 +232,10 @@ bool NativeWindowViews::IsFocused() {
}
void NativeWindowViews::Show() {
window_->Show();
}
void NativeWindowViews::ShowInactive() {
window_->ShowInactive();
}

View file

@ -38,6 +38,7 @@ class NativeWindowViews : public NativeWindow,
virtual void Focus(bool focus) OVERRIDE;
virtual bool IsFocused() OVERRIDE;
virtual void Show() OVERRIDE;
virtual void ShowInactive() OVERRIDE;
virtual void Hide() OVERRIDE;
virtual bool IsVisible() OVERRIDE;
virtual void Maximize() OVERRIDE;