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

Side by Side Diff: ash/frame/caption_buttons/frame_size_button_unittest.cc

Issue 623613004: Revert of Make WindowState::CanMinimize() take into account WidgetDelegate::CanMinimize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 // Right align the caption button container. 56 // Right align the caption button container.
57 gfx::Size preferred_size = caption_button_container_->GetPreferredSize(); 57 gfx::Size preferred_size = caption_button_container_->GetPreferredSize();
58 caption_button_container_->SetBounds(width() - preferred_size.width(), 0, 58 caption_button_container_->SetBounds(width() - preferred_size.width(), 0,
59 preferred_size.width(), preferred_size.height()); 59 preferred_size.width(), preferred_size.height());
60 } 60 }
61 61
62 virtual void ViewHierarchyChanged( 62 virtual void ViewHierarchyChanged(
63 const ViewHierarchyChangedDetails& details) OVERRIDE { 63 const ViewHierarchyChangedDetails& details) OVERRIDE {
64 if (details.is_add && details.child == this) { 64 if (details.is_add && details.child == this) {
65 caption_button_container_ = 65 caption_button_container_ = new FrameCaptionButtonContainerView(
66 new FrameCaptionButtonContainerView(GetWidget()); 66 GetWidget(), FrameCaptionButtonContainerView::MINIMIZE_ALLOWED);
67 67
68 // Set arbitrary images for the container's buttons so that the buttons 68 // Set arbitrary images for the container's buttons so that the buttons
69 // have non-empty sizes. 69 // have non-empty sizes.
70 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { 70 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) {
71 caption_button_container_->SetButtonImages( 71 caption_button_container_->SetButtonImages(
72 static_cast<CaptionButtonIcon>(icon), 72 static_cast<CaptionButtonIcon>(icon),
73 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE, 73 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE,
74 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I, 74 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I,
75 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, 75 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H,
76 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); 76 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P);
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 466
467 // None of the buttons should stay pressed and the buttons should have their 467 // None of the buttons should stay pressed and the buttons should have their
468 // regular icons. 468 // regular icons.
469 EXPECT_TRUE(AllButtonsInNormalState()); 469 EXPECT_TRUE(AllButtonsInNormalState());
470 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon()); 470 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon());
471 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon()); 471 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon());
472 } 472 }
473 473
474 } // namespace test 474 } // namespace test
475 } // namespace ash 475 } // namespace ash
OLDNEW
« no previous file with comments | « ash/frame/caption_buttons/frame_caption_button_container_view_unittest.cc ('k') | ash/frame/custom_frame_view_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698