diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 20:08:36 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 20:08:36 +0000 |
commit | 4eff7becd7a6be9621ae807c7aa3627d95c5913b (patch) | |
tree | cf03c223fbba7a530e5a455022acf684a1548854 | |
parent | 0d3bdf28d7c43169fba92e70aed09f8178cc7004 (diff) | |
download | chromium_src-4eff7becd7a6be9621ae807c7aa3627d95c5913b.zip chromium_src-4eff7becd7a6be9621ae807c7aa3627d95c5913b.tar.gz chromium_src-4eff7becd7a6be9621ae807c7aa3627d95c5913b.tar.bz2 |
Revert 131193 - chromeos: No icon shadow for slow boards.
Shadow generate seems causing app list animation janky on slow boards.
Thus, disable it on those boards.
BUG=122371
TEST=Verify fix for issue 122371.
Review URL: http://codereview.chromium.org/10008057
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10032008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131419 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ash/app_list/app_list_item_view.cc | 5 | ||||
-rw-r--r-- | ash/app_list/app_list_model_view.cc | 6 | ||||
-rw-r--r-- | ash/app_list/app_list_model_view.h | 8 | ||||
-rw-r--r-- | ash/app_list/app_list_view.cc | 4 | ||||
-rw-r--r-- | ash/app_list/app_list_view_delegate.h | 4 | ||||
-rw-r--r-- | ash/shell/app_list.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/ash/app_list/app_list_view_delegate.cc | 32 | ||||
-rw-r--r-- | chrome/browser/ui/views/ash/app_list/app_list_view_delegate.h | 1 |
8 files changed, 4 insertions, 60 deletions
diff --git a/ash/app_list/app_list_item_view.cc b/ash/app_list/app_list_item_view.cc index fc2f34d..5addda1 100644 --- a/ash/app_list/app_list_item_view.cc +++ b/ash/app_list/app_list_item_view.cc @@ -261,11 +261,6 @@ void AppListItemView::UpdateIcon() { CancelPendingIconOperation(); - if (!list_model_view_->generate_icon_shadow()) { - icon_->SetImage(SkBitmapOperations::CreateResizedBitmap(icon, icon_size_)); - return; - } - SkBitmap shadow; if (IconCache::GetInstance()->Get(icon, icon_size_, &shadow)) { icon_->SetImage(shadow); diff --git a/ash/app_list/app_list_model_view.cc b/ash/app_list/app_list_model_view.cc index adc6194..8b60540 100644 --- a/ash/app_list/app_list_model_view.cc +++ b/ash/app_list/app_list_model_view.cc @@ -9,10 +9,8 @@ namespace ash { -AppListModelView::AppListModelView(views::ButtonListener* listener, - bool generate_icon_shadow) - : generate_icon_shadow_(generate_icon_shadow), - model_(NULL), +AppListModelView::AppListModelView(views::ButtonListener* listener) + : model_(NULL), listener_(listener), selected_item_index_(-1), cols_(0) { diff --git a/ash/app_list/app_list_model_view.h b/ash/app_list/app_list_model_view.h index 2f95fad..ce2877b 100644 --- a/ash/app_list/app_list_model_view.h +++ b/ash/app_list/app_list_model_view.h @@ -23,7 +23,7 @@ class AppListModel; class ASH_EXPORT AppListModelView : public views::View, public ui::ListModelObserver { public: - AppListModelView(views::ButtonListener* listener, bool generate_icon_shadow); + explicit AppListModelView(views::ButtonListener* listener); virtual ~AppListModelView(); // Calculate preferred icon size, rows and cols for given |content_size| and @@ -40,10 +40,6 @@ class ASH_EXPORT AppListModelView : public views::View, void SetSelectedItem(AppListItemView* item); void ClearSelectedItem(AppListItemView* item); - bool generate_icon_shadow() const { - return generate_icon_shadow_; - } - private: // Updates from model. void Update(); @@ -62,8 +58,6 @@ class ASH_EXPORT AppListModelView : public views::View, virtual void ListItemsRemoved(int start, int count) OVERRIDE; virtual void ListItemsChanged(int start, int count) OVERRIDE; - bool generate_icon_shadow_; - AppListModel* model_; // Owned by parent AppListView. views::ButtonListener* listener_; diff --git a/ash/app_list/app_list_view.cc b/ash/app_list/app_list_view.cc index dd93f16..28b8110 100644 --- a/ash/app_list/app_list_view.cc +++ b/ash/app_list/app_list_view.cc @@ -72,9 +72,7 @@ void AppListView::Close() { } void AppListView::Init(const gfx::Rect& bounds) { - bool generate_icon_shadow = delegate_.get() ? - delegate_->ShouldGenerateIconShadow() : true; - model_view_ = new AppListModelView(this, generate_icon_shadow); + model_view_ = new AppListModelView(this); model_view_->SetPaintToLayer(true); model_view_->layer()->SetFillsBoundsOpaquely(false); AddChildView(model_view_); diff --git a/ash/app_list/app_list_view_delegate.h b/ash/app_list/app_list_view_delegate.h index ea27dc5..1950a12 100644 --- a/ash/app_list/app_list_view_delegate.h +++ b/ash/app_list/app_list_view_delegate.h @@ -20,10 +20,6 @@ class ASH_EXPORT AppListViewDelegate { // AppListView owns the delegate. virtual ~AppListViewDelegate() {} - // Invoked to get whether icon shadow should be generated. - // Returns true if icon shadows should be generated. - virtual bool ShouldGenerateIconShadow() = 0; - // Invoked to set the model that AppListView uses. // Note that AppListView owns the model. virtual void SetModel(AppListModel* model) = 0; diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc index 10e3783..cfe707a9 100644 --- a/ash/shell/app_list.cc +++ b/ash/shell/app_list.cc @@ -113,10 +113,6 @@ class ExampleAppListViewDelegate : public ash::AppListViewDelegate { private: // Overridden from ash::AppListViewDelegate: - virtual bool ShouldGenerateIconShadow() OVERRIDE { - return true; - } - virtual void SetModel(AppListModel* model) OVERRIDE { model_ = model; } diff --git a/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.cc b/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.cc index d76aad1..487830b 100644 --- a/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.cc +++ b/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.cc @@ -8,44 +8,12 @@ #include "chrome/browser/ui/views/ash/app_list/app_list_model_builder.h" #include "chrome/browser/ui/views/ash/app_list/chrome_app_list_item.h" -#if defined(OS_CHROMEOS) -#include "chrome/browser/chromeos/system/statistics_provider.h" -#endif - AppListViewDelegate::AppListViewDelegate() { } AppListViewDelegate::~AppListViewDelegate() { } -bool AppListViewDelegate::ShouldGenerateIconShadow() { -#if defined(OS_CHROMEOS) - static bool use_shadow = true; - static bool configured = false; - - if (!configured) { - std::string board; - chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( - "CHROMEOS_RELEASE_BOARD", &board); - - // Boards that should not have shadow. - const char* kBoards[] = { "x86-mario", "x86-alex", "x86-zgb" }; - for (size_t i = 0; i < arraysize(kBoards); ++i) { - if (board == kBoards[i]) { - use_shadow = false; - break; - } - } - - configured = true; - } - - return use_shadow; -#else - return true; -#endif -} - void AppListViewDelegate::SetModel(ash::AppListModel* model) { if (model) { if (!model_builder_.get()) { diff --git a/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.h b/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.h index cb815bf..aefe3ee 100644 --- a/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.h +++ b/chrome/browser/ui/views/ash/app_list/app_list_view_delegate.h @@ -20,7 +20,6 @@ class AppListViewDelegate : public ash::AppListViewDelegate { private: // Overridden from ash::AppListViewDelegate: - virtual bool ShouldGenerateIconShadow() OVERRIDE; virtual void SetModel(ash::AppListModel* model) OVERRIDE; virtual void UpdateModel(const std::string& query) OVERRIDE; virtual void OnAppListItemActivated(ash::AppListItemModel* item, |