| Index: ui/app_list/views/contents_switcher_view.cc
|
| diff --git a/ui/app_list/views/contents_switcher_view.cc b/ui/app_list/views/contents_switcher_view.cc
|
| index c975065e578830114ff7b3c53c524430692c1f4c..95669439fdb2f06df7d6ed6533d0e8d832cb101b 100644
|
| --- a/ui/app_list/views/contents_switcher_view.cc
|
| +++ b/ui/app_list/views/contents_switcher_view.cc
|
| @@ -6,34 +6,16 @@
|
|
|
| #include "ui/app_list/app_list_constants.h"
|
| #include "ui/app_list/views/contents_view.h"
|
| -#include "ui/views/background.h"
|
| #include "ui/views/controls/button/custom_button.h"
|
| #include "ui/views/controls/button/image_button.h"
|
| #include "ui/views/layout/box_layout.h"
|
| -#include "ui/views/layout/fill_layout.h"
|
|
|
| namespace app_list {
|
|
|
| namespace {
|
|
|
| -const int kButtonImageSize = 32;
|
| -const int kPreferredHeight =
|
| - kButtonImageSize + kContentsSwitcherSeparatorHeight;
|
| +const int kPreferredHeight = 32;
|
| const int kButtonSpacing = 4;
|
| -
|
| -class ContentsPageIndicatorView : public views::View {
|
| - public:
|
| - ContentsPageIndicatorView() {};
|
| - virtual ~ContentsPageIndicatorView() {};
|
| -
|
| - // Overridden from views::View:
|
| - virtual gfx::Size GetPreferredSize() const OVERRIDE {
|
| - return gfx::Size(0, kContentsSwitcherSeparatorHeight);
|
| - };
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(ContentsPageIndicatorView);
|
| -};
|
|
|
| } // namespace
|
|
|
| @@ -49,37 +31,13 @@
|
|
|
| void ContentsSwitcherView::AddSwitcherButton(int resource_id, int page_index) {
|
| views::ImageButton* button = new views::ImageButton(this);
|
| - button->SetPreferredSize(gfx::Size(kButtonImageSize, kButtonImageSize));
|
| if (resource_id) {
|
| button->SetImage(
|
| views::CustomButton::STATE_NORMAL,
|
| ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id));
|
| }
|
| button->set_tag(page_index);
|
| -
|
| - // Add an indicator for the current launcher page.
|
| - app_list::ContentsPageIndicatorView* indicator =
|
| - new app_list::ContentsPageIndicatorView();
|
| - indicator->set_background(
|
| - views::Background::CreateSolidBackground(app_list::kPagerSelectedColor));
|
| - indicator->SetVisible(false);
|
| - page_active_indicators_.push_back(indicator);
|
| -
|
| - // A container view that will consume space when its child is not visible.
|
| - // TODO(calamity): Remove this once BoxLayout supports space-consuming
|
| - // invisible views.
|
| - views::View* indicator_container = new views::View();
|
| - indicator_container->SetLayoutManager(new views::FillLayout());
|
| - indicator_container->AddChildView(indicator);
|
| -
|
| - // View containing the indicator view and image button.
|
| - views::View* button_container = new views::View();
|
| - button_container->SetLayoutManager(
|
| - new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
|
| - button_container->AddChildView(indicator_container);
|
| - button_container->AddChildView(button);
|
| -
|
| - buttons_->AddChildView(button_container);
|
| + buttons_->AddChildView(button);
|
| }
|
|
|
| gfx::Size ContentsSwitcherView::GetPreferredSize() const {
|
| @@ -103,36 +61,4 @@
|
| contents_view_->SetActivePage(sender->tag());
|
| }
|
|
|
| -void ContentsSwitcherView::TotalPagesChanged() {
|
| -}
|
| -
|
| -void ContentsSwitcherView::SelectedPageChanged(int old_selected,
|
| - int new_selected) {
|
| - // Makes the indicator visible when it is first drawn and when the
|
| - // selected page is changed.
|
| - int num_indicators = static_cast<int>(page_active_indicators_.size());
|
| - if (old_selected >= 0 && old_selected < num_indicators)
|
| - page_active_indicators_[old_selected]->SetVisible(false);
|
| -
|
| - if (new_selected >= 0 && new_selected < num_indicators)
|
| - page_active_indicators_[new_selected]->SetVisible(true);
|
| -}
|
| -
|
| -void ContentsSwitcherView::TransitionStarted() {
|
| -}
|
| -
|
| -void ContentsSwitcherView::TransitionChanged() {
|
| - // Change the indicator during a launcher page transition.
|
| - const PaginationModel& pm = contents_view_->pagination_model();
|
| - int old_selected = pm.selected_page();
|
| - int new_selected = pm.transition().target_page;
|
| - if (pm.IsRevertingCurrentTransition()) {
|
| - // Swap the direction if the transition is reversed.
|
| - old_selected = pm.transition().target_page;
|
| - new_selected = pm.selected_page();
|
| - }
|
| -
|
| - SelectedPageChanged(old_selected, new_selected);
|
| -}
|
| -
|
| } // namespace app_list
|
|
|