Add BrowserWindow.restart() to restart renderer process.
This commit is contained in:
parent
39bd56af4c
commit
9cf890bb61
4 changed files with 16 additions and 1 deletions
|
@ -14,6 +14,9 @@ BrowserWindow::toggleDevTools = ->
|
||||||
@openDevTools()
|
@openDevTools()
|
||||||
v8Util.setHiddenValue this, 'devtoolsOpened', true
|
v8Util.setHiddenValue this, 'devtoolsOpened', true
|
||||||
|
|
||||||
|
BrowserWindow::restart = ->
|
||||||
|
@loadUrl(@getUrl())
|
||||||
|
|
||||||
BrowserWindow.getFocusedWindow = ->
|
BrowserWindow.getFocusedWindow = ->
|
||||||
windows = objectsRegistry.getAllWindows()
|
windows = objectsRegistry.getAllWindows()
|
||||||
return window for window in windows when window.isFocused()
|
return window for window in windows when window.isFocused()
|
||||||
|
|
|
@ -38,6 +38,14 @@ void AtomBrowserClient::OverrideWebkitPrefs(
|
||||||
prefs->enable_scroll_animator = false;
|
prefs->enable_scroll_animator = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AtomBrowserClient::ShouldSwapProcessesForNavigation(
|
||||||
|
content::SiteInstance* site_instance,
|
||||||
|
const GURL& current_url,
|
||||||
|
const GURL& new_url) {
|
||||||
|
// Restart renderer process if navigating to the same url.
|
||||||
|
return current_url == new_url;
|
||||||
|
}
|
||||||
|
|
||||||
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
|
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
|
||||||
const content::MainFunctionParams&) {
|
const content::MainFunctionParams&) {
|
||||||
return new AtomBrowserMainParts;
|
return new AtomBrowserMainParts;
|
||||||
|
|
|
@ -18,6 +18,10 @@ class AtomBrowserClient : public brightray::BrowserClient {
|
||||||
virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
webkit_glue::WebPreferences* prefs) OVERRIDE;
|
webkit_glue::WebPreferences* prefs) OVERRIDE;
|
||||||
|
virtual bool ShouldSwapProcessesForNavigation(
|
||||||
|
content::SiteInstance* site_instance,
|
||||||
|
const GURL& current_url,
|
||||||
|
const GURL& new_url) OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
|
virtual brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 6b9c1b6761ff164173e4f7fdebc478af99e411e5
|
Subproject commit e2c74cd6631fa7289e36e34f5c6e286bb1e961c2
|
Loading…
Reference in a new issue