summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgiuca <mgiuca@chromium.org>2014-09-21 23:45:53 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-22 06:46:11 +0000
commita1fbd2bd021a98b47c5631186c10ad7001c7c851 (patch)
treef2afcb70b68a6677917b40c48bd24518532b2eb8
parent73c43af29c22bee2314963b04a6dd518a78ca962 (diff)
downloadchromium_src-a1fbd2bd021a98b47c5631186c10ad7001c7c851.zip
chromium_src-a1fbd2bd021a98b47c5631186c10ad7001c7c851.tar.gz
chromium_src-a1fbd2bd021a98b47c5631186c10ad7001c7c851.tar.bz2
Experimental app list: Remove page indicator.
This is a partial revert of commit 6c4617f (r282586), "Experimental app list: Added a current page indicator to the launcher.". Latest mocks indicate the selected page by changing its icon to blue, rather than having a blue line above the icon. The reason we are removing this now is for spacing reasons -- we need to move the grey separator line up by 1px but the blue line can't be moved up unless we shrink the contents view. BUG=411775 Review URL: https://codereview.chromium.org/590023002 Cr-Commit-Position: refs/heads/master@{#295928}
-rw-r--r--ui/app_list/app_list_constants.cc4
-rw-r--r--ui/app_list/app_list_constants.h2
-rw-r--r--ui/app_list/views/contents_switcher_view.cc53
-rw-r--r--ui/app_list/views/contents_switcher_view.h3
4 files changed, 3 insertions, 59 deletions
diff --git a/ui/app_list/app_list_constants.cc b/ui/app_list/app_list_constants.cc
index 8c18991..35a15ba 100644
--- a/ui/app_list/app_list_constants.cc
+++ b/ui/app_list/app_list_constants.cc
@@ -80,10 +80,6 @@ const int kReorderDroppingCircleRadius = 35;
// The padding around the outside of the experimental app list (top and sides).
const int kExperimentalWindowPadding = 23;
-// Height of separator between the main view and contents switcher and of
-// the launcher page indicator.
-const int kContentsSwitcherSeparatorHeight = 1;
-
// Max items allowed in a folder.
size_t kMaxFolderItems = 16;
diff --git a/ui/app_list/app_list_constants.h b/ui/app_list/app_list_constants.h
index d400505..ed7e32f 100644
--- a/ui/app_list/app_list_constants.h
+++ b/ui/app_list/app_list_constants.h
@@ -60,8 +60,6 @@ APP_LIST_EXPORT extern const int kReorderDroppingCircleRadius;
APP_LIST_EXPORT extern const int kExperimentalWindowPadding;
-APP_LIST_EXPORT extern const int kContentsSwitcherSeparatorHeight;
-
APP_LIST_EXPORT extern size_t kMaxFolderItems;
APP_LIST_EXPORT extern const size_t kNumFolderTopItems;
APP_LIST_EXPORT extern const size_t kMaxFolderNameChars;
diff --git a/ui/app_list/views/contents_switcher_view.cc b/ui/app_list/views/contents_switcher_view.cc
index 6aad2e1..cd6a252 100644
--- a/ui/app_list/views/contents_switcher_view.cc
+++ b/ui/app_list/views/contents_switcher_view.cc
@@ -4,13 +4,11 @@
#include "ui/app_list/views/contents_switcher_view.h"
-#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/views/contents_view.h"
-#include "ui/views/background.h"
+#include "ui/base/resource/resource_bundle.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 {
@@ -19,20 +17,6 @@ namespace {
const int kButtonSpacing = 4;
const int kMinimumHeight = 39;
-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
ContentsSwitcherView::ContentsSwitcherView(ContentsView* contents_view)
@@ -53,29 +37,7 @@ void ContentsSwitcherView::AddSwitcherButton(int resource_id, int page_index) {
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_[page_index] = 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);
-
- AddChildView(button_container);
+ AddChildView(button);
}
void ContentsSwitcherView::ButtonPressed(views::Button* sender,
@@ -88,16 +50,7 @@ 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.
- std::map<int, views::View*>::const_iterator it =
- page_active_indicators_.find(old_selected);
- if (it != page_active_indicators_.end())
- it->second->SetVisible(false);
-
- it = page_active_indicators_.find(new_selected);
- if (it != page_active_indicators_.end())
- it->second->SetVisible(true);
+ // TODO(mgiuca): Visually indicate which page is now selected.
}
void ContentsSwitcherView::TransitionStarted() {
diff --git a/ui/app_list/views/contents_switcher_view.h b/ui/app_list/views/contents_switcher_view.h
index a3f1324..9c8f67c 100644
--- a/ui/app_list/views/contents_switcher_view.h
+++ b/ui/app_list/views/contents_switcher_view.h
@@ -44,9 +44,6 @@ class ContentsSwitcherView : public views::View,
ContentsView* contents_view_; // Owned by views hierarchy.
- // Maps page indices to Views owned by views hierarchy.
- std::map<int, views::View*> page_active_indicators_;
-
DISALLOW_COPY_AND_ASSIGN(ContentsSwitcherView);
};