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

Unified Diff: ash/system/overview/overview_button_tray.cc

Issue 2051663005: Vectorize the remaining material design shelf icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: only load MD icons when needed Created 4 years, 6 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
Index: ash/system/overview/overview_button_tray.cc
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc
index cd2443dcbc064a952c4d52febdb3dd0d1fef5772..18498a57d3ee4cd05db9556af94307bfaf5f4180 100644
--- a/ash/system/overview/overview_button_tray.cc
+++ b/ash/system/overview/overview_button_tray.cc
@@ -4,7 +4,9 @@
#include "ash/system/overview/overview_button_tray.h"
+#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/shelf_types.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/tray/system_tray_delegate.h"
@@ -18,6 +20,8 @@
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/vector_icons_public.h"
#include "ui/views/border.h"
#include "ui/views/controls/image_view.h"
@@ -38,10 +42,17 @@ OverviewButtonTray::OverviewButtonTray(StatusAreaWidget* status_area_widget)
: TrayBackgroundView(status_area_widget), icon_(NULL) {
SetContentsBackground();
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
icon_ = new views::ImageView();
- icon_->SetImage(
- bundle.GetImageNamed(IDR_AURA_UBER_TRAY_OVERVIEW_MODE).ToImageSkia());
+ if (MaterialDesignController::IsShelfMaterial()) {
+ gfx::ImageSkia image_md =
+ CreateVectorIcon(gfx::VectorIconId::SHELF_OVERVIEW, kShelfIconColor);
+ icon_->SetImage(&image_md);
James Cook 2016/06/09 23:00:09 Can you just call icon_->SetImage(image_id) to mak
tdanderson 2016/06/09 23:51:41 Done.
+ } else {
+ gfx::ImageSkia* image_non_md =
+ ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ IDR_AURA_UBER_TRAY_OVERVIEW_MODE);
+ icon_->SetImage(image_non_md);
+ }
SetIconBorderForShelfAlignment();
tray_container()->AddChildView(icon_);

Powered by Google App Engine
This is Rietveld 408576698