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

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

Issue 10443053: [cros] Change how login-prompt-visible signal is emitted when accelerated compositing is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 7 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_view.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_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);
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698