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

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

Issue 2758453002: Remove pre-MD code from TrayItemView. (Closed)
Patch Set: bonus round 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 | « ash/common/system/tray/tray_item_view.h ('k') | ash/resources/ash_resources.grd » ('j') | 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..a3d95ad9f4c77b8ed97fc248e60a434e0dc92df9 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"
@@ -17,16 +16,16 @@
#include "ui/views/layout/fill_layout.h"
#include "ui/views/widget/widget.h"
+namespace ash {
+
namespace {
-const int kTrayIconHeight = 29;
-const int kTrayIconWidth = 29;
+
const int kTrayItemAnimationDurationMS = 200;
// Animations can be disabled for testing.
bool animations_enabled = true;
-}
-namespace ash {
+} // namespace
TrayItemView::TrayItemView(SystemTrayItem* owner)
: owner_(owner), label_(NULL), image_view_(NULL) {
@@ -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);
- 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 | « ash/common/system/tray/tray_item_view.h ('k') | ash/resources/ash_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698