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/common/frame/caption_buttons/frame_size_button.h" | 5 #include "ash/common/frame/caption_buttons/frame_size_button.h" |
6 | 6 |
7 #include "ash/common/ash_layout_constants.h" | 7 #include "ash/common/ash_layout_constants.h" |
8 #include "ash/common/frame/caption_buttons/frame_caption_button.h" | 8 #include "ash/common/frame/caption_buttons/frame_caption_button.h" |
9 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 9 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| 11 #include "ash/resources/vector_icons/vector_icons.h" |
11 #include "ash/shell.h" | 12 #include "ash/shell.h" |
12 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
13 #include "ash/wm/window_state_aura.h" | 14 #include "ash/wm/window_state_aura.h" |
14 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
15 #include "grit/ash_resources.h" | 16 #include "grit/ash_resources.h" |
16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
17 #include "ui/display/display.h" | 18 #include "ui/display/display.h" |
18 #include "ui/display/screen.h" | 19 #include "ui/display/screen.h" |
19 #include "ui/events/gesture_detection/gesture_configuration.h" | 20 #include "ui/events/gesture_detection/gesture_configuration.h" |
20 #include "ui/events/test/event_generator.h" | 21 #include "ui/events/test/event_generator.h" |
21 #include "ui/gfx/vector_icons_public.h" | |
22 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
23 #include "ui/views/widget/widget_delegate.h" | 23 #include "ui/views/widget/widget_delegate.h" |
24 | 24 |
25 namespace ash { | 25 namespace ash { |
26 namespace test { | 26 namespace test { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 class TestWidgetDelegate : public views::WidgetDelegateView { | 30 class TestWidgetDelegate : public views::WidgetDelegateView { |
31 public: | 31 public: |
(...skipping 26 matching lines...) Expand all Loading... |
58 if (details.is_add && details.child == this) { | 58 if (details.is_add && details.child == this) { |
59 caption_button_container_ = | 59 caption_button_container_ = |
60 new FrameCaptionButtonContainerView(GetWidget()); | 60 new FrameCaptionButtonContainerView(GetWidget()); |
61 | 61 |
62 // Set arbitrary images for the button icons and assign the default | 62 // Set arbitrary images for the button icons and assign the default |
63 // caption button size. | 63 // caption button size. |
64 caption_button_container_->SetButtonSize( | 64 caption_button_container_->SetButtonSize( |
65 GetAshLayoutSize(AshLayoutSize::NON_BROWSER_CAPTION_BUTTON)); | 65 GetAshLayoutSize(AshLayoutSize::NON_BROWSER_CAPTION_BUTTON)); |
66 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { | 66 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { |
67 caption_button_container_->SetButtonImage( | 67 caption_button_container_->SetButtonImage( |
68 static_cast<CaptionButtonIcon>(icon), | 68 static_cast<CaptionButtonIcon>(icon), kWindowControlCloseIcon); |
69 gfx::VectorIconId::WINDOW_CONTROL_CLOSE); | |
70 } | 69 } |
71 | 70 |
72 AddChildView(caption_button_container_); | 71 AddChildView(caption_button_container_); |
73 } | 72 } |
74 } | 73 } |
75 | 74 |
76 // Not owned. | 75 // Not owned. |
77 ash::FrameCaptionButtonContainerView* caption_button_container_; | 76 ash::FrameCaptionButtonContainerView* caption_button_container_; |
78 | 77 |
79 DISALLOW_COPY_AND_ASSIGN(TestWidgetDelegate); | 78 DISALLOW_COPY_AND_ASSIGN(TestWidgetDelegate); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 455 |
457 // None of the buttons should stay pressed and the buttons should have their | 456 // None of the buttons should stay pressed and the buttons should have their |
458 // regular icons. | 457 // regular icons. |
459 EXPECT_TRUE(AllButtonsInNormalState()); | 458 EXPECT_TRUE(AllButtonsInNormalState()); |
460 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon()); | 459 EXPECT_EQ(CAPTION_BUTTON_ICON_MINIMIZE, minimize_button()->icon()); |
461 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon()); | 460 EXPECT_EQ(CAPTION_BUTTON_ICON_CLOSE, close_button()->icon()); |
462 } | 461 } |
463 | 462 |
464 } // namespace test | 463 } // namespace test |
465 } // namespace ash | 464 } // namespace ash |
OLD | NEW |