| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |