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 "ui/app_list/views/contents_switcher_view.h" | 5 #include "ui/app_list/views/contents_switcher_view.h" |
6 | 6 |
7 #include "ui/app_list/views/contents_view.h" | 7 #include "ui/app_list/views/contents_view.h" |
8 #include "ui/base/resource/resource_bundle.h" | 8 #include "ui/base/resource/resource_bundle.h" |
9 #include "ui/views/controls/button/custom_button.h" | 9 #include "ui/views/controls/button/custom_button.h" |
10 #include "ui/views/controls/button/image_button.h" | 10 #include "ui/views/controls/button/image_button.h" |
11 #include "ui/views/layout/box_layout.h" | 11 #include "ui/views/layout/box_layout.h" |
12 | 12 |
13 namespace app_list { | 13 namespace app_list { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const int kButtonSpacing = 4; | 17 const int kButtonSpacing = 4; |
18 const int kMinimumHeight = 39; | 18 const int kMinimumHeight = 40; |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
22 ContentsSwitcherView::ContentsSwitcherView(ContentsView* contents_view) | 22 ContentsSwitcherView::ContentsSwitcherView(ContentsView* contents_view) |
23 : contents_view_(contents_view) { | 23 : contents_view_(contents_view) { |
24 views::BoxLayout* layout = new views::BoxLayout( | 24 views::BoxLayout* layout = new views::BoxLayout( |
25 views::BoxLayout::kHorizontal, 0, 0, kButtonSpacing); | 25 views::BoxLayout::kHorizontal, 0, 0, kButtonSpacing); |
26 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); | 26 layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER); |
27 layout->set_minimum_cross_axis_size(kMinimumHeight); | 27 layout->set_minimum_cross_axis_size(kMinimumHeight); |
28 SetLayoutManager(layout); | 28 SetLayoutManager(layout); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 if (pm.IsRevertingCurrentTransition()) { | 67 if (pm.IsRevertingCurrentTransition()) { |
68 // Swap the direction if the transition is reversed. | 68 // Swap the direction if the transition is reversed. |
69 old_selected = pm.transition().target_page; | 69 old_selected = pm.transition().target_page; |
70 new_selected = pm.selected_page(); | 70 new_selected = pm.selected_page(); |
71 } | 71 } |
72 | 72 |
73 SelectedPageChanged(old_selected, new_selected); | 73 SelectedPageChanged(old_selected, new_selected); |
74 } | 74 } |
75 | 75 |
76 } // namespace app_list | 76 } // namespace app_list |
OLD | NEW |