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

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

Issue 2253253002: [Merge to M53][Chrome OS] Change layout of the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 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
« no previous file with comments | « ui/app_list/views/all_apps_tile_item_view.h ('k') | ui/app_list/views/start_page_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "ui/app_list/app_list_constants.h" 8 #include "ui/app_list/app_list_constants.h"
9 #include "ui/app_list/views/contents_view.h" 9 #include "ui/app_list/views/contents_view.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
11 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/resources/grit/ui_resources.h" 12 #include "ui/resources/grit/ui_resources.h"
13 #include "ui/strings/grit/ui_strings.h" 13 #include "ui/strings/grit/ui_strings.h"
14 14
15 namespace app_list { 15 namespace app_list {
16 16
17 AllAppsTileItemView::AllAppsTileItemView(ContentsView* contents_view) 17 AllAppsTileItemView::AllAppsTileItemView(ContentsView* contents_view)
18 : contents_view_(contents_view) { 18 : contents_view_(contents_view) {
19 SetTitle(l10n_util::GetStringUTF16(IDS_APP_LIST_ALL_APPS)); 19 SetTitle(l10n_util::GetStringUTF16(IDS_APP_LIST_ALL_APPS));
20 SetHoverStyle(TileItemView::HOVER_STYLE_ANIMATE_SHADOW); 20 SetHoverStyle(TileItemView::HOVER_STYLE_ANIMATE_SHADOW);
21 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 21 UpdateIcon();
22 SetIcon(*rb.GetImageNamed(IDR_ALL_APPS_DROP_DOWN).ToImageSkia());
23 } 22 }
24 23
25 AllAppsTileItemView::~AllAppsTileItemView() { 24 AllAppsTileItemView::~AllAppsTileItemView() {
26 } 25 }
27 26
27 void AllAppsTileItemView::UpdateIcon() {
28 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
29 SetIcon(*rb.GetImageNamed(IDR_ALL_APPS_DROP_DOWN).ToImageSkia());
30 }
31
28 void AllAppsTileItemView::ButtonPressed(views::Button* sender, 32 void AllAppsTileItemView::ButtonPressed(views::Button* sender,
29 const ui::Event& event) { 33 const ui::Event& event) {
30 UMA_HISTOGRAM_ENUMERATION(kPageOpenedHistogram, AppListModel::STATE_APPS, 34 UMA_HISTOGRAM_ENUMERATION(kPageOpenedHistogram, AppListModel::STATE_APPS,
31 AppListModel::STATE_LAST); 35 AppListModel::STATE_LAST);
32 36
33 contents_view_->SetActiveState(AppListModel::STATE_APPS); 37 contents_view_->SetActiveState(AppListModel::STATE_APPS);
34 } 38 }
35 39
36 } // namespace app_list 40 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/all_apps_tile_item_view.h ('k') | ui/app_list/views/start_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698