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

Unified Diff: ash/common/system/chromeos/tray_tracing.cc

Issue 2700653002: [Ash MD] Remove pre-MD code from TrayImageItem and subclasses (Closed)
Patch Set: comments Created 3 years, 10 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/chromeos/tray_caps_lock.cc ('k') | ash/common/system/tray/tray_image_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/tray_tracing.cc
diff --git a/ash/common/system/chromeos/tray_tracing.cc b/ash/common/system/chromeos/tray_tracing.cc
index 3663e0f68187dd59ecc873e810ae353d0c82d5ad..2dfb4445a38d7347757c9d009e4da85dd7e80eaf 100644
--- a/ash/common/system/chromeos/tray_tracing.cc
+++ b/ash/common/system/chromeos/tray_tracing.cc
@@ -4,7 +4,6 @@
#include "ash/common/system/chromeos/tray_tracing.h"
-#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/metrics/user_metrics_action.h"
#include "ash/common/system/tray/actionable_view.h"
#include "ash/common/system/tray/fixed_sized_image_view.h"
@@ -17,9 +16,8 @@
#include "ash/common/system/tray/tri_view.h"
#include "ash/common/wm_shell.h"
#include "ash/resources/vector_icons/vector_icons.h"
-#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
-#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/image_view.h"
@@ -33,32 +31,24 @@ class DefaultTracingView : public ActionableView {
public:
explicit DefaultTracingView(SystemTrayItem* owner)
: ActionableView(owner, TrayPopupInkDropStyle::FILL_BOUNDS) {
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
-
SetLayoutManager(new views::FillLayout);
TriView* tri_view = TrayPopupUtils::CreateDefaultRowView();
AddChildView(tri_view);
+
auto image = TrayPopupUtils::CreateMainImageView();
tri_view->AddView(TriView::Container::START, image);
auto label = TrayPopupUtils::CreateDefaultLabel();
label->SetMultiLine(true);
- label->SetText(bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_TRACING));
+ label->SetText(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_TRACING));
tri_view->AddView(TriView::Container::CENTER, label);
- if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
- TrayPopupItemStyle style(
- TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
- style.SetupLabel(label);
- image->SetImage(
- gfx::CreateVectorIcon(kSystemMenuTracingIcon, style.GetIconColor()));
-
- SetInkDropMode(InkDropHostView::InkDropMode::ON);
- } else {
- // The icon doesn't change in non-md.
- image->SetImage(
- bundle.GetImageNamed(IDR_AURA_UBER_TRAY_TRACING).ToImageSkia());
- }
+ TrayPopupItemStyle style(TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+ style.SetupLabel(label);
+ image->SetImage(
+ gfx::CreateVectorIcon(kSystemMenuTracingIcon, style.GetIconColor()));
+
+ SetInkDropMode(InkDropHostView::InkDropMode::ON);
}
~DefaultTracingView() override {}
@@ -81,7 +71,7 @@ class DefaultTracingView : public ActionableView {
// ash::TrayTracing
TrayTracing::TrayTracing(SystemTray* system_tray)
- : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_TRACING, UMA_TRACING),
+ : TrayImageItem(system_tray, kSystemTrayTracingIcon, UMA_TRACING),
default_(nullptr) {
DCHECK(system_tray);
WmShell::Get()->system_tray_notifier()->AddTracingObserver(this);
« no previous file with comments | « ash/common/system/chromeos/tray_caps_lock.cc ('k') | ash/common/system/tray/tray_image_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698