Should send "closed" event when native window is closed.
This commit is contained in:
parent
8417f158b4
commit
1cb23a958c
5 changed files with 8 additions and 6 deletions
|
@ -173,6 +173,11 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
|
||||||
int child_process_id);
|
int child_process_id);
|
||||||
void OverrideWebkitPrefs(const GURL& url, WebPreferences* prefs);
|
void OverrideWebkitPrefs(const GURL& url, WebPreferences* prefs);
|
||||||
|
|
||||||
|
// Public API used by platform-dependent delegates and observers to send UI
|
||||||
|
// related notifications.
|
||||||
|
void NotifyWindowClosed();
|
||||||
|
void NotifyWindowBlur();
|
||||||
|
|
||||||
void AddObserver(NativeWindowObserver* obs) {
|
void AddObserver(NativeWindowObserver* obs) {
|
||||||
observers_.AddObserver(obs);
|
observers_.AddObserver(obs);
|
||||||
}
|
}
|
||||||
|
@ -196,9 +201,6 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
|
||||||
inspectable_web_contents_.get());
|
inspectable_web_contents_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotifyWindowClosed();
|
|
||||||
void NotifyWindowBlur();
|
|
||||||
|
|
||||||
// Called when the window needs to update its draggable region.
|
// Called when the window needs to update its draggable region.
|
||||||
virtual void UpdateDraggableRegions(
|
virtual void UpdateDraggableRegions(
|
||||||
const std::vector<DraggableRegion>& regions) = 0;
|
const std::vector<DraggableRegion>& regions) = 0;
|
||||||
|
|
|
@ -132,6 +132,7 @@ void NativeWindowGtk::Close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowGtk::CloseImmediately() {
|
void NativeWindowGtk::CloseImmediately() {
|
||||||
|
NotifyWindowClosed();
|
||||||
gtk_widget_destroy(GTK_WIDGET(window_));
|
gtk_widget_destroy(GTK_WIDGET(window_));
|
||||||
window_ = NULL;
|
window_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,8 +57,6 @@ class NativeWindowMac : public NativeWindow {
|
||||||
virtual bool HasModalDialog() OVERRIDE;
|
virtual bool HasModalDialog() OVERRIDE;
|
||||||
virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
|
virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
|
||||||
|
|
||||||
void NotifyWindowBlur() { NativeWindow::NotifyWindowBlur(); }
|
|
||||||
|
|
||||||
// Returns true if |point| in local Cocoa coordinate system falls within
|
// Returns true if |point| in local Cocoa coordinate system falls within
|
||||||
// the draggable region.
|
// the draggable region.
|
||||||
bool IsWithinDraggableRegion(NSPoint point) const;
|
bool IsWithinDraggableRegion(NSPoint point) const;
|
||||||
|
|
|
@ -65,6 +65,7 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowWillClose:(NSNotification*)notification {
|
- (void)windowWillClose:(NSNotification*)notification {
|
||||||
|
shell_->NotifyWindowClosed();
|
||||||
[self autorelease];
|
[self autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ bool NativeWindowWin::AcceleratorPressed(
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowWin::DeleteDelegate() {
|
void NativeWindowWin::DeleteDelegate() {
|
||||||
// Do nothing, window is managed by users.
|
NotifyWindowClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
views::View* NativeWindowWin::GetInitiallyFocusedView() {
|
views::View* NativeWindowWin::GetInitiallyFocusedView() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue