diff options
author | jackhou <jackhou@chromium.org> | 2015-02-15 16:38:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-16 00:40:05 +0000 |
commit | 39d75d5b5f11525e384745fd313d1d77ed7d0a88 (patch) | |
tree | e7538fc999a03f9b9b9842f443656478f516d9f3 /extensions/browser/app_window | |
parent | 1752909c117de5582d2751d0c467153bc30c5261 (diff) | |
download | chromium_src-39d75d5b5f11525e384745fd313d1d77ed7d0a88.zip chromium_src-39d75d5b5f11525e384745fd313d1d77ed7d0a88.tar.gz chromium_src-39d75d5b5f11525e384745fd313d1d77ed7d0a88.tar.bz2 |
Hidden windows should not keep Chrome alive.
For each app window, there is a ChromeAppDelegate which
holds a ScopedKeepAlive. This CL resets the ScopedKeepAlive
while the app window is hidden.
BUG=450710
Review URL: https://codereview.chromium.org/875273003
Cr-Commit-Position: refs/heads/master@{#316413}
Diffstat (limited to 'extensions/browser/app_window')
-rw-r--r-- | extensions/browser/app_window/app_delegate.h | 4 | ||||
-rw-r--r-- | extensions/browser/app_window/app_window.cc | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/extensions/browser/app_window/app_delegate.h b/extensions/browser/app_window/app_delegate.h index 36bcc92..158b446 100644 --- a/extensions/browser/app_window/app_delegate.h +++ b/extensions/browser/app_window/app_delegate.h @@ -78,6 +78,10 @@ class AppDelegate { // |callback| will be called when the process is about to terminate. virtual void SetTerminatingCallback(const base::Closure& callback) = 0; + + // Called when the app is hidden or shown. + virtual void OnHide() = 0; + virtual void OnShow() = 0; }; } // namespace extensions diff --git a/extensions/browser/app_window/app_window.cc b/extensions/browser/app_window/app_window.cc index 9256228d..83f2971 100644 --- a/extensions/browser/app_window/app_window.cc +++ b/extensions/browser/app_window/app_window.cc @@ -660,6 +660,7 @@ void AppWindow::SetContentSizeConstraints(const gfx::Size& min_size, } void AppWindow::Show(ShowType show_type) { + app_delegate_->OnShow(); bool was_hidden = is_hidden_ || !has_been_shown_; is_hidden_ = false; @@ -696,6 +697,7 @@ void AppWindow::Hide() { show_on_first_paint_ = false; GetBaseWindow()->Hide(); AppWindowRegistry::Get(browser_context_)->AppWindowHidden(this); + app_delegate_->OnHide(); } void AppWindow::SetAlwaysOnTop(bool always_on_top) { |