| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |