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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/oobe_ui.cc

Issue 2492063002: chromeos: Simplify ShutdownPolicyHandler
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.cc ('k') | 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/ui/webui/chromeos/login/oobe_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 for (size_t i = 0; i < handlers_.size(); ++i) { 514 for (size_t i = 0; i < handlers_.size(); ++i) {
515 if (handlers_[i]->async_assets_load_id().empty()) 515 if (handlers_[i]->async_assets_load_id().empty())
516 handlers_[i]->InitializeBase(); 516 handlers_[i]->InitializeBase();
517 } 517 }
518 518
519 // Instantiate the ShutdownPolicyHandler. 519 // Instantiate the ShutdownPolicyHandler.
520 shutdown_policy_handler_.reset( 520 shutdown_policy_handler_.reset(
521 new ShutdownPolicyHandler(CrosSettings::Get(), this)); 521 new ShutdownPolicyHandler(CrosSettings::Get(), this));
522 522
523 // Trigger an initial update. 523 // Trigger an initial update.
524 shutdown_policy_handler_->CheckIfRebootOnShutdown( 524 shutdown_policy_handler_->CheckIfRebootOnShutdown();
525 base::Bind(&OobeUI::OnShutdownPolicyChanged, base::Unretained(this)));
526 } 525 }
527 526
528 void OobeUI::OnScreenAssetsLoaded(const std::string& async_assets_load_id) { 527 void OobeUI::OnScreenAssetsLoaded(const std::string& async_assets_load_id) {
529 DCHECK(!async_assets_load_id.empty()); 528 DCHECK(!async_assets_load_id.empty());
530 529
531 for (size_t i = 0; i < handlers_.size(); ++i) { 530 for (size_t i = 0; i < handlers_.size(); ++i) {
532 if (handlers_[i]->async_assets_load_id() == async_assets_load_id) 531 if (handlers_[i]->async_assets_load_id() == async_assets_load_id)
533 handlers_[i]->InitializeBase(); 532 handlers_[i]->InitializeBase();
534 } 533 }
535 } 534 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // http://crbug.com/646034. 598 // http://crbug.com/646034.
600 NOTIMPLEMENTED(); 599 NOTIMPLEMENTED();
601 } 600 }
602 601
603 current_screen_ = new_screen; 602 current_screen_ = new_screen;
604 for (Observer& observer : observer_list_) 603 for (Observer& observer : observer_list_)
605 observer.OnCurrentScreenChanged(current_screen_, new_screen); 604 observer.OnCurrentScreenChanged(current_screen_, new_screen);
606 } 605 }
607 606
608 } // namespace chromeos 607 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698