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

Side by Side Diff: chrome/browser/chromeos/login/webui_login_display_host.cc

Issue 10824253: Set flag for wallpaper wait correctly now that we have parallel/postpone init types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/webui_login_display_host.h" 5 #include "chrome/browser/chromeos/login/webui_login_display_host.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller.h" 7 #include "ash/desktop_background/desktop_background_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/window_animations.h" 10 #include "ash/wm/window_animations.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 BaseLoginDisplayHost::Observe(type, source, details); 202 BaseLoginDisplayHost::Observe(type, source, details);
203 if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { 203 if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) {
204 is_wallpaper_loaded_ = true; 204 is_wallpaper_loaded_ = true;
205 ash::Shell::GetInstance()->user_wallpaper_delegate()-> 205 ash::Shell::GetInstance()->user_wallpaper_delegate()->
206 OnWallpaperBootAnimationFinished(); 206 OnWallpaperBootAnimationFinished();
207 if (waiting_for_wallpaper_load_) { 207 if (waiting_for_wallpaper_load_) {
208 if (initialize_webui_in_parallel_) 208 if (initialize_webui_in_parallel_)
209 ShowWebUI(); 209 ShowWebUI();
210 else 210 else
211 StartPostponedWebUI(); 211 StartPostponedWebUI();
212 // StartWizard / StartSignInScreen could be called multiple times through
213 // the lifetime of host.
214 // Make sure that subsequent calls are not postponed.
215 waiting_for_wallpaper_load_ = false;
212 } 216 }
213 registrar_.Remove(this, 217 registrar_.Remove(this,
214 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, 218 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
215 content::NotificationService::AllSources()); 219 content::NotificationService::AllSources());
216 } 220 }
217 } 221 }
218 222
219 void WebUILoginDisplayHost::LoadURL(const GURL& url) { 223 void WebUILoginDisplayHost::LoadURL(const GURL& url) {
220 if (!login_window_) { 224 if (!login_window_) {
221 views::Widget::InitParams params( 225 views::Widget::InitParams params(
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 login_view_->SetStatusAreaVisible(status_area_saved_visibility_); 316 login_view_->SetStatusAreaVisible(status_area_saved_visibility_);
313 login_view_->OnPostponedShow(); 317 login_view_->OnPostponedShow();
314 } 318 }
315 319
316 void WebUILoginDisplayHost::StartPostponedWebUI() { 320 void WebUILoginDisplayHost::StartPostponedWebUI() {
317 if (!waiting_for_wallpaper_load_ || !is_wallpaper_loaded_) { 321 if (!waiting_for_wallpaper_load_ || !is_wallpaper_loaded_) {
318 NOTREACHED(); 322 NOTREACHED();
319 return; 323 return;
320 } 324 }
321 325
322 // StartWizard / StartSignInScreen could be called multiple times through
323 // the lifetime of host. Make sure that subsequent calls are not postponed.
324 waiting_for_wallpaper_load_ = false;
325
326 // Wallpaper has finished loading before StartWizard/StartSignInScreen has 326 // Wallpaper has finished loading before StartWizard/StartSignInScreen has
327 // been called. In general this should not happen. 327 // been called. In general this should not happen.
328 // Let go through normal code path when one of those will be called. 328 // Let go through normal code path when one of those will be called.
329 if (restore_path_ == RESTORE_UNKNOWN) { 329 if (restore_path_ == RESTORE_UNKNOWN) {
330 NOTREACHED(); 330 NOTREACHED();
331 return; 331 return;
332 } 332 }
333 333
334 switch (restore_path_) { 334 switch (restore_path_) {
335 case RESTORE_WIZARD: 335 case RESTORE_WIZARD:
336 StartWizard(wizard_first_screen_name_, 336 StartWizard(wizard_first_screen_name_,
337 wizard_screen_parameters_.release()); 337 wizard_screen_parameters_.release());
338 break; 338 break;
339 case RESTORE_SIGN_IN: 339 case RESTORE_SIGN_IN:
340 StartSignInScreen(); 340 StartSignInScreen();
341 break; 341 break;
342 default: 342 default:
343 NOTREACHED(); 343 NOTREACHED();
344 break; 344 break;
345 } 345 }
346 } 346 }
347 347
348 } // namespace chromeos 348 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698