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

Unified Diff: ash/accelerators/exit_warning_handler.cc

Issue 22815016: Merge 217429 "Fix crash on signing out with exit warning bubble ..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1599/src/
Patch Set: Created 7 years, 4 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
« no previous file with comments | « ash/accelerators/exit_warning_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/exit_warning_handler.cc
===================================================================
--- ash/accelerators/exit_warning_handler.cc (revision 218536)
+++ ash/accelerators/exit_warning_handler.cc (working copy)
@@ -100,11 +100,10 @@
DISALLOW_COPY_AND_ASSIGN(ExitWarningWidgetDelegateView);
};
-} // namespace
+} // namespace
ExitWarningHandler::ExitWarningHandler()
: state_(IDLE),
- widget_(NULL),
stub_timer_for_test_(false) {
}
@@ -169,6 +168,7 @@
views::Widget::InitParams params;
params.type = views::Widget::InitParams::TYPE_POPUP;
params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
+ params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.accept_events = false;
params.can_activate = false;
params.keep_on_top = true;
@@ -178,7 +178,7 @@
params.parent = Shell::GetContainer(
root_window,
internal::kShellWindowId_SettingBubbleContainer);
- widget_ = new views::Widget;
+ widget_.reset(new views::Widget);
widget_->Init(params);
widget_->SetContentsView(delegate);
widget_->GetNativeView()->SetName("ExitWarningWindow");
@@ -188,10 +188,7 @@
}
void ExitWarningHandler::Hide() {
- if (!widget_)
- return;
- widget_->Close();
- widget_ = NULL;
+ widget_.reset();
}
} // namespace ash
« no previous file with comments | « ash/accelerators/exit_warning_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698