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

Unified Diff: ash/system/chromeos/rotation/tray_rotation_lock.cc

Issue 2700653002: [Ash MD] Remove pre-MD code from TrayImageItem and subclasses (Closed)
Patch Set: Created 3 years, 10 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 c4fe50ead358d7eb8f33c7ba168fbd50bf4f5f47..c8dda78362c50b6cfe53b9bbff5fd8e3741960da 100644
--- a/ash/system/chromeos/rotation/tray_rotation_lock.cc
+++ b/ash/system/chromeos/rotation/tray_rotation_lock.cc
@@ -4,7 +4,6 @@
#include "ash/system/chromeos/rotation/tray_rotation_lock.h"
-#include "ash/common/material_design/material_design_controller.h"
#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"
@@ -14,10 +13,8 @@
#include "ash/display/screen_orientation_controller_chromeos.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/shell.h"
-#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/display/display.h"
#include "ui/gfx/paint_vector_icon.h"
@@ -89,20 +86,11 @@ void RotationLockDefaultView::UpdateStyle() {
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, style->GetIconColor()));
- } else {
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- const int resource_id = rotation_locked
- ? IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED_DARK
- : IDR_AURA_UBER_TRAY_AUTO_ROTATION_DARK;
- SetImage(*bundle.GetImageNamed(resource_id).ToImageSkia());
- }
-
+ std::unique_ptr<TrayPopupItemStyle> style = CreateStyle();
+ SetImage(gfx::CreateVectorIcon(rotation_locked
+ ? kSystemMenuRotationLockLockedIcon
+ : kSystemMenuRotationLockAutoIcon,
+ kMenuIconSize, style->GetIconColor()));
base::string16 label = l10n_util::GetStringUTF16(
rotation_locked ? IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED
: IDS_ASH_STATUS_TRAY_ROTATION_LOCK_AUTO);
@@ -114,7 +102,7 @@ void RotationLockDefaultView::UpdateImage() {
TrayRotationLock::TrayRotationLock(SystemTray* system_tray)
: TrayImageItem(system_tray,
- IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED,
+ kSystemTrayRotationLockLockedIcon,
UMA_ROTATION_LOCK),
observing_rotation_(false),
observing_shell_(true) {
@@ -132,7 +120,7 @@ void TrayRotationLock::OnRotationLockChanged(bool rotation_locked) {
views::View* TrayRotationLock::CreateDefaultView(LoginStatus status) {
if (OnPrimaryDisplay())
return new tray::RotationLockDefaultView(this);
- return NULL;
+ return nullptr;
}
void TrayRotationLock::OnMaximizeModeStarted() {

Powered by Google App Engine
This is Rietveld 408576698