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

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

Issue 2365523002: Materialized the font/icon color for some default rows in the system menu. (Closed)
Patch Set: Addressed tdanderson@ comments from previous patch set. Created 4 years, 3 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_more.h ('k') | ash/common/system/tray/tray_popup_item_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_item_more.cc
diff --git a/ash/common/system/tray/tray_item_more.cc b/ash/common/system/tray/tray_item_more.cc
index 4f3a4259d55109ad089fb3169628d811756ae8b0..81b9e2453cce11a8b1c78ba96bd27d4369a4c866 100644
--- a/ash/common/system/tray/tray_item_more.cc
+++ b/ash/common/system/tray/tray_item_more.cc
@@ -10,6 +10,7 @@
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/resources/vector_icons/vector_icons.h"
+#include "base/memory/ptr_util.h"
#include "grit/ash_resources.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/base/resource/resource_bundle.h"
@@ -41,10 +42,8 @@ TrayItemMore::TrayItemMore(SystemTrayItem* owner, bool show_more)
if (show_more) {
more_ = new views::ImageView;
more_->EnableCanvasFlippingForRTLUI(true);
- if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
- more_->SetImage(
- gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, kMenuIconColor));
- } else {
+ if (!MaterialDesignController::IsSystemTrayMenuMaterial()) {
+ // The icon doesn't change in non-md.
more_->SetImage(ui::ResourceBundle::GetSharedInstance()
.GetImageNamed(IDR_AURA_UBER_TRAY_MORE)
.ToImageSkia());
@@ -70,13 +69,21 @@ void TrayItemMore::SetAccessibleName(const base::string16& name) {
accessible_name_ = name;
}
+std::unique_ptr<TrayPopupItemStyle> TrayItemMore::CreateStyle() const {
+ return base::MakeUnique<TrayPopupItemStyle>(
+ GetNativeTheme(), TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+}
+
void TrayItemMore::UpdateStyle() {
if (!MaterialDesignController::IsSystemTrayMenuMaterial())
return;
+ std::unique_ptr<TrayPopupItemStyle> style = CreateStyle();
+ style->SetupLabel(label_);
- TrayPopupItemStyle style(GetNativeTheme(),
- TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
- style.SetupLabel(label_);
+ if (more_) {
+ more_->SetImage(gfx::CreateVectorIcon(kSystemMenuArrowRightIcon,
+ style->GetForegroundColor()));
+ }
}
bool TrayItemMore::PerformAction(const ui::Event& event) {
« no previous file with comments | « ash/common/system/tray/tray_item_more.h ('k') | ash/common/system/tray/tray_popup_item_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698