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

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

Issue 2416763002: Replace FOR_EACH_OBSERVER in c/b/chromeos with range-based for (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/webui_login_view.h" 5 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
6 6
7 #include "ash/common/focus_cycler.h" 7 #include "ash/common/focus_cycler.h"
8 #include "ash/common/system/status_area_widget_delegate.h" 8 #include "ash/common/system/status_area_widget_delegate.h"
9 #include "ash/common/system/tray/system_tray.h" 9 #include "ash/common/system/tray/system_tray.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 accel_map_[ui::Accelerator( 227 accel_map_[ui::Accelerator(
228 ui::VKEY_S, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = 228 ui::VKEY_S, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] =
229 kAccelNameBootstrappingSlave; 229 kAccelNameBootstrappingSlave;
230 230
231 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) 231 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i)
232 AddAccelerator(i->first); 232 AddAccelerator(i->first);
233 } 233 }
234 234
235 WebUILoginView::~WebUILoginView() { 235 WebUILoginView::~WebUILoginView() {
236 FOR_EACH_OBSERVER(web_modal::ModalDialogHostObserver, 236 for (auto& observer : observer_list_)
237 observer_list_, 237 observer.OnHostDestroying();
238 OnHostDestroying());
239 238
240 if (!chrome::IsRunningInMash() && 239 if (!chrome::IsRunningInMash() &&
241 ash::Shell::GetInstance()->HasPrimaryStatusArea()) { 240 ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
242 views::Widget* tray_widget = 241 views::Widget* tray_widget =
243 ash::Shell::GetInstance()->GetPrimarySystemTray()->GetWidget(); 242 ash::Shell::GetInstance()->GetPrimarySystemTray()->GetWidget();
244 ash::StatusAreaWidgetDelegate* status_area_widget_delegate = 243 ash::StatusAreaWidgetDelegate* status_area_widget_delegate =
245 static_cast<ash::StatusAreaWidgetDelegate*>( 244 static_cast<ash::StatusAreaWidgetDelegate*>(
246 tray_widget->GetContentsView()); 245 tray_widget->GetContentsView());
247 status_area_widget_delegate->set_custom_focus_traversable(nullptr); 246 status_area_widget_delegate->set_custom_focus_traversable(nullptr);
248 status_area_widget_delegate->set_default_last_focusable_child(false); 247 status_area_widget_delegate->set_default_last_focusable_child(false);
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 435
437 tray->SetEnabled(enabled); 436 tray->SetEnabled(enabled);
438 } 437 }
439 438
440 // WebUILoginView protected: --------------------------------------------------- 439 // WebUILoginView protected: ---------------------------------------------------
441 440
442 void WebUILoginView::Layout() { 441 void WebUILoginView::Layout() {
443 DCHECK(webui_login_); 442 DCHECK(webui_login_);
444 webui_login_->SetBoundsRect(bounds()); 443 webui_login_->SetBoundsRect(bounds());
445 444
446 FOR_EACH_OBSERVER(web_modal::ModalDialogHostObserver, 445 for (auto& observer : observer_list_)
447 observer_list_, 446 observer.OnPositionRequiresUpdate();
448 OnPositionRequiresUpdate());
449 } 447 }
450 448
451 void WebUILoginView::OnLocaleChanged() { 449 void WebUILoginView::OnLocaleChanged() {
452 } 450 }
453 451
454 void WebUILoginView::ChildPreferredSizeChanged(View* child) { 452 void WebUILoginView::ChildPreferredSizeChanged(View* child) {
455 Layout(); 453 Layout();
456 SchedulePaint(); 454 SchedulePaint();
457 } 455 }
458 456
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 if (should_emit_login_prompt_visible_) { 609 if (should_emit_login_prompt_visible_) {
612 VLOG(1) << "Login WebUI >> login-prompt-visible"; 610 VLOG(1) << "Login WebUI >> login-prompt-visible";
613 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 611 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
614 EmitLoginPromptVisible(); 612 EmitLoginPromptVisible();
615 } 613 }
616 614
617 webui_visible_ = true; 615 webui_visible_ = true;
618 } 616 }
619 617
620 } // namespace chromeos 618 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698