OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/common/shelf/app_list_shelf_item_delegate.h" | 5 #include "ash/common/shelf/app_list_shelf_item_delegate.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_model.h" | 7 #include "ash/common/shelf/shelf_model.h" |
8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "grit/ash_strings.h" | 10 #include "grit/ash_strings.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 ShelfItemDelegate::PerformedAction AppListShelfItemDelegate::ItemSelected( | 36 ShelfItemDelegate::PerformedAction AppListShelfItemDelegate::ItemSelected( |
37 const ui::Event& event) { | 37 const ui::Event& event) { |
38 WmShell::Get()->ToggleAppList(); | 38 WmShell::Get()->ToggleAppList(); |
39 return ShelfItemDelegate::kAppListMenuShown; | 39 return ShelfItemDelegate::kAppListMenuShown; |
40 } | 40 } |
41 | 41 |
42 base::string16 AppListShelfItemDelegate::GetTitle() { | 42 base::string16 AppListShelfItemDelegate::GetTitle() { |
43 ShelfModel* model = WmShell::Get()->shelf_model(); | 43 ShelfModel* model = WmShell::Get()->shelf_model(); |
44 DCHECK(model); | 44 DCHECK(model); |
45 int title_id; | 45 int title_id; |
46 if (app_list::switches::IsExperimentalAppListEnabled()) { | 46 title_id = model->status() == ShelfModel::STATUS_LOADING |
47 title_id = model->status() == ShelfModel::STATUS_LOADING | 47 ? IDS_ASH_SHELF_APP_LIST_LAUNCHER_SYNCING_TITLE |
48 ? IDS_ASH_SHELF_APP_LIST_LAUNCHER_SYNCING_TITLE | 48 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE; |
49 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE; | |
50 } else { | |
51 title_id = model->status() == ShelfModel::STATUS_LOADING | |
52 ? IDS_ASH_SHELF_APP_LIST_SYNCING_TITLE | |
53 : IDS_ASH_SHELF_APP_LIST_TITLE; | |
54 } | |
55 return l10n_util::GetStringUTF16(title_id); | 49 return l10n_util::GetStringUTF16(title_id); |
56 } | 50 } |
57 | 51 |
58 ShelfMenuModel* AppListShelfItemDelegate::CreateApplicationMenu( | 52 ShelfMenuModel* AppListShelfItemDelegate::CreateApplicationMenu( |
59 int event_flags) { | 53 int event_flags) { |
60 // AppList does not show an application menu. | 54 // AppList does not show an application menu. |
61 return NULL; | 55 return NULL; |
62 } | 56 } |
63 | 57 |
64 bool AppListShelfItemDelegate::IsDraggable() { | 58 bool AppListShelfItemDelegate::IsDraggable() { |
65 return false; | 59 return false; |
66 } | 60 } |
67 | 61 |
68 bool AppListShelfItemDelegate::CanPin() const { | 62 bool AppListShelfItemDelegate::CanPin() const { |
69 return true; | 63 return true; |
70 } | 64 } |
71 | 65 |
72 bool AppListShelfItemDelegate::ShouldShowTooltip() { | 66 bool AppListShelfItemDelegate::ShouldShowTooltip() { |
73 return true; | 67 return true; |
74 } | 68 } |
75 | 69 |
76 void AppListShelfItemDelegate::Close() {} | 70 void AppListShelfItemDelegate::Close() {} |
77 | 71 |
78 } // namespace ash | 72 } // namespace ash |
OLD | NEW |