| Index: ash/launcher/launcher_view.cc
|
| diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
|
| index 20fa17681ad0053bc920aab44f33b1fb7961a835..7e410a93463cc581c6a15305878905c6d0374ca9 100644
|
| --- a/ash/launcher/launcher_view.cc
|
| +++ b/ash/launcher/launcher_view.cc
|
| @@ -7,6 +7,7 @@
|
| #include <algorithm>
|
|
|
| #include "ash/launcher/app_list_button.h"
|
| +#include "ash/launcher/app_placeholder_view.h"
|
| #include "ash/launcher/launcher_button.h"
|
| #include "ash/launcher/launcher_delegate.h"
|
| #include "ash/launcher/launcher_icon_observer.h"
|
| @@ -18,6 +19,7 @@
|
| #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"
|
| @@ -31,7 +33,6 @@
|
| #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"
|
| @@ -47,13 +48,13 @@ namespace ash {
|
| namespace internal {
|
|
|
| // Default amount content is inset on the left edge.
|
| -static const int kDefaultLeadingInset = 8;
|
| +const int kDefaultLeadingInset = 8;
|
|
|
| // Minimum distance before drag starts.
|
| -static const int kMinimumDragDistance = 8;
|
| +const int kMinimumDragDistance = 8;
|
|
|
| // Size between the buttons.
|
| -static const int kButtonSpacing = 4;
|
| +const int kButtonSpacing = 4;
|
|
|
| namespace {
|
|
|
| @@ -177,31 +178,21 @@ 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;
|
| }
|
| }
|
| @@ -520,6 +511,10 @@ views::View* LauncherView::CreateViewForItem(const LauncherItem& item) {
|
| break;
|
| }
|
|
|
| + case TYPE_APP_PLACEHOLDER:
|
| + view = new AppPlaceholderView;
|
| + break;
|
| +
|
| case TYPE_APP_LIST: {
|
| // TODO(dave): turn this into a LauncherButton too.
|
| ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
| @@ -659,6 +654,7 @@ bool LauncherView::SameDragType(LauncherItemType typea,
|
| typeb == TYPE_APP_PANEL ||
|
| typeb == TYPE_PLATFORM_APP);
|
| case TYPE_APP_SHORTCUT:
|
| + case TYPE_APP_PLACEHOLDER:
|
| case TYPE_APP_LIST:
|
| case TYPE_BROWSER_SHORTCUT:
|
| return typeb == typea;
|
| @@ -887,6 +883,9 @@ void LauncherView::LauncherItemMoved(int start_index, int target_index) {
|
| AnimateToIdealBounds();
|
| }
|
|
|
| +void LauncherView::LauncherUIStateChanged() {
|
| +}
|
| +
|
| void LauncherView::PointerPressedOnButton(views::View* view,
|
| Pointer pointer,
|
| const ui::LocatedEvent& event) {
|
| @@ -974,6 +973,7 @@ string16 LauncherView::GetAccessibleName(const views::View* view) {
|
| switch (model_->items()[view_index].type) {
|
| case TYPE_TABBED:
|
| case TYPE_APP_PANEL:
|
| + case TYPE_APP_PLACEHOLDER:
|
| case TYPE_APP_SHORTCUT:
|
| case TYPE_PLATFORM_APP:
|
| return delegate_->GetTitle(model_->items()[view_index]);
|
| @@ -1035,6 +1035,10 @@ void LauncherView::ButtonPressed(views::Button* sender,
|
| else
|
| delegate_->CreateNewTab();
|
| break;
|
| +
|
| + case TYPE_APP_PLACEHOLDER:
|
| + // Do nothing.
|
| + break;
|
| }
|
| }
|
|
|
|
|