| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame/caption_buttons/frame_size_button.h" | 5 #include "ash/frame/caption_buttons/frame_size_button.h" |
| 6 | 6 |
| 7 #include "ash/frame/caption_buttons/frame_caption_button.h" | 7 #include "ash/frame/caption_buttons/frame_caption_button.h" |
| 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Right align the caption button container. | 53 // Right align the caption button container. |
| 54 gfx::Size preferred_size = caption_button_container_->GetPreferredSize(); | 54 gfx::Size preferred_size = caption_button_container_->GetPreferredSize(); |
| 55 caption_button_container_->SetBounds(width() - preferred_size.width(), 0, | 55 caption_button_container_->SetBounds(width() - preferred_size.width(), 0, |
| 56 preferred_size.width(), preferred_size.height()); | 56 preferred_size.width(), preferred_size.height()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual void ViewHierarchyChanged( | 59 virtual void ViewHierarchyChanged( |
| 60 const ViewHierarchyChangedDetails& details) OVERRIDE { | 60 const ViewHierarchyChangedDetails& details) OVERRIDE { |
| 61 if (details.is_add && details.child == this) { | 61 if (details.is_add && details.child == this) { |
| 62 caption_button_container_ = new FrameCaptionButtonContainerView( | 62 caption_button_container_ = new FrameCaptionButtonContainerView( |
| 63 GetWidget(), FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); | 63 GetWidget()); |
| 64 | 64 |
| 65 // Set arbitrary images for the container's buttons so that the buttons | 65 // Set arbitrary images for the container's buttons so that the buttons |
| 66 // have non-empty sizes. | 66 // have non-empty sizes. |
| 67 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { | 67 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { |
| 68 caption_button_container_->SetButtonImages( | 68 caption_button_container_->SetButtonImages( |
| 69 static_cast<CaptionButtonIcon>(icon), | 69 static_cast<CaptionButtonIcon>(icon), |
| 70 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE, | 70 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE, |
| 71 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I, | 71 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I, |
| 72 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, | 72 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, |
| 73 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); | 73 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 463 |
| 464 // None of the buttons should stay pressed and the buttons should have their | 464 // None of the buttons should stay pressed and the buttons should have their |
| 465 // regular icons. | 465 // regular icons. |
| 466 EXPECT_TRUE(AllButtonsInNormalState()); | 466 EXPECT_TRUE(AllButtonsInNormalState()); |
| 467 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon()); | 467 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon()); |
| 468 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon()); | 468 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon()); |
| 469 } | 469 } |
| 470 | 470 |
| 471 } // namespace test | 471 } // namespace test |
| 472 } // namespace ash | 472 } // namespace ash |
| OLD | NEW |