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

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: Add some comments 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: Create AppList LauncherItem here.
Mr4D (OOO till 08-26) 2013/08/13 18:18:24 ?? Does this actually work already?
simonhong_ 2013/08/13 19:54:56 Yes, AppList button works well with this ItemDeleg
Mr4D (OOO till 08-26) 2013/08/14 15:52:19 Why then this comment? (that makes it sound like t
simonhong_ 2013/08/14 23:47:51 Done.
18 }
19
20 AppListLauncherItemDelegate::~AppListLauncherItemDelegate() {
21 }
22
23 void AppListLauncherItemDelegate::ItemSelected(const LauncherItem& item,
24 const ui::Event& event) {
25 // Passing NULL to ToggleAppList() can show app list on the right shelf
26 // because when LauncherItem is selected target root window is set to active
27 // root window.
Mr4D (OOO till 08-26) 2013/08/14 15:52:19 I don't understand what this comment means. Maybe:
simonhong_ 2013/08/14 23:47:51 Done.
28 Shell::GetInstance()->ToggleAppList(NULL);
29 }
30
31 base::string16 AppListLauncherItemDelegate::GetTitle(const LauncherItem& item) {
32 LauncherModel* model = Shell::GetInstance()->launcher_model();
33 DCHECK(model);
34 return model->status() == LauncherModel::STATUS_LOADING ?
35 l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_SYNCING_TITLE) :
36 l10n_util::GetStringUTF16(IDS_AURA_APP_LIST_TITLE);
37 }
38
39 ui::MenuModel* AppListLauncherItemDelegate::CreateContextMenu(
40 const LauncherItem& item,
41 aura::RootWindow* root_window) {
42 return NULL;
43 }
44
45 LauncherMenuModel* AppListLauncherItemDelegate::CreateApplicationMenu(
46 const LauncherItem& item,
47 int event_flags) {
48 // AppList don't show application menu.
Mr4D (OOO till 08-26) 2013/08/14 15:52:19 An AppList does not show an application menu.
simonhong_ 2013/08/14 23:47:51 Done.
49 return NULL;
50 }
51
52 bool AppListLauncherItemDelegate::IsDraggable(const LauncherItem& item) {
53 return false;
54 }
55
56 bool AppListLauncherItemDelegate::ShouldShowTooltip(const LauncherItem& item) {
57 return true;
58 }
59
60 } // namespace internal
61 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698