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

Unified Diff: ash/common/system/chromeos/session/logout_confirmation_dialog.cc

Issue 2108793002: mash: Convert system tray logout button to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more review comments, fix mash_unittests Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/session/logout_confirmation_dialog.cc
diff --git a/ash/system/chromeos/session/logout_confirmation_dialog.cc b/ash/common/system/chromeos/session/logout_confirmation_dialog.cc
similarity index 81%
rename from ash/system/chromeos/session/logout_confirmation_dialog.cc
rename to ash/common/system/chromeos/session/logout_confirmation_dialog.cc
index 3464639a33fc6b2741c5a0a650a95d6c02c081c1..a95a57ee1fb5c34cdbfddf6cfd78622b64753c00 100644
--- a/ash/system/chromeos/session/logout_confirmation_dialog.cc
+++ b/ash/common/system/chromeos/session/logout_confirmation_dialog.cc
@@ -2,17 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/system/chromeos/session/logout_confirmation_dialog.h"
+#include "ash/common/system/chromeos/session/logout_confirmation_dialog.h"
+#include "ash/common/shell_window_ids.h"
+#include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
#include "ash/common/system/tray/tray_constants.h"
-#include "ash/shell.h"
-#include "ash/system/chromeos/session/logout_confirmation_controller.h"
+#include "ash/common/wm_root_window_controller.h"
+#include "ash/common/wm_shell.h"
+#include "ash/common/wm_window.h"
#include "base/location.h"
#include "base/time/tick_clock.h"
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/time_format.h"
#include "ui/base/ui_base_types.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/text_constants.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
@@ -43,8 +47,16 @@ LogoutConfirmationDialog::LogoutConfirmationDialog(
UpdateLabel();
- CreateDialogWidget(this, ash::Shell::GetPrimaryRootWindow(), NULL);
- GetWidget()->Show();
+ views::Widget* widget = new views::Widget;
+ views::Widget::InitParams params =
+ GetDialogWidgetInitParams(this, nullptr, nullptr, gfx::Rect());
+ WmShell::Get()
+ ->GetPrimaryRootWindow()
+ ->GetRootWindowController()
+ ->ConfigureWidgetInitParamsForContainer(
+ widget, kShellWindowId_SystemModalContainer, &params);
+ widget->Init(params);
+ widget->Show();
update_timer_.Start(
FROM_HERE, base::TimeDelta::FromMilliseconds(kCountdownUpdateIntervalMs),

Powered by Google App Engine
This is Rietveld 408576698