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

Side by Side Diff: chrome/browser/ui/aura/native_window_deletion_observer_aura.cc

Issue 662073002: Fix crash when user closes window prior to the "Confirm Install" prompt showing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/install_prompt_navigator
Patch Set: Created 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/aura/native_window_deletion_observer_aura.h"
6
7 #include "ui/aura/window.h"
8
9 NativeWindowDeletionObserverAura::NativeWindowDeletionObserverAura(
10 gfx::NativeWindow window)
11 : window_(window) {
sky 2014/10/24 20:22:56 nit: indent 2 more.
12 window->AddObserver(this);
13 }
14
15 NativeWindowDeletionObserverAura::~NativeWindowDeletionObserverAura() {
16 if (window_)
17 window_->RemoveObserver(this);
18 }
19
20 bool NativeWindowDeletionObserverAura::IsNativeWindowAlive() const {
21 return window_;
sky 2014/10/24 20:22:56 I'm surprised the compiler is happy with this. Usu
22 }
23
24 void NativeWindowDeletionObserverAura::OnWindowDestroying(
25 aura::Window* window) {
26 window_->RemoveObserver(this);
27 window_ = NULL;
sky 2014/10/24 20:22:56 nullptr.
28 }
29
30 // static
31 scoped_ptr<NativeWindowDeletionObserver> NativeWindowDeletionObserver::Create(
32 gfx::NativeWindow window) {
33 return scoped_ptr<NativeWindowDeletionObserver>(
34 new NativeWindowDeletionObserverAura(window));
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698