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

Side by Side Diff: ash/system/session/logout_confirmation_dialog.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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
« no previous file with comments | « ash/system/palette/palette_utils.cc ('k') | ash/system/toast/toast_overlay.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/system/session/logout_confirmation_dialog.h" 5 #include "ash/system/session/logout_confirmation_dialog.h"
6 6
7 #include "ash/public/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shell_port.h" 9 #include "ash/shell.h"
10 #include "ash/strings/grit/ash_strings.h" 10 #include "ash/strings/grit/ash_strings.h"
11 #include "ash/system/session/logout_confirmation_controller.h" 11 #include "ash/system/session/logout_confirmation_controller.h"
12 #include "ash/system/tray/tray_constants.h" 12 #include "ash/system/tray/tray_constants.h"
13 #include "ash/wm_window.h" 13 #include "ash/wm_window.h"
14 #include "base/location.h" 14 #include "base/location.h"
15 #include "base/time/tick_clock.h" 15 #include "base/time/tick_clock.h"
16 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
17 #include "ui/base/l10n/time_format.h" 17 #include "ui/base/l10n/time_format.h"
18 #include "ui/base/ui_base_types.h" 18 #include "ui/base/ui_base_types.h"
19 #include "ui/gfx/geometry/rect.h" 19 #include "ui/gfx/geometry/rect.h"
(...skipping 23 matching lines...) Expand all
43 kTrayPopupPaddingHorizontal)); 43 kTrayPopupPaddingHorizontal));
44 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 44 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
45 label_->SetMultiLine(true); 45 label_->SetMultiLine(true);
46 AddChildView(label_); 46 AddChildView(label_);
47 47
48 UpdateLabel(); 48 UpdateLabel();
49 49
50 views::Widget* widget = new views::Widget; 50 views::Widget* widget = new views::Widget;
51 views::Widget::InitParams params = 51 views::Widget::InitParams params =
52 GetDialogWidgetInitParams(this, nullptr, nullptr, gfx::Rect()); 52 GetDialogWidgetInitParams(this, nullptr, nullptr, gfx::Rect());
53 ShellPort::Get() 53 Shell::GetPrimaryRootWindowController()
54 ->GetPrimaryRootWindow()
55 ->GetRootWindowController()
56 ->ConfigureWidgetInitParamsForContainer( 54 ->ConfigureWidgetInitParamsForContainer(
57 widget, kShellWindowId_SystemModalContainer, &params); 55 widget, kShellWindowId_SystemModalContainer, &params);
58 widget->Init(params); 56 widget->Init(params);
59 widget->Show(); 57 widget->Show();
60 58
61 update_timer_.Start( 59 update_timer_.Start(
62 FROM_HERE, base::TimeDelta::FromMilliseconds(kCountdownUpdateIntervalMs), 60 FROM_HERE, base::TimeDelta::FromMilliseconds(kCountdownUpdateIntervalMs),
63 this, &LogoutConfirmationDialog::UpdateLabel); 61 this, &LogoutConfirmationDialog::UpdateLabel);
64 } 62 }
65 63
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 ui::TimeFormat::LENGTH_LONG, 10, 111 ui::TimeFormat::LENGTH_LONG, 10,
114 time_remaining))); 112 time_remaining)));
115 } else { 113 } else {
116 label_->SetText( 114 label_->SetText(
117 l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW)); 115 l10n_util::GetStringUTF16(IDS_ASH_LOGOUT_CONFIRMATION_WARNING_NOW));
118 update_timer_.Stop(); 116 update_timer_.Stop();
119 } 117 }
120 } 118 }
121 119
122 } // namespace ash 120 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/palette/palette_utils.cc ('k') | ash/system/toast/toast_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698