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

Side by Side Diff: ui/views/widget/widget_unittest.cc

Issue 2375903002: Emit OnNativeWidgetDestroying() before clearing the NSWindowDelegate. (Closed)
Patch Set: Add comment 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
« no previous file with comments | « ui/views/widget/native_widget_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 #include <memory> 6 #include <memory>
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 class WidgetBoundsObserver : public WidgetObserver { 2071 class WidgetBoundsObserver : public WidgetObserver {
2072 public: 2072 public:
2073 WidgetBoundsObserver() {} 2073 WidgetBoundsObserver() {}
2074 ~WidgetBoundsObserver() override {} 2074 ~WidgetBoundsObserver() override {}
2075 2075
2076 gfx::Rect bounds() { return bounds_; } 2076 gfx::Rect bounds() { return bounds_; }
2077 2077
2078 // WidgetObserver: 2078 // WidgetObserver:
2079 void OnWidgetDestroying(Widget* widget) override { 2079 void OnWidgetDestroying(Widget* widget) override {
2080 EXPECT_TRUE(widget->GetNativeWindow()); 2080 EXPECT_TRUE(widget->GetNativeWindow());
2081 EXPECT_TRUE(Widget::GetWidgetForNativeWindow(widget->GetNativeWindow()));
2081 bounds_ = widget->GetWindowBoundsInScreen(); 2082 bounds_ = widget->GetWindowBoundsInScreen();
2082 } 2083 }
2083 2084
2084 private: 2085 private:
2085 gfx::Rect bounds_; 2086 gfx::Rect bounds_;
2086 2087
2087 DISALLOW_COPY_AND_ASSIGN(WidgetBoundsObserver); 2088 DISALLOW_COPY_AND_ASSIGN(WidgetBoundsObserver);
2088 }; 2089 };
2089 2090
2090 // Verifies Close() results in destroying. 2091 // Verifies Close() results in destroying.
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3828 Transparency_DesktopWidgetTranslucent 3829 Transparency_DesktopWidgetTranslucent
3829 #endif 3830 #endif
3830 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) { 3831 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) {
3831 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW); 3832 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW);
3832 } 3833 }
3833 3834
3834 #endif // !defined(OS_CHROMEOS) 3835 #endif // !defined(OS_CHROMEOS)
3835 3836
3836 } // namespace test 3837 } // namespace test
3837 } // namespace views 3838 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698