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

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: Applied TrayPopupItemStyle to Network, SMS, Tracing, OS Update. 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
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..eb6f6c62b611461d82f82c81d76cdc70dbf35a48 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::TITLE);
tdanderson 2016/09/22 20:44:16 Maybe return DEFAULT_VIEW_LABEL by default?
bruthig 2016/09/22 21:47:22 Good call, originally I was thinking TrayItemMore
+}
+
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) {

Powered by Google App Engine
This is Rietveld 408576698