Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: ash/launcher/app_list_launcher_item_delegate.cc

Issue 22429004: Refactor LauncherDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "ash/launcher/app_list_launcher_item_delegate.h"
6
7 #include "ash/launcher/launcher_model.h"
8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h"
10 #include "grit/ash_strings.h"
11 #include "ui/base/l10n/l10n_util.h"
12
13 namespace ash {
14 namespace internal {
15
16 AppListLauncherItemDelegate::AppListLauncherItemDelegate() {
17 // TODO(simon.hong81): This works for the moment, but the AppList LauncherItem
18 // creation should move here.
19 }
20
21 AppListLauncherItemDelegate::~AppListLauncherItemDelegate() {
22 }
23
24 void AppListLauncherItemDelegate::ItemSelected(const LauncherItem& item,
25 const ui::Event& event) {
26 // Pass NULL here to show the app list in the currently active RootWindow.
27 Shell::GetInstance()->ToggleAppList(NULL);
28 }
29
30 base::string16 AppListLauncherItemDelegate::GetTitle(const LauncherItem& item) {
31 LauncherModel* model = Shell::GetInstance()->launcher_model();
32 DCHECK(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);
36 }
37
38 ui::MenuModel* AppListLauncherItemDelegate::CreateContextMenu(
39 const LauncherItem& item,
40 aura::RootWindow* root_window) {
41 return NULL;
42 }
43
44 LauncherMenuModel* AppListLauncherItemDelegate::CreateApplicationMenu(
45 const LauncherItem& item,
46 int event_flags) {
47 // AppList does not show an application menu.
48 return NULL;
49 }
50
51 bool AppListLauncherItemDelegate::IsDraggable(const LauncherItem& item) {
52 return false;
53 }
54
55 bool AppListLauncherItemDelegate::ShouldShowTooltip(const LauncherItem& item) {
56 return true;
57 }
58
59 } // namespace internal
60 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698