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

Unified Diff: ash/common/system/chromeos/tray_caps_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/common/system/chromeos/tray_caps_lock.cc
diff --git a/ash/common/system/chromeos/tray_caps_lock.cc b/ash/common/system/chromeos/tray_caps_lock.cc
index 46cd7709b68130effe9a4cfc7ff38761d192bb1d..2162cf9331313ab675b97f91e1ca6da9e72411a9 100644
--- a/ash/common/system/chromeos/tray_caps_lock.cc
+++ b/ash/common/system/chromeos/tray_caps_lock.cc
@@ -5,7 +5,6 @@
#include "ash/common/system/chromeos/tray_caps_lock.h"
#include "ash/common/accessibility_delegate.h"
-#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/system/tray/actionable_view.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/tray/tray_constants.h"
@@ -59,21 +58,18 @@ class CapsLockDefaultView : public ActionableView {
AddChildView(tri_view);
auto image = TrayPopupUtils::CreateMainImageView();
- if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
- image->SetEnabled(enabled());
- TrayPopupItemStyle default_view_style(
- TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
- image->SetImage(gfx::CreateVectorIcon(kSystemMenuCapsLockIcon,
- default_view_style.GetIconColor()));
- default_view_style.SetupLabel(text_label_);
- TrayPopupItemStyle caption_style(TrayPopupItemStyle::FontStyle::CAPTION);
- caption_style.SetupLabel(shortcut_label_);
- SetInkDropMode(InkDropHostView::InkDropMode::ON);
- } else {
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- image->SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK)
- .ToImageSkia());
- }
+ image->SetEnabled(enabled());
+ TrayPopupItemStyle default_view_style(
+ TrayPopupItemStyle::FontStyle::DEFAULT_VIEW_LABEL);
+ image->SetImage(gfx::CreateVectorIcon(kSystemMenuCapsLockIcon,
+ default_view_style.GetIconColor()));
+ default_view_style.SetupLabel(text_label_);
+
+ TrayPopupItemStyle caption_style(TrayPopupItemStyle::FontStyle::CAPTION);
+ caption_style.SetupLabel(shortcut_label_);
+
+ SetInkDropMode(InkDropHostView::InkDropMode::ON);
+
tri_view->AddView(TriView::Container::START, image);
tri_view->AddView(TriView::Container::CENTER, text_label_);
tri_view->AddView(TriView::Container::END, shortcut_label_);
@@ -140,9 +136,9 @@ class CapsLockDefaultView : public ActionableView {
};
TrayCapsLock::TrayCapsLock(SystemTray* system_tray)
- : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_CAPS_LOCK, UMA_CAPS_LOCK),
- default_(NULL),
- detailed_(NULL),
+ : TrayImageItem(system_tray, kSystemTrayCapsLockIcon, UMA_CAPS_LOCK),
+ default_(nullptr),
+ detailed_(nullptr),
caps_lock_enabled_(CapsLockIsEnabled()),
message_shown_(false) {
chromeos::input_method::InputMethodManager* ime =
@@ -190,15 +186,15 @@ bool TrayCapsLock::GetInitialVisibility() {
views::View* TrayCapsLock::CreateDefaultView(LoginStatus status) {
if (!caps_lock_enabled_)
- return NULL;
- DCHECK(default_ == NULL);
+ return nullptr;
+ DCHECK(!default_);
default_ = new CapsLockDefaultView;
default_->Update(caps_lock_enabled_);
return default_;
}
views::View* TrayCapsLock::CreateDetailedView(LoginStatus status) {
- DCHECK(detailed_ == NULL);
+ DCHECK(!detailed_);
detailed_ = new views::View;
detailed_->SetLayoutManager(new views::BoxLayout(
@@ -207,14 +203,8 @@ views::View* TrayCapsLock::CreateDetailedView(LoginStatus status) {
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
views::ImageView* image = new views::ImageView;
- if (MaterialDesignController::UseMaterialDesignSystemIcons()) {
- image->SetImage(CreateVectorIcon(kSystemMenuCapsLockIcon, kMenuIconSize,
- kMenuIconColor));
- } else {
- image->SetImage(
- bundle.GetImageNamed(IDR_AURA_UBER_TRAY_CAPS_LOCK_DARK).ToImageSkia());
- }
-
+ image->SetImage(
+ CreateVectorIcon(kSystemMenuCapsLockIcon, kMenuIconSize, kMenuIconColor));
detailed_->AddChildView(image);
const int string_id =
@@ -232,11 +222,11 @@ views::View* TrayCapsLock::CreateDetailedView(LoginStatus status) {
}
void TrayCapsLock::DestroyDefaultView() {
- default_ = NULL;
+ default_ = nullptr;
}
void TrayCapsLock::DestroyDetailedView() {
- detailed_ = NULL;
+ detailed_ = nullptr;
}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698