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

Unified Diff: ash/system/chromeos/rotation/tray_rotation_lock.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/system/chromeos/rotation/tray_rotation_lock.cc
diff --git a/ash/system/chromeos/rotation/tray_rotation_lock.cc b/ash/system/chromeos/rotation/tray_rotation_lock.cc
index 06c15835875ef4484e53917728adf9f044220d8c..eb5b76aeb731685e15cca544fec8a3763eea0ef6 100644
--- a/ash/system/chromeos/rotation/tray_rotation_lock.cc
+++ b/ash/system/chromeos/rotation/tray_rotation_lock.cc
@@ -8,6 +8,7 @@
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_item_more.h"
+#include "ash/common/system/tray/tray_popup_item_style.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/display/screen_orientation_controller_chromeos.h"
@@ -40,6 +41,11 @@ class RotationLockDefaultView : public TrayItemMore, public ShellObserver {
void OnMaximizeModeStarted() override;
void OnMaximizeModeEnded() override;
+ protected:
+ // TrayItemMore:
+ std::unique_ptr<TrayPopupItemStyle> CreateStyle() const override;
+ void UpdateStyle() override;
+
private:
void UpdateImage();
@@ -48,7 +54,6 @@ class RotationLockDefaultView : public TrayItemMore, public ShellObserver {
RotationLockDefaultView::RotationLockDefaultView(SystemTrayItem* owner)
: TrayItemMore(owner, false) {
- UpdateImage();
SetVisible(WmShell::Get()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled());
@@ -77,14 +82,26 @@ void RotationLockDefaultView::OnMaximizeModeEnded() {
SetVisible(false);
}
+std::unique_ptr<TrayPopupItemStyle> RotationLockDefaultView::CreateStyle()
+ const {
+ return base::MakeUnique<TrayPopupItemStyle>(
+ GetNativeTheme(), TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+}
+
+void RotationLockDefaultView::UpdateStyle() {
+ TrayItemMore::UpdateStyle();
+ UpdateImage();
+}
+
void RotationLockDefaultView::UpdateImage() {
const bool rotation_locked =
Shell::GetInstance()->screen_orientation_controller()->rotation_locked();
if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
+ std::unique_ptr<TrayPopupItemStyle> style = CreateStyle();
SetImage(gfx::CreateVectorIcon(rotation_locked
? kSystemMenuRotationLockLockedIcon
: kSystemMenuRotationLockAutoIcon,
- kMenuIconSize, kMenuIconColor));
+ kMenuIconSize, style->GetForegroundColor()));
} else {
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
const int resource_id = rotation_locked
« ash/common/system/tray/tray_popup_item_style.h ('K') | « ash/common/system/update/tray_update.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698