| OLD | NEW |
| 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/ui/ash/multi_user/multi_user_warning_dialog.h" | 5 #include "chrome/browser/ui/ash/multi_user/multi_user_warning_dialog.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 TeleportWarningView::~TeleportWarningView() { | 64 TeleportWarningView::~TeleportWarningView() { |
| 65 } | 65 } |
| 66 | 66 |
| 67 // static | 67 // static |
| 68 void TeleportWarningView::ShowDialog( | 68 void TeleportWarningView::ShowDialog( |
| 69 const base::Callback<void(bool)>& on_accept) { | 69 const base::Callback<void(bool)>& on_accept) { |
| 70 TeleportWarningView* dialog_view = | 70 TeleportWarningView* dialog_view = |
| 71 new TeleportWarningView(on_accept); | 71 new TeleportWarningView(on_accept); |
| 72 dialog_view->InitDialog(); | 72 dialog_view->InitDialog(); |
| 73 views::DialogDelegate::CreateDialogWidget( | 73 views::DialogDelegate::CreateDialogWidget( |
| 74 dialog_view, ash::Shell::GetTargetRootWindow(), NULL); | 74 dialog_view, ash::Shell::GetRootWindowForNewWindows(), NULL); |
| 75 views::Widget* widget = dialog_view->GetWidget(); | 75 views::Widget* widget = dialog_view->GetWidget(); |
| 76 DCHECK(widget); | 76 DCHECK(widget); |
| 77 widget->Show(); | 77 widget->Show(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool TeleportWarningView::Accept() { | 80 bool TeleportWarningView::Accept() { |
| 81 on_accept_.Run(no_show_checkbox_->checked()); | 81 on_accept_.Run(no_show_checkbox_->checked()); |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 //////////////////////////////////////////////////////////////////////////////// | 122 //////////////////////////////////////////////////////////////////////////////// |
| 123 // Factory function. | 123 // Factory function. |
| 124 | 124 |
| 125 void ShowMultiprofilesWarningDialog( | 125 void ShowMultiprofilesWarningDialog( |
| 126 const base::Callback<void(bool)>& on_accept) { | 126 const base::Callback<void(bool)>& on_accept) { |
| 127 TeleportWarningView::ShowDialog(on_accept); | 127 TeleportWarningView::ShowDialog(on_accept); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace chromeos | 130 } // namespace chromeos |
| OLD | NEW |