1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/shelf/app_list_shelf_item_delegate.h"
7 #include "ash/launcher/launcher_model.h"
9 #include "grit/ash_strings.h"
10 #include "ui/base/l10n/l10n_util.h"
15 AppListShelfItemDelegate::AppListShelfItemDelegate() {
16 LauncherItem app_list;
17 app_list.type = TYPE_APP_LIST;
18 Shell::GetInstance()->launcher_model()->Add(app_list);
21 AppListShelfItemDelegate::~AppListShelfItemDelegate() {
22 // LauncherItemDelegateManager owns and destroys this class.
25 void AppListShelfItemDelegate::ItemSelected(const ui::Event& event) {
26 // Pass NULL here to show the app list in the currently active RootWindow.
27 Shell::GetInstance()->ToggleAppList(NULL);
30 base::string16 AppListShelfItemDelegate::GetTitle() {
31 LauncherModel* model = Shell::GetInstance()->launcher_model();
33 return model->status() == LauncherModel::STATUS_LOADING ?
34 l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_SYNCING_TITLE) :
35 l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE);
38 ui::MenuModel* AppListShelfItemDelegate::CreateContextMenu(
39 aura::Window* root_window) {
43 LauncherMenuModel* AppListShelfItemDelegate::CreateApplicationMenu(
45 // AppList does not show an application menu.
49 bool AppListShelfItemDelegate::IsDraggable() {
53 bool AppListShelfItemDelegate::ShouldShowTooltip() {
57 } // namespace internal