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