| 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 "grit/ash_strings.h" | 9 #include "grit/ash_strings.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 AppListShelfItemDelegate::AppListShelfItemDelegate() { | 15 AppListShelfItemDelegate::AppListShelfItemDelegate() { |
| 16 LauncherItem app_list; | 16 LauncherItem app_list; |
| 17 app_list.type = TYPE_APP_LIST; | 17 app_list.type = TYPE_APP_LIST; |
| 18 Shell::GetInstance()->shelf_model()->Add(app_list); | 18 Shell::GetInstance()->shelf_model()->Add(app_list); |
| 19 } | 19 } |
| 20 | 20 |
| 21 AppListShelfItemDelegate::~AppListShelfItemDelegate() { | 21 AppListShelfItemDelegate::~AppListShelfItemDelegate() { |
| 22 // LauncherItemDelegateManager owns and destroys this class. | 22 // ShelfItemDelegateManager owns and destroys this class. |
| 23 } | 23 } |
| 24 | 24 |
| 25 bool AppListShelfItemDelegate::ItemSelected(const ui::Event& event) { | 25 bool AppListShelfItemDelegate::ItemSelected(const ui::Event& event) { |
| 26 // Pass NULL here to show the app list in the currently active RootWindow. | 26 // Pass NULL here to show the app list in the currently active RootWindow. |
| 27 Shell::GetInstance()->ToggleAppList(NULL); | 27 Shell::GetInstance()->ToggleAppList(NULL); |
| 28 return false; | 28 return false; |
| 29 } | 29 } |
| 30 | 30 |
| 31 base::string16 AppListShelfItemDelegate::GetTitle() { | 31 base::string16 AppListShelfItemDelegate::GetTitle() { |
| 32 ShelfModel* model = Shell::GetInstance()->shelf_model(); | 32 ShelfModel* model = Shell::GetInstance()->shelf_model(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 50 bool AppListShelfItemDelegate::IsDraggable() { | 50 bool AppListShelfItemDelegate::IsDraggable() { |
| 51 return false; | 51 return false; |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool AppListShelfItemDelegate::ShouldShowTooltip() { | 54 bool AppListShelfItemDelegate::ShouldShowTooltip() { |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace internal | 58 } // namespace internal |
| 59 } // namespace ash | 59 } // namespace ash |
| OLD | NEW |