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

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

Issue 2787693002: Remove more dead app list code. (Closed)
Patch Set: updated comment Created 3 years, 8 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/test/run_all_unittests.cc ('k') | ui/app_list/views/app_list_main_view_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/app_list_item_view.h" 5 #include "ui/app_list/views/app_list_item_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Radius of the folder dropping preview circle. 45 // Radius of the folder dropping preview circle.
46 const int kFolderPreviewRadius = 40; 46 const int kFolderPreviewRadius = 40;
47 47
48 const int kLeftRightPaddingChars = 1; 48 const int kLeftRightPaddingChars = 1;
49 49
50 // Delay in milliseconds of when the dragging UI should be shown for mouse drag. 50 // Delay in milliseconds of when the dragging UI should be shown for mouse drag.
51 const int kMouseDragUIDelayInMs = 200; 51 const int kMouseDragUIDelayInMs = 200;
52 52
53 gfx::FontList GetFontList() { 53 gfx::FontList GetFontList() {
54 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 54 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
55 const gfx::FontList& font_list = rb.GetFontList(kItemTextFontStyle); 55 return rb.GetFontList(kItemTextFontStyle);
56 // The font is different on each platform. The font size is adjusted on some
57 // platforms to keep a consistent look.
58 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
59 // Reducing the font size by 2 makes it the same as the Windows font size.
60 const int kFontSizeDelta = -2;
61 return font_list.DeriveWithSizeDelta(kFontSizeDelta);
62 #else
63 return font_list;
64 #endif
65 } 56 }
66 57
67 } // namespace 58 } // namespace
68 59
69 // static 60 // static
70 const char AppListItemView::kViewClassName[] = "ui/app_list/AppListItemView"; 61 const char AppListItemView::kViewClassName[] = "ui/app_list/AppListItemView";
71 62
72 AppListItemView::AppListItemView(AppsGridView* apps_grid_view, 63 AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
73 AppListItem* item) 64 AppListItem* item)
74 : CustomButton(apps_grid_view), 65 : CustomButton(apps_grid_view),
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 SetItemPercentDownloaded(item_weak_->percent_downloaded()); 506 SetItemPercentDownloaded(item_weak_->percent_downloaded());
516 } 507 }
517 508
518 void AppListItemView::ItemBeingDestroyed() { 509 void AppListItemView::ItemBeingDestroyed() {
519 DCHECK(item_weak_); 510 DCHECK(item_weak_);
520 item_weak_->RemoveObserver(this); 511 item_weak_->RemoveObserver(this);
521 item_weak_ = NULL; 512 item_weak_ = NULL;
522 } 513 }
523 514
524 } // namespace app_list 515 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/test/run_all_unittests.cc ('k') | ui/app_list/views/app_list_main_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698