Chromium Code Reviews| Index: chrome/browser/chromeos/set_time_dialog.cc |
| diff --git a/chrome/browser/chromeos/set_time_dialog.cc b/chrome/browser/chromeos/set_time_dialog.cc |
| index 62ceebba9b5873b7c7fc029741710c7adf243f61..61660cab1b1f07afaf6308d6ede826b9488ea04b 100644 |
| --- a/chrome/browser/chromeos/set_time_dialog.cc |
| +++ b/chrome/browser/chromeos/set_time_dialog.cc |
| @@ -4,8 +4,9 @@ |
| #include "chrome/browser/chromeos/set_time_dialog.h" |
| +#include "ash/public/cpp/shell_window_ids.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| -#include "chrome/browser/ui/browser_dialogs.h" |
| +#include "chrome/browser/ui/ash/web_dialog_util.h" |
| #include "chrome/common/url_constants.h" |
| #include "content/public/browser/user_metrics.h" |
| #include "ui/gfx/geometry/size.h" |
| @@ -23,11 +24,15 @@ const int kDefaultHeight = 235; |
| } // namespace |
| // static |
| -void SetTimeDialog::ShowDialog(gfx::NativeWindow owning_window) { |
| - content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show")); |
| - chrome::ShowWebDialog(owning_window, |
| - ProfileManager::GetActiveUserProfile(), |
| - new SetTimeDialog()); |
| +void SetTimeDialog::ShowDialogInParent(gfx::NativeWindow parent) { |
| + DCHECK(parent); |
| + ShowDialogImpl(parent, ash::kShellWindowId_Invalid); |
| +} |
| + |
| +// static |
| +void SetTimeDialog::ShowDialogInContainer(int container_id) { |
| + DCHECK(container_id != ash::kShellWindowId_Invalid); |
|
sky
2016/10/21 23:11:15
DCHECK_NE
James Cook
2016/10/21 23:28:13
Done.
|
| + ShowDialogImpl(nullptr, container_id); |
| } |
| SetTimeDialog::SetTimeDialog() { |
| @@ -36,6 +41,15 @@ SetTimeDialog::SetTimeDialog() { |
| SetTimeDialog::~SetTimeDialog() { |
| } |
| +// static |
| +void SetTimeDialog::ShowDialogImpl(gfx::NativeWindow parent, int container_id) { |
| + DCHECK(parent || container_id != ash::kShellWindowId_Invalid); |
| + content::RecordAction(base::UserMetricsAction("Options_SetTimeDialog_Show")); |
| + chrome::ShowWebDialogWithContainer(parent, container_id, |
| + ProfileManager::GetActiveUserProfile(), |
| + new SetTimeDialog()); |
| +} |
| + |
| ui::ModalType SetTimeDialog::GetDialogModalType() const { |
| return ui::MODAL_TYPE_SYSTEM; |
| } |