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

Unified Diff: ash/common/system/tray/tray_item_view.cc

Issue 2758453002: Remove pre-MD code from TrayItemView. (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_item_view.cc
diff --git a/ash/common/system/tray/tray_item_view.cc b/ash/common/system/tray/tray_item_view.cc
index 65ad50c7385676dbb2f33e8c9d1805e06942f210..83da55f15d77582e27fdcb0f0db803b49d107217 100644
--- a/ash/common/system/tray/tray_item_view.cc
+++ b/ash/common/system/tray/tray_item_view.cc
@@ -4,7 +4,6 @@
#include "ash/common/system/tray/tray_item_view.h"
-#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_item.h"
@@ -77,32 +76,18 @@ void TrayItemView::SetVisible(bool set_visible) {
}
}
-// static
-bool TrayItemView::UseMd() {
- return MaterialDesignController::UseMaterialDesignSystemIcons();
-}
-
int TrayItemView::GetAnimationDurationMS() {
return kTrayItemAnimationDurationMS;
}
gfx::Size TrayItemView::GetPreferredSize() const {
DCHECK_EQ(1, child_count());
- gfx::Size size;
- if (UseMd()) {
- gfx::Size inner_size = views::View::GetPreferredSize();
- if (image_view_)
- inner_size = gfx::Size(kTrayIconSize, kTrayIconSize);
- gfx::Rect rect(inner_size);
- rect.Inset(gfx::Insets(-kTrayImageItemPadding));
- size = rect.size();
- } else {
- size = views::View::GetPreferredSize();
- if (IsHorizontalAlignment(owner()->system_tray()->shelf_alignment()))
- size.set_height(kTrayIconHeight);
tdanderson 2017/03/16 18:01:29 note: kTrayIconHeight and kTrayIconWidth are now u
- else
- size.set_width(kTrayIconWidth);
- }
+ gfx::Size inner_size = views::View::GetPreferredSize();
+ if (image_view_)
+ inner_size = gfx::Size(kTrayIconSize, kTrayIconSize);
+ gfx::Rect rect(inner_size);
+ rect.Inset(gfx::Insets(-kTrayImageItemPadding));
+ gfx::Size size = rect.size();
if (!animation_.get() || !animation_->is_animating())
return size;
if (IsHorizontalAlignment(owner()->system_tray()->shelf_alignment())) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698