Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc

Issue 13699002: add HideAndClose in preference to having Close sometimes magically defer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: non aura Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
index ed137d44ed0a78e090953ef6deafb8977e3f0d4f..e0a5783f5a8ed99cff42352777e5866374bae709 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
@@ -58,7 +58,6 @@ DesktopRootWindowHostWin::DesktopRootWindowHostWin(
desktop_native_widget_aura_(desktop_native_widget_aura),
root_window_host_delegate_(NULL),
content_window_(NULL),
- should_animate_window_close_(false),
pending_close_(false) {
}
@@ -172,10 +171,6 @@ aura::RootWindow* DesktopRootWindowHostWin::Init(
aura::client::SetAnimationHost(content_window_, this);
- should_animate_window_close_ =
- content_window_->type() != aura::client::WINDOW_TYPE_NORMAL &&
- !views::corewm::WindowAnimationsDisabled(content_window_);
-
return root_window_;
}
@@ -183,14 +178,18 @@ void DesktopRootWindowHostWin::InitFocus(aura::Window* window) {
focus_client_->FocusWindow(window);
}
+bool DesktopRootWindowHostWin::SetCloseOnHideCompletion() {
+ bool should_animate_window_close =
+ content_window_->type() != aura::client::WINDOW_TYPE_NORMAL &&
+ !views::corewm::WindowAnimationsDisabled(content_window_);
+
+ // OnWindowHidingAnimationCompleted will do a Close if this is set.
+ pending_close_ = should_animate_window_close;
+ return pending_close_;
+}
+
void DesktopRootWindowHostWin::Close() {
- if (should_animate_window_close_) {
- pending_close_ = true;
- // OnWindowHidingAnimationCompleted does the actual Close.
- content_window_->Hide();
- } else {
- message_handler_->Close();
- }
+ message_handler_->Close();
}
void DesktopRootWindowHostWin::CloseNow() {

Powered by Google App Engine
This is Rietveld 408576698