Chromium Code Reviews| Index: chrome/browser/chromeos/login/webui_login_view.cc |
| diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc |
| index 3480c7f8113e4780daaabdbf0a6b83c99bf5f730..e4e888212885ecc9af87c607f23bd47fe0b12eca 100644 |
| --- a/chrome/browser/chromeos/login/webui_login_view.cc |
| +++ b/chrome/browser/chromeos/login/webui_login_view.cc |
| @@ -115,6 +115,7 @@ WebUILoginView::WebUILoginView() |
| login_window_(NULL), |
| host_window_frozen_(false), |
| login_page_is_loaded_(false), |
| + login_prompt_visible_notified_(false), |
| should_emit_login_prompt_visible_(true) { |
| registrar_.Add(this, |
| @@ -279,18 +280,7 @@ void WebUILoginView::OnTabMainFrameRender() { |
| if (!login_page_is_loaded_) |
| return; |
| - VLOG(1) << "WebUI login main frame rendered."; |
| - tab_watcher_.reset(); |
| - |
| - if (should_emit_login_prompt_visible_) { |
| - chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| - EmitLoginPromptVisible(); |
| - } |
| - |
| - OobeUI* oobe_ui = static_cast<OobeUI*>(GetWebUI()->GetController()); |
| - // Notify OOBE that the login frame has been rendered. Currently |
| - // this is used to start camera presence check. |
| - oobe_ui->OnLoginPromptVisible(); |
| + OnLoginPromptVisible(); |
| } |
| void WebUILoginView::Observe(int type, |
| @@ -301,7 +291,17 @@ void WebUILoginView::Observe(int type, |
| case chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED: |
| case chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN: |
| case chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN: |
| + VLOG(1) << "===================== WebUI login ready notification"; |
| login_page_is_loaded_ = true; |
| + // In case of accelerated compositing being enabled at sign in screen, |
| + // no more OnTabMainFrameRender() calls are being made after |
| + // OnTabMainFrameLoaded() or after any of these notifications is received. |
| + // So mark sign in screen as visible now. |
| + // TODO(nkostylev): Improve OOBE case as with accelerated compositing |
| + // using NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN is not correct cause |
| + // it fires login-prompt-visible before login-prompt-ready. |
| + if (IsAcceleratedCompositingEnabled()) |
| + OnLoginPromptVisible(); |
| break; |
| default: |
| NOTREACHED() << "Unexpected notification " << type; |
| @@ -349,6 +349,31 @@ bool WebUILoginView::TakeFocus(bool reverse) { |
| return true; |
| } |
| +bool WebUILoginView::IsAcceleratedCompositingEnabled() { |
| + // TODO(nkostylev): Temporary check, should be modified once |
| + // http://crbug.com/116800 is fixed and if this switch is removed. |
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + return command_line.HasSwitch(switches::kAllowWebUICompositing); |
|
Daniel Erat
2012/05/28 15:20:53
is there any risk that this might not get updated
Nikita (slow)
2012/05/28 15:55:05
I've actually thought that when accelerated compos
|
| +} |
| + |
| +void WebUILoginView::OnLoginPromptVisible() { |
| + if (login_prompt_visible_notified_) |
| + return; |
| + |
| + login_prompt_visible_notified_ = true; |
| + tab_watcher_.reset(); |
| + |
| + if (should_emit_login_prompt_visible_) { |
| + chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| + EmitLoginPromptVisible(); |
| + } |
| + |
| + OobeUI* oobe_ui = static_cast<OobeUI*>(GetWebUI()->GetController()); |
| + // Notify OOBE that the login frame has been rendered. Currently |
| + // this is used to start camera presence check. |
| + oobe_ui->OnLoginPromptVisible(); |
| +} |
| + |
| void WebUILoginView::ReturnFocus(bool reverse) { |
| // Return the focus to the web contents. |
| webui_login_->web_contents()->FocusThroughTabTraversal(reverse); |