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

Side by Side Diff: ash/common/accelerators/exit_warning_handler.cc

Issue 2390953004: WidgetDelegateView is its own contents view. (Closed)
Patch Set: another minor fix Created 4 years, 2 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
OLDNEW
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/common/accelerators/exit_warning_handler.h" 5 #include "ash/common/accelerators/exit_warning_handler.h"
6 6
7 #include "ash/common/shell_delegate.h" 7 #include "ash/common/shell_delegate.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm_root_window_controller.h" 9 #include "ash/common/wm_root_window_controller.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 params.accept_events = false; 159 params.accept_events = false;
160 params.keep_on_top = true; 160 params.keep_on_top = true;
161 params.remove_standard_frame = true; 161 params.remove_standard_frame = true;
162 params.delegate = delegate; 162 params.delegate = delegate;
163 params.bounds = bounds; 163 params.bounds = bounds;
164 params.name = "ExitWarningWindow"; 164 params.name = "ExitWarningWindow";
165 widget_.reset(new views::Widget); 165 widget_.reset(new views::Widget);
166 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( 166 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
167 widget_.get(), kShellWindowId_SettingBubbleContainer, &params); 167 widget_.get(), kShellWindowId_SettingBubbleContainer, &params);
168 widget_->Init(params); 168 widget_->Init(params);
169 widget_->SetContentsView(delegate);
170 widget_->Show(); 169 widget_->Show();
171 170
172 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 171 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
173 } 172 }
174 173
175 void ExitWarningHandler::Hide() { 174 void ExitWarningHandler::Hide() {
176 widget_.reset(); 175 widget_.reset();
177 } 176 }
178 177
179 } // namespace ash 178 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698