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

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

Issue 2911393002: Nix GetRootWindowController, use RootWindowController::ForWindow. (Closed)
Patch Set: Sync and rebase. Created 3 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 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/accelerators/exit_warning_handler.h" 5 #include "ash/accelerators/exit_warning_handler.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.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 params.type = views::Widget::InitParams::TYPE_POPUP; 146 params.type = views::Widget::InitParams::TYPE_POPUP;
147 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 147 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
148 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 148 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
149 params.accept_events = false; 149 params.accept_events = false;
150 params.keep_on_top = true; 150 params.keep_on_top = true;
151 params.remove_standard_frame = true; 151 params.remove_standard_frame = true;
152 params.delegate = delegate; 152 params.delegate = delegate;
153 params.bounds = bounds; 153 params.bounds = bounds;
154 params.name = "ExitWarningWindow"; 154 params.name = "ExitWarningWindow";
155 widget_.reset(new views::Widget); 155 widget_.reset(new views::Widget);
156 GetRootWindowController(root_window) 156 RootWindowController::ForWindow(root_window)
157 ->ConfigureWidgetInitParamsForContainer( 157 ->ConfigureWidgetInitParamsForContainer(
158 widget_.get(), kShellWindowId_SettingBubbleContainer, &params); 158 widget_.get(), kShellWindowId_SettingBubbleContainer, &params);
159 widget_->Init(params); 159 widget_->Init(params);
160 widget_->Show(); 160 widget_->Show();
161 161
162 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 162 delegate->NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
163 } 163 }
164 164
165 void ExitWarningHandler::Hide() { 165 void ExitWarningHandler::Hide() {
166 widget_.reset(); 166 widget_.reset();
167 } 167 }
168 168
169 } // namespace ash 169 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698