OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/accelerators/exit_warning_handler.h" | 5 #include "ash/accelerators/exit_warning_handler.h" |
6 | 6 |
7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 views::Widget::InitParams params; | 179 views::Widget::InitParams params; |
180 params.type = views::Widget::InitParams::TYPE_POPUP; | 180 params.type = views::Widget::InitParams::TYPE_POPUP; |
181 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 181 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
182 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 182 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
183 params.accept_events = false; | 183 params.accept_events = false; |
184 params.can_activate = false; | 184 params.can_activate = false; |
185 params.keep_on_top = true; | 185 params.keep_on_top = true; |
186 params.remove_standard_frame = true; | 186 params.remove_standard_frame = true; |
187 params.delegate = delegate; | 187 params.delegate = delegate; |
188 params.bounds = bounds; | 188 params.bounds = bounds; |
189 params.parent = Shell::GetContainer( | 189 params.parent = |
190 root_window, | 190 Shell::GetContainer(root_window, kShellWindowId_SettingBubbleContainer); |
191 internal::kShellWindowId_SettingBubbleContainer); | |
192 widget_.reset(new views::Widget); | 191 widget_.reset(new views::Widget); |
193 widget_->Init(params); | 192 widget_->Init(params); |
194 widget_->SetContentsView(delegate); | 193 widget_->SetContentsView(delegate); |
195 widget_->GetNativeView()->SetName("ExitWarningWindow"); | 194 widget_->GetNativeView()->SetName("ExitWarningWindow"); |
196 widget_->Show(); | 195 widget_->Show(); |
197 | 196 |
198 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 197 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
199 } | 198 } |
200 | 199 |
201 void ExitWarningHandler::Hide() { | 200 void ExitWarningHandler::Hide() { |
202 widget_.reset(); | 201 widget_.reset(); |
203 } | 202 } |
204 | 203 |
205 } // namespace ash | 204 } // namespace ash |
OLD | NEW |