diff options
author | flackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-20 17:34:18 +0000 |
---|---|---|
committer | flackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-20 17:34:18 +0000 |
commit | 97648ffce8ea8d9a3d2408e9c6d633a575ddfd76 (patch) | |
tree | 2928f95e4eb38d7989d22f51e1c104270be35f24 /ash/launcher/launcher_view.cc | |
parent | 5426114610074f80dab6c33a25accab67f4223a4 (diff) | |
download | chromium_src-97648ffce8ea8d9a3d2408e9c6d633a575ddfd76.zip chromium_src-97648ffce8ea8d9a3d2408e9c6d633a575ddfd76.tar.gz chromium_src-97648ffce8ea8d9a3d2408e9c6d633a575ddfd76.tar.bz2 |
Revert 152221 - chromeos: Sync animation.
This was causing Linux ChromiumOS (dbg) browser_tests to fail with timeouts on several tests, identified with a local bisect.
- Pulse app list button while LauncherModel has STATUS_LOADING;
- Remove LauncherItemStatus::STATUS_IS_PENDING etc since it is no longer needed;
- ChromeLauncherController sets LauncherModel::STATUS_LOADING on starting and
watch for sync finish and pending extension install. It sets
LauncherModel::STATUS_NORMAL when sync is finished and there is no pending
extension install from sync, or when a maximum 60 seconds timeout since
turning on loading status;
BUG=129236
TEST=Verify sync animation after OOBE.
Review URL: https://chromiumcodereview.appspot.com/10829268
TBR=xiyuan@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10827420
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152352 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher_view.cc')
-rw-r--r-- | ash/launcher/launcher_view.cc | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc index 9a72042..20fa176 100644 --- a/ash/launcher/launcher_view.cc +++ b/ash/launcher/launcher_view.cc @@ -18,20 +18,27 @@ #include "ash/shell.h" #include "ash/shell_delegate.h" #include "base/auto_reset.h" -#include "base/memory/scoped_ptr.h" +#include "base/utf_string_conversions.h" #include "grit/ash_strings.h" #include "grit/ui_resources.h" +#include "ui/aura/window.h" +#include "ui/base/animation/animation.h" +#include "ui/base/animation/throb_animation.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/models/simple_menu_model.h" #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/layer.h" +#include "ui/gfx/image/image.h" #include "ui/views/animation/bounds_animator.h" #include "ui/views/border.h" +#include "ui/views/controls/button/image_button.h" #include "ui/views/controls/menu/menu_model_adapter.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/focus/focus_search.h" #include "ui/views/view_model.h" #include "ui/views/view_model_utils.h" +#include "ui/views/widget/root_view.h" +#include "ui/views/widget/widget.h" using ui::Animation; using views::View; @@ -40,13 +47,13 @@ namespace ash { namespace internal { // Default amount content is inset on the left edge. -const int kDefaultLeadingInset = 8; +static const int kDefaultLeadingInset = 8; // Minimum distance before drag starts. -const int kMinimumDragDistance = 8; +static const int kMinimumDragDistance = 8; // Size between the buttons. -const int kButtonSpacing = 4; +static const int kButtonSpacing = 4; namespace { @@ -170,21 +177,31 @@ void ReflectItemStatus(const ash::LauncherItem& item, button->ClearState(LauncherButton::STATE_ACTIVE); button->ClearState(LauncherButton::STATE_RUNNING); button->ClearState(LauncherButton::STATE_ATTENTION); + button->ClearState(LauncherButton::STATE_PENDING); break; case STATUS_RUNNING: button->ClearState(LauncherButton::STATE_ACTIVE); button->AddState(LauncherButton::STATE_RUNNING); button->ClearState(LauncherButton::STATE_ATTENTION); + button->ClearState(LauncherButton::STATE_PENDING); break; case STATUS_ACTIVE: button->AddState(LauncherButton::STATE_ACTIVE); button->ClearState(LauncherButton::STATE_RUNNING); button->ClearState(LauncherButton::STATE_ATTENTION); + button->ClearState(LauncherButton::STATE_PENDING); break; case STATUS_ATTENTION: button->ClearState(LauncherButton::STATE_ACTIVE); button->ClearState(LauncherButton::STATE_RUNNING); button->AddState(LauncherButton::STATE_ATTENTION); + button->ClearState(LauncherButton::STATE_PENDING); + break; + case STATUS_IS_PENDING: + button->ClearState(LauncherButton::STATE_ACTIVE); + button->ClearState(LauncherButton::STATE_RUNNING); + button->ClearState(LauncherButton::STATE_ATTENTION); + button->AddState(LauncherButton::STATE_PENDING); break; } } @@ -287,7 +304,6 @@ void LauncherView::Init() { AddChildView(child); } UpdateFirstButtonPadding(); - LauncherStatusChanged(); overflow_button_ = new OverflowButton(this); overflow_button_->set_context_menu_controller(this); @@ -506,7 +522,21 @@ views::View* LauncherView::CreateViewForItem(const LauncherItem& item) { case TYPE_APP_LIST: { // TODO(dave): turn this into a LauncherButton too. + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); AppListButton* button = new AppListButton(this, this); + button->SetImage( + views::CustomButton::BS_NORMAL, + rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST).ToImageSkia()); + button->SetImage( + views::CustomButton::BS_HOT, + rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST_HOT). + ToImageSkia()); + button->SetImage( + views::CustomButton::BS_PUSHED, + rb.GetImageNamed(IDR_AURA_LAUNCHER_ICON_APPLIST_PUSHED). + ToImageSkia()); + button->SetAccessibleName( + l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE)); view = button; break; } @@ -857,15 +887,6 @@ void LauncherView::LauncherItemMoved(int start_index, int target_index) { AnimateToIdealBounds(); } -void LauncherView::LauncherStatusChanged() { - AppListButton* app_list_button = - static_cast<AppListButton*>(GetAppListButtonView()); - if (model_->status() == LauncherModel::STATUS_LOADING) - app_list_button->StartLoadingAnimation(); - else - app_list_button->StopLoadingAnimation(); -} - void LauncherView::PointerPressedOnButton(views::View* view, Pointer pointer, const ui::LocatedEvent& event) { @@ -958,9 +979,7 @@ string16 LauncherView::GetAccessibleName(const views::View* view) { return delegate_->GetTitle(model_->items()[view_index]); case TYPE_APP_LIST: - return model_->status() == LauncherModel::STATUS_LOADING ? - l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_SYNCING_TITLE) : - l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE); + return l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE); case TYPE_BROWSER_SHORTCUT: return l10n_util::GetStringUTF16(IDS_AURA_NEW_TAB); |