Merge branch 'master' into chrome35

Conflicts:
	atom/browser/native_window_gtk.h
This commit is contained in:
Cheng Zhao 2014-07-07 23:49:28 +08:00
commit ee5312fff9
12 changed files with 37 additions and 1 deletions

View file

@ -149,6 +149,10 @@ void Window::Unmaximize() {
window_->Unmaximize(); window_->Unmaximize();
} }
bool Window::IsMaximized() {
return window_->IsMaximized();
}
void Window::Minimize() { void Window::Minimize() {
window_->Minimize(); window_->Minimize();
} }
@ -342,6 +346,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("isVisible", &Window::IsVisible) .SetMethod("isVisible", &Window::IsVisible)
.SetMethod("maximize", &Window::Maximize) .SetMethod("maximize", &Window::Maximize)
.SetMethod("unmaximize", &Window::Unmaximize) .SetMethod("unmaximize", &Window::Unmaximize)
.SetMethod("isMaximized", &Window::IsMaximized)
.SetMethod("minimize", &Window::Minimize) .SetMethod("minimize", &Window::Minimize)
.SetMethod("restore", &Window::Restore) .SetMethod("restore", &Window::Restore)
.SetMethod("setFullScreen", &Window::SetFullscreen) .SetMethod("setFullScreen", &Window::SetFullscreen)

View file

@ -63,6 +63,7 @@ class Window : public mate::EventEmitter,
bool IsVisible(); bool IsVisible();
void Maximize(); void Maximize();
void Unmaximize(); void Unmaximize();
bool IsMaximized();
void Minimize(); void Minimize();
void Restore(); void Restore();
void SetFullscreen(bool fullscreen); void SetFullscreen(bool fullscreen);

View file

@ -107,6 +107,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
virtual bool IsVisible() = 0; virtual bool IsVisible() = 0;
virtual void Maximize() = 0; virtual void Maximize() = 0;
virtual void Unmaximize() = 0; virtual void Unmaximize() = 0;
virtual bool IsMaximized() = 0;
virtual void Minimize() = 0; virtual void Minimize() = 0;
virtual void Restore() = 0; virtual void Restore() = 0;
virtual void SetFullscreen(bool fullscreen) = 0; virtual void SetFullscreen(bool fullscreen) = 0;

View file

@ -32,6 +32,7 @@ class NativeWindowMac : public NativeWindow {
virtual bool IsVisible() OVERRIDE; virtual bool IsVisible() OVERRIDE;
virtual void Maximize() OVERRIDE; virtual void Maximize() OVERRIDE;
virtual void Unmaximize() OVERRIDE; virtual void Unmaximize() OVERRIDE;
virtual bool IsMaximized() OVERRIDE;
virtual void Minimize() OVERRIDE; virtual void Minimize() OVERRIDE;
virtual void Restore() OVERRIDE; virtual void Restore() OVERRIDE;
virtual void SetFullscreen(bool fullscreen) OVERRIDE; virtual void SetFullscreen(bool fullscreen) OVERRIDE;

View file

@ -279,6 +279,10 @@ void NativeWindowMac::Unmaximize() {
[window_ zoom:nil]; [window_ zoom:nil];
} }
bool NativeWindowMac::IsMaximized() {
return [window_ isZoomed];
}
void NativeWindowMac::Minimize() { void NativeWindowMac::Minimize() {
[window_ miniaturize:nil]; [window_ miniaturize:nil];
} }

View file

@ -140,6 +140,10 @@ void NativeWindowViews::Unmaximize() {
window_->Restore(); window_->Restore();
} }
bool NativeWindowViews::IsMaximized() {
return window_->IsMaximized();
}
void NativeWindowViews::Minimize() { void NativeWindowViews::Minimize() {
window_->Minimize(); window_->Minimize();
} }

View file

@ -38,6 +38,7 @@ class NativeWindowViews : public NativeWindow,
virtual bool IsVisible() OVERRIDE; virtual bool IsVisible() OVERRIDE;
virtual void Maximize() OVERRIDE; virtual void Maximize() OVERRIDE;
virtual void Unmaximize() OVERRIDE; virtual void Unmaximize() OVERRIDE;
virtual bool IsMaximized() OVERRIDE;
virtual void Minimize() OVERRIDE; virtual void Minimize() OVERRIDE;
virtual void Restore() OVERRIDE; virtual void Restore() OVERRIDE;
virtual void SetFullscreen(bool fullscreen) OVERRIDE; virtual void SetFullscreen(bool fullscreen) OVERRIDE;

View file

@ -294,6 +294,10 @@ void NativeWindowWin::Unmaximize() {
window_->Restore(); window_->Restore();
} }
bool NativeWindowWin::IsMaximized() {
return window_->IsMaximized();
}
bool NativeWindowWin::IsVisible() { bool NativeWindowWin::IsVisible() {
return window_->IsVisible(); return window_->IsVisible();
} }

View file

@ -49,6 +49,7 @@ class NativeWindowWin : public NativeWindow,
virtual bool IsVisible() OVERRIDE; virtual bool IsVisible() OVERRIDE;
virtual void Maximize() OVERRIDE; virtual void Maximize() OVERRIDE;
virtual void Unmaximize() OVERRIDE; virtual void Unmaximize() OVERRIDE;
virtual bool IsMaximized() OVERRIDE;
virtual void Minimize() OVERRIDE; virtual void Minimize() OVERRIDE;
virtual void Restore() OVERRIDE; virtual void Restore() OVERRIDE;
virtual void SetFullscreen(bool fullscreen) OVERRIDE; virtual void SetFullscreen(bool fullscreen) OVERRIDE;

View file

@ -175,7 +175,7 @@ void MoveItemToTrash(const base::FilePath& path) {
SHFILEOPSTRUCT file_operation = {0}; SHFILEOPSTRUCT file_operation = {0};
file_operation.wFunc = FO_DELETE; file_operation.wFunc = FO_DELETE;
file_operation.pFrom = double_terminated_path; file_operation.pFrom = double_terminated_path;
file_operation.fFlags = FOF_ALLOWUNDO; file_operation.fFlags = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION;
SHFileOperation(&file_operation); SHFileOperation(&file_operation);
} }

View file

@ -239,6 +239,10 @@ Maximizes the window.
Unmaximizes the window. Unmaximizes the window.
### BrowserWindow.isMaximized()
Returns whether the window is maximized.
### BrowserWindow.minimize() ### BrowserWindow.minimize()
Minimizes the window. On some platforms the minimized window will be shown in Minimizes the window. On some platforms the minimized window will be shown in
@ -394,6 +398,10 @@ Opens the developer tools.
Closes the developer tools. Closes the developer tools.
### BrowserWindow.toggleDevTools()
Toggle the developer tools.
### BrowserWindow.inspectElement(x, y) ### BrowserWindow.inspectElement(x, y)
* `x` Integer * `x` Integer

View file

@ -1,6 +1,12 @@
# screen # screen
Gets various info about screen size, displays, cursor position, etc. Gets various info about screen size, displays, cursor position, etc.
```js
var Screen = require('screen');
var BrowserWindow = require('browser-window');
var size = Screen.getPrimaryDisplay().workAreaSize;
mainWindow = new BrowserWindow({ width: size.width, height: size.height });
```
## screen.getCursorScreenPoint() ## screen.getCursorScreenPoint()