| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/wm/caption_buttons/frame_maximize_button.h" | 5 #include "ash/wm/caption_buttons/frame_maximize_button.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const ViewHierarchyChangedDetails& details) OVERRIDE { | 93 const ViewHierarchyChangedDetails& details) OVERRIDE { |
| 94 if (details.is_add && details.child == this) { | 94 if (details.is_add && details.child == this) { |
| 95 caption_button_container_ = new FrameCaptionButtonContainerView( | 95 caption_button_container_ = new FrameCaptionButtonContainerView( |
| 96 GetWidget(), FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); | 96 GetWidget(), FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); |
| 97 | 97 |
| 98 // Set arbitrary images for the container's buttons so that the buttons | 98 // Set arbitrary images for the container's buttons so that the buttons |
| 99 // have non-empty sizes. | 99 // have non-empty sizes. |
| 100 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { | 100 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { |
| 101 caption_button_container_->SetButtonImages( | 101 caption_button_container_->SetButtonImages( |
| 102 static_cast<CaptionButtonIcon>(icon), | 102 static_cast<CaptionButtonIcon>(icon), |
| 103 IDR_AURA_WINDOW_CLOSE, | 103 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE, |
| 104 IDR_AURA_WINDOW_CLOSE_H, | 104 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I, |
| 105 IDR_AURA_WINDOW_CLOSE_P); | 105 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, |
| 106 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); |
| 106 } | 107 } |
| 107 | 108 |
| 108 AddChildView(caption_button_container_); | 109 AddChildView(caption_button_container_); |
| 109 } | 110 } |
| 110 } | 111 } |
| 111 | 112 |
| 112 // Not owned. | 113 // Not owned. |
| 113 ash::FrameCaptionButtonContainerView* caption_button_container_; | 114 ash::FrameCaptionButtonContainerView* caption_button_container_; |
| 114 | 115 |
| 115 DISALLOW_COPY_AND_ASSIGN(TestWidgetDelegate); | 116 DISALLOW_COPY_AND_ASSIGN(TestWidgetDelegate); |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 | 884 |
| 884 // Test that we have properly reset the state of the now inactive window. | 885 // Test that we have properly reset the state of the now inactive window. |
| 885 EXPECT_FALSE(maximize_button->maximizer()); | 886 EXPECT_FALSE(maximize_button->maximizer()); |
| 886 EXPECT_FALSE(maximize_button->phantom_window_open()); | 887 EXPECT_FALSE(maximize_button->phantom_window_open()); |
| 887 EXPECT_TRUE(wm::GetWindowState(window)->IsNormalShowState()); | 888 EXPECT_TRUE(wm::GetWindowState(window)->IsNormalShowState()); |
| 888 EXPECT_EQ(initial_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 889 EXPECT_EQ(initial_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
| 889 } | 890 } |
| 890 | 891 |
| 891 } // namespace test | 892 } // namespace test |
| 892 } // namespace ash | 893 } // namespace ash |
| OLD | NEW |