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

Unified Diff: chrome/browser/chromeos/login/webui_login_display_host.cc

Issue 9264059: Enable hide animation for login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 11 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
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/webui_login_display_host.cc
diff --git a/chrome/browser/chromeos/login/webui_login_display_host.cc b/chrome/browser/chromeos/login/webui_login_display_host.cc
index 4fb1a9500c2f8e5f544cfd8987900ebc392a9b69..38497b69328c5725aebfa73d92268d32f870fbf5 100644
--- a/chrome/browser/chromeos/login/webui_login_display_host.cc
+++ b/chrome/browser/chromeos/login/webui_login_display_host.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
+#include "base/time.h"
#include "chrome/browser/chromeos/login/oobe_display.h"
#include "chrome/browser/chromeos/login/webui_login_display.h"
#include "chrome/browser/chromeos/login/webui_login_view.h"
@@ -17,6 +18,7 @@
#if defined(USE_AURA)
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
+#include "ash/wm/window_animations.h"
#include "ui/aura/window.h"
#endif
@@ -29,6 +31,9 @@ const char kLoginURL[] = "chrome://oobe/login";
// URL which corresponds to the OOBE WebUI.
const char kOobeURL[] = "chrome://oobe";
+// Duration of sign-in transition animation.
+const int kLoginFadeoutTransitionDurationMs = 700;
+
} // namespace
// WebUILoginDisplayHost -------------------------------------------------------
@@ -41,7 +46,8 @@ WebUILoginDisplayHost::WebUILoginDisplayHost(const gfx::Rect& background_bounds)
}
WebUILoginDisplayHost::~WebUILoginDisplayHost() {
- CloseWindow();
+ if (login_window_)
+ login_window_->Close();
}
// LoginDisplayHost implementation ---------------------------------------------
@@ -118,12 +124,15 @@ void WebUILoginDisplayHost::StartSignInScreen() {
GetOobeUI()->ShowSigninScreen(webui_login_display_);
}
-void WebUILoginDisplayHost::CloseWindow() {
+void WebUILoginDisplayHost::OnBrowserCreated() {
+#if defined(USE_AURA)
+ // Close lock window now so that the launched browser can receive focus.
if (login_window_) {
login_window_->Close();
login_window_ = NULL;
login_view_ = NULL;
}
+#endif
}
void WebUILoginDisplayHost::LoadURL(const GURL& url) {
@@ -145,6 +154,12 @@ void WebUILoginDisplayHost::LoadURL(const GURL& url) {
ash::Shell::GetInstance()->GetContainer(
ash::internal::kShellWindowId_LockScreenContainer)->
AddChild(login_window_->GetNativeView());
+ ash::SetWindowVisibilityAnimationDuration(
+ login_window_->GetNativeView(),
+ base::TimeDelta::FromMilliseconds(kLoginFadeoutTransitionDurationMs));
+ ash::SetWindowVisibilityAnimationTransition(
+ login_window_->GetNativeView(),
+ ash::ANIMATE_HIDE);
#endif
login_window_->SetContentsView(login_view_);
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698