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

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: 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/update/tray_update.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9fbeb79bb90816653382bc3eb9886a8ab1b10068 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,10 @@ class RotationLockDefaultView : public TrayItemMore, public ShellObserver {
void OnMaximizeModeStarted() override;
void OnMaximizeModeEnded() override;
+ protected:
+ // TrayItemMore:
+ void UpdateStyle() override;
+
private:
void UpdateImage();
@@ -48,7 +53,6 @@ class RotationLockDefaultView : public TrayItemMore, public ShellObserver {
RotationLockDefaultView::RotationLockDefaultView(SystemTrayItem* owner)
: TrayItemMore(owner, false) {
- UpdateImage();
SetVisible(WmShell::Get()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled());
@@ -77,14 +81,20 @@ void RotationLockDefaultView::OnMaximizeModeEnded() {
SetVisible(false);
}
+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
« no previous file with comments | « 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