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

Side by Side Diff: ash/system/chromeos/rotation/tray_rotation_lock.cc

Issue 2496963004: [ash-md] Fixed the effective text/icon colors in the system menu. (Closed)
Patch Set: Fixed compile error (typo). Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ash/common/system/tray_accessibility.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/chromeos/rotation/tray_rotation_lock.h" 5 #include "ash/system/chromeos/rotation/tray_rotation_lock.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/system/tray/system_tray.h" 8 #include "ash/common/system/tray/system_tray.h"
9 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
10 #include "ash/common/system/tray/tray_item_more.h" 10 #include "ash/common/system/tray/tray_item_more.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 void RotationLockDefaultView::UpdateImage() { 89 void RotationLockDefaultView::UpdateImage() {
90 const bool rotation_locked = 90 const bool rotation_locked =
91 Shell::GetInstance()->screen_orientation_controller()->rotation_locked(); 91 Shell::GetInstance()->screen_orientation_controller()->rotation_locked();
92 if (MaterialDesignController::UseMaterialDesignSystemIcons()) { 92 if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
93 std::unique_ptr<TrayPopupItemStyle> style = CreateStyle(); 93 std::unique_ptr<TrayPopupItemStyle> style = CreateStyle();
94 SetImage(gfx::CreateVectorIcon(rotation_locked 94 SetImage(gfx::CreateVectorIcon(rotation_locked
95 ? kSystemMenuRotationLockLockedIcon 95 ? kSystemMenuRotationLockLockedIcon
96 : kSystemMenuRotationLockAutoIcon, 96 : kSystemMenuRotationLockAutoIcon,
97 kMenuIconSize, style->GetForegroundColor())); 97 kMenuIconSize, style->GetIconColor()));
98 } else { 98 } else {
99 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 99 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
100 const int resource_id = rotation_locked 100 const int resource_id = rotation_locked
101 ? IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED_DARK 101 ? IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED_DARK
102 : IDR_AURA_UBER_TRAY_AUTO_ROTATION_DARK; 102 : IDR_AURA_UBER_TRAY_AUTO_ROTATION_DARK;
103 SetImage(*bundle.GetImageNamed(resource_id).ToImageSkia()); 103 SetImage(*bundle.GetImageNamed(resource_id).ToImageSkia());
104 } 104 }
105 105
106 base::string16 label = l10n_util::GetStringUTF16( 106 base::string16 label = l10n_util::GetStringUTF16(
107 rotation_locked ? IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED 107 rotation_locked ? IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 186
187 void TrayRotationLock::StopObservingShell() { 187 void TrayRotationLock::StopObservingShell() {
188 if (!observing_shell_) 188 if (!observing_shell_)
189 return; 189 return;
190 WmShell::Get()->RemoveShellObserver(this); 190 WmShell::Get()->RemoveShellObserver(this);
191 observing_shell_ = false; 191 observing_shell_ = false;
192 } 192 }
193 193
194 } // namespace ash 194 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray_accessibility.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698