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

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

Issue 2390953004: WidgetDelegateView is its own contents view. (Closed)
Patch Set: another minor fix 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
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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 } 1979 }
1980 1980
1981 #endif // !defined(OS_MACOSX) || defined(USE_AURA) 1981 #endif // !defined(OS_MACOSX) || defined(USE_AURA)
1982 1982
1983 // See description of RunGetNativeThemeFromDestructor() for details. 1983 // See description of RunGetNativeThemeFromDestructor() for details.
1984 class GetNativeThemeFromDestructorView : public WidgetDelegateView { 1984 class GetNativeThemeFromDestructorView : public WidgetDelegateView {
1985 public: 1985 public:
1986 GetNativeThemeFromDestructorView() {} 1986 GetNativeThemeFromDestructorView() {}
1987 ~GetNativeThemeFromDestructorView() override { VerifyNativeTheme(); } 1987 ~GetNativeThemeFromDestructorView() override { VerifyNativeTheme(); }
1988 1988
1989 View* GetContentsView() override { return this; }
1990
1991 private: 1989 private:
1992 void VerifyNativeTheme() { 1990 void VerifyNativeTheme() {
1993 ASSERT_TRUE(GetNativeTheme() != NULL); 1991 ASSERT_TRUE(GetNativeTheme() != NULL);
1994 } 1992 }
1995 1993
1996 DISALLOW_COPY_AND_ASSIGN(GetNativeThemeFromDestructorView); 1994 DISALLOW_COPY_AND_ASSIGN(GetNativeThemeFromDestructorView);
1997 }; 1995 };
1998 1996
1999 // Verifies GetNativeTheme() from the destructor of a WidgetDelegateView doesn't 1997 // Verifies GetNativeTheme() from the destructor of a WidgetDelegateView doesn't
2000 // crash. |is_first_run| is true if this is the first call. A return value of 1998 // crash. |is_first_run| is true if this is the first call. A return value of
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
3828 Transparency_DesktopWidgetTranslucent 3826 Transparency_DesktopWidgetTranslucent
3829 #endif 3827 #endif
3830 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) { 3828 TEST_F(CompositingWidgetTest, MAYBE_Transparency_DesktopWidgetTranslucent) {
3831 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW); 3829 CheckAllWidgetsForOpacity(Widget::InitParams::TRANSLUCENT_WINDOW);
3832 } 3830 }
3833 3831
3834 #endif // !defined(OS_CHROMEOS) 3832 #endif // !defined(OS_CHROMEOS)
3835 3833
3836 } // namespace test 3834 } // namespace test
3837 } // namespace views 3835 } // namespace views
OLDNEW
« ui/views/widget/widget_delegate.h ('K') | « ui/views/widget/widget_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698