| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/app_list/views/all_apps_tile_item_view.h" | 5 #include "ui/app_list/views/all_apps_tile_item_view.h" |
| 6 | 6 |
| 7 #include "ui/app_list/views/contents_view.h" | 7 #include "ui/app_list/views/contents_view.h" |
| 8 #include "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
| 9 #include "ui/strings/grit/ui_strings.h" | 9 #include "ui/strings/grit/ui_strings.h" |
| 10 | 10 |
| 11 namespace app_list { | 11 namespace app_list { |
| 12 | 12 |
| 13 AllAppsTileItemView::AllAppsTileItemView(ContentsView* contents_view, | 13 AllAppsTileItemView::AllAppsTileItemView(ContentsView* contents_view, |
| 14 AppListItemList* item_list) | 14 AppListItemList* item_list) |
| 15 : contents_view_(contents_view), folder_image_(item_list) { | 15 : contents_view_(contents_view), folder_image_(item_list) { |
| 16 SetTitle(l10n_util::GetStringUTF16(IDS_APP_LIST_ALL_APPS)); | 16 SetTitle(l10n_util::GetStringUTF16(IDS_APP_LIST_ALL_APPS)); |
| 17 folder_image_.AddObserver(this); | 17 folder_image_.AddObserver(this); |
| 18 } | 18 } |
| 19 | 19 |
| 20 AllAppsTileItemView::~AllAppsTileItemView() { | 20 AllAppsTileItemView::~AllAppsTileItemView() { |
| 21 folder_image_.RemoveObserver(this); | 21 folder_image_.RemoveObserver(this); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void AllAppsTileItemView::UpdateIcon() { | 24 void AllAppsTileItemView::UpdateIcon() { |
| 25 folder_image_.UpdateIcon(); | 25 folder_image_.UpdateIcon(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void AllAppsTileItemView::ButtonPressed(views::Button* sender, | 28 void AllAppsTileItemView::ButtonPressed(views::Button* sender, |
| 29 const ui::Event& event) { | 29 const ui::Event& event) { |
| 30 contents_view_->SetActivePage( | 30 contents_view_->SetActivePage(AppListModel::STATE_APPS); |
| 31 contents_view_->GetPageIndexForState(AppListModel::STATE_APPS)); | |
| 32 } | 31 } |
| 33 | 32 |
| 34 void AllAppsTileItemView::OnFolderImageUpdated() { | 33 void AllAppsTileItemView::OnFolderImageUpdated() { |
| 35 SetIcon(folder_image_.icon()); | 34 SetIcon(folder_image_.icon()); |
| 36 } | 35 } |
| 37 | 36 |
| 38 } // namespace app_list | 37 } // namespace app_list |
| OLD | NEW |