Chromium Code Reviews| 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/shelf/app_list_shelf_item_delegate.h" | 5 #include "ash/shelf/app_list_shelf_item_delegate.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_model.h" | 7 #include "ash/shelf/shelf_model.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/strings/grit/ash_strings.h" | 9 #include "ash/strings/grit/ash_strings.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "ui/app_list/app_list_switches.h" | 11 #include "ui/app_list/app_list_switches.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
| 13 | 13 |
| 14 namespace ash { | 14 namespace ash { |
| 15 | 15 |
| 16 namespace { | 16 // static |
| 17 | 17 const char AppListShelfItemDelegate::kAppListId[] = |
| 18 // An app id for the app list, used to identify the shelf item. | 18 "eiiblffaiacobmjejhcoookmokblahea"; |
|
msw
2017/05/05 21:45:04
Instead of using an arc-specific formatting for th
khmel
2017/05/05 22:45:12
That makes sense.
| |
| 19 static constexpr char kAppListId[] = "AppListId"; | |
| 20 | |
| 21 } // namespace | |
| 22 | 19 |
| 23 // static | 20 // static |
| 24 void AppListShelfItemDelegate::CreateAppListItemAndDelegate(ShelfModel* model) { | 21 void AppListShelfItemDelegate::CreateAppListItemAndDelegate(ShelfModel* model) { |
| 25 // Add the app list item to the shelf model. | 22 // Add the app list item to the shelf model. |
| 26 ShelfItem item; | 23 ShelfItem item; |
| 27 item.type = TYPE_APP_LIST; | 24 item.type = TYPE_APP_LIST; |
| 28 item.id = ShelfID(kAppListId); | 25 item.id = ShelfID(kAppListId); |
| 29 item.title = l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); | 26 item.title = l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); |
| 30 int index = model->Add(item); | 27 int index = model->Add(item); |
| 31 DCHECK_GE(index, 0); | 28 DCHECK_GE(index, 0); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 51 | 48 |
| 52 void AppListShelfItemDelegate::ExecuteCommand(uint32_t command_id, | 49 void AppListShelfItemDelegate::ExecuteCommand(uint32_t command_id, |
| 53 int32_t event_flags) { | 50 int32_t event_flags) { |
| 54 // This delegate does not support showing an application menu. | 51 // This delegate does not support showing an application menu. |
| 55 NOTIMPLEMENTED(); | 52 NOTIMPLEMENTED(); |
| 56 } | 53 } |
| 57 | 54 |
| 58 void AppListShelfItemDelegate::Close() {} | 55 void AppListShelfItemDelegate::Close() {} |
| 59 | 56 |
| 60 } // namespace ash | 57 } // namespace ash |
| OLD | NEW |