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

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

Issue 108193005: Fixing opacity for browser frame window on ASH/Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified definition for UseTransparentWindows as per code review discussion. Created 7 years 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 | Annotate | Revision Log
« ui/views/widget/widget.cc ('K') | « ui/views/widget/widget.cc ('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 <set> 6 #include <set>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ui::WindowShowState GetWidgetShowState(const Widget* widget) { 164 ui::WindowShowState GetWidgetShowState(const Widget* widget) {
165 // Use IsMaximized/IsMinimized/IsFullScreen instead of GetWindowPlacement 165 // Use IsMaximized/IsMinimized/IsFullScreen instead of GetWindowPlacement
166 // because the former is implemented on all platforms but the latter is not. 166 // because the former is implemented on all platforms but the latter is not.
167 return widget->IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN : 167 return widget->IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN :
168 widget->IsMaximized() ? ui::SHOW_STATE_MAXIMIZED : 168 widget->IsMaximized() ? ui::SHOW_STATE_MAXIMIZED :
169 widget->IsMinimized() ? ui::SHOW_STATE_MINIMIZED : 169 widget->IsMinimized() ? ui::SHOW_STATE_MINIMIZED :
170 ui::SHOW_STATE_NORMAL; 170 ui::SHOW_STATE_NORMAL;
171 } 171 }
172 172
173 TEST_F(WidgetTest, WidgetInitParams) { 173 TEST_F(WidgetTest, WidgetInitParams) {
174 ASSERT_FALSE(views_delegate().UseTransparentWindows()); 174 ASSERT_FALSE(views_delegate().UseTransparentWindows(NULL));
175 175
176 // Widgets are not transparent by default. 176 // Widgets are not transparent by default.
177 Widget::InitParams init1; 177 Widget::InitParams init1;
178 EXPECT_EQ(Widget::InitParams::INFER_OPACITY, init1.opacity); 178 EXPECT_EQ(Widget::InitParams::INFER_OPACITY, init1.opacity);
179 179
180 // Non-window widgets are not transparent either. 180 // Non-window widgets are not transparent either.
181 Widget::InitParams init2(Widget::InitParams::TYPE_MENU); 181 Widget::InitParams init2(Widget::InitParams::TYPE_MENU);
182 EXPECT_EQ(Widget::InitParams::INFER_OPACITY, init2.opacity); 182 EXPECT_EQ(Widget::InitParams::INFER_OPACITY, init2.opacity);
183 183
184 // A ViewsDelegate can set windows transparent by default. 184 // A ViewsDelegate can set windows transparent by default.
(...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 EXPECT_EQ(activate_result, MA_ACTIVATE); 2144 EXPECT_EQ(activate_result, MA_ACTIVATE);
2145 2145
2146 modal_dialog_widget->CloseNow(); 2146 modal_dialog_widget->CloseNow();
2147 top_level_widget.CloseNow(); 2147 top_level_widget.CloseNow();
2148 } 2148 }
2149 #endif 2149 #endif
2150 #endif 2150 #endif
2151 2151
2152 } // namespace test 2152 } // namespace test
2153 } // namespace views 2153 } // namespace views
OLDNEW
« ui/views/widget/widget.cc ('K') | « ui/views/widget/widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698