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

Side by Side Diff: ui/app_list/views/all_apps_tile_item_view.cc

Issue 682843004: Experimental app list: "All apps" button has a folder-like icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares-allapps-button
Patch Set: Use range-based for loops where possible. Created 6 years, 1 month 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
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 : contents_view_(contents_view) { 14 AppListItemList* item_list)
15 : contents_view_(contents_view), folder_image_(item_list) {
15 SetTitle(l10n_util::GetStringUTF16(IDS_APP_LIST_ALL_APPS)); 16 SetTitle(l10n_util::GetStringUTF16(IDS_APP_LIST_ALL_APPS));
16 // TODO(mgiuca): Set the button's icon. 17 folder_image_.AddObserver(this);
17 } 18 }
18 19
19 AllAppsTileItemView::~AllAppsTileItemView() { 20 AllAppsTileItemView::~AllAppsTileItemView() {
21 folder_image_.RemoveObserver(this);
22 }
23
24 void AllAppsTileItemView::UpdateIcon() {
25 folder_image_.UpdateIcon();
20 } 26 }
21 27
22 void AllAppsTileItemView::ButtonPressed(views::Button* sender, 28 void AllAppsTileItemView::ButtonPressed(views::Button* sender,
23 const ui::Event& event) { 29 const ui::Event& event) {
24 contents_view_->SetActivePage( 30 contents_view_->SetActivePage(
25 contents_view_->GetPageIndexForState(AppListModel::STATE_APPS)); 31 contents_view_->GetPageIndexForState(AppListModel::STATE_APPS));
26 } 32 }
27 33
34 void AllAppsTileItemView::OnFolderImageUpdated() {
35 SetIcon(folder_image_.icon());
36 }
37
28 } // namespace app_list 38 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698