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

Unified Diff: ash/test/child_modal_window.h

Issue 2733883003: Makes ChildModalWindow not leak (Closed)
Patch Set: cleanup Created 3 years, 9 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 | « no previous file | ash/test/child_modal_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/child_modal_window.h
diff --git a/ash/test/child_modal_window.h b/ash/test/child_modal_window.h
index 939f724dcf98d6d92992a46993f01c44aaf567d3..3ef5243316ed444dc603437624d265811da7a3c2 100644
--- a/ash/test/child_modal_window.h
+++ b/ash/test/child_modal_window.h
@@ -5,6 +5,8 @@
#ifndef ASH_TEST_CHILD_MODAL_WINDOW_H_
#define ASH_TEST_CHILD_MODAL_WINDOW_H_
+#include <memory>
+
#include "base/macros.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/widget/widget_delegate.h"
@@ -21,18 +23,18 @@ class Widget;
namespace ash {
namespace test {
-void CreateChildModalParent(gfx::NativeView context);
+void CreateChildModalParent(aura::Window* context);
class ChildModalParent : public views::WidgetDelegateView,
public views::ButtonListener,
public views::WidgetObserver {
public:
- ChildModalParent(gfx::NativeView context);
+ ChildModalParent(aura::Window* context);
~ChildModalParent() override;
void ShowChild();
- gfx::NativeWindow GetModalParent() const;
- gfx::NativeWindow GetChild() const;
+ aura::Window* GetModalParent() const;
+ aura::Window* GetChild() const;
private:
views::Widget* CreateChild();
@@ -53,6 +55,10 @@ class ChildModalParent : public views::WidgetDelegateView,
// Overridden from WidgetObserver:
void OnWidgetDestroying(views::Widget* widget) override;
+ // This is the Widget this class creates to contain the child Views. This
+ // class is *not* the WidgetDelegateView for this Widget.
+ std::unique_ptr<views::Widget> widget_;
+
// The button to toggle showing and hiding the child window. The child window
// does not block input to this button.
views::LabelButton* button_;
@@ -63,10 +69,6 @@ class ChildModalParent : public views::WidgetDelegateView,
// The host for the modal parent.
views::NativeViewHost* host_;
- // The modal parent of the child window. The child window blocks input to this
- // view.
- gfx::NativeWindow modal_parent_;
-
// The child window.
views::Widget* child_;
« no previous file with comments | « no previous file | ash/test/child_modal_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698