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

Unified Diff: ash/system/tray/tray_popup_header_button.cc

Issue 2066583004: mash: Move most files in //ash/system/tray to //ash/common/system/tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trayupdatemove
Patch Set: rebase Created 4 years, 6 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/system/tray/tray_popup_header_button.h ('k') | ash/system/tray/tray_popup_item_container.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/tray_popup_header_button.cc
diff --git a/ash/system/tray/tray_popup_header_button.cc b/ash/system/tray/tray_popup_header_button.cc
deleted file mode 100644
index 3fb7dcf6df171cbb733fbe79e2984db7fdd2b9ed..0000000000000000000000000000000000000000
--- a/ash/system/tray/tray_popup_header_button.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/system/tray/tray_popup_header_button.h"
-
-#include "ash/common/ash_constants.h"
-#include "ash/common/system/tray/tray_constants.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/views/background.h"
-#include "ui/views/painter.h"
-
-namespace ash {
-
-// static
-const char TrayPopupHeaderButton::kViewClassName[] =
- "tray/TrayPopupHeaderButton";
-
-TrayPopupHeaderButton::TrayPopupHeaderButton(views::ButtonListener* listener,
- int enabled_resource_id,
- int disabled_resource_id,
- int enabled_resource_id_hover,
- int disabled_resource_id_hover,
- int accessible_name_id)
- : views::ToggleImageButton(listener) {
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
- SetImage(views::Button::STATE_NORMAL,
- bundle.GetImageNamed(enabled_resource_id).ToImageSkia());
- SetToggledImage(views::Button::STATE_NORMAL,
- bundle.GetImageNamed(disabled_resource_id).ToImageSkia());
- SetImage(views::Button::STATE_HOVERED,
- bundle.GetImageNamed(enabled_resource_id_hover).ToImageSkia());
- SetToggledImage(views::Button::STATE_HOVERED,
- bundle.GetImageNamed(disabled_resource_id_hover).ToImageSkia());
- SetImageAlignment(views::ImageButton::ALIGN_CENTER,
- views::ImageButton::ALIGN_MIDDLE);
- SetAccessibleName(bundle.GetLocalizedString(accessible_name_id));
- SetFocusForPlatform();
-
- SetFocusPainter(views::Painter::CreateSolidFocusPainter(
- kFocusBorderColor,
- gfx::Insets(1, 2, 2, 3)));
-}
-
-TrayPopupHeaderButton::~TrayPopupHeaderButton() {}
-
-const char* TrayPopupHeaderButton::GetClassName() const {
- return kViewClassName;
-}
-
-gfx::Size TrayPopupHeaderButton::GetPreferredSize() const {
- return gfx::Size(ash::kTrayPopupItemHeight, ash::kTrayPopupItemHeight);
-}
-
-void TrayPopupHeaderButton::StateChanged() {
- if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
- set_background(views::Background::CreateSolidBackground(
- kTrayPopupHoverBackgroundColor));
- } else {
- set_background(nullptr);
- }
- SchedulePaint();
-}
-
-} // namespace ash
« no previous file with comments | « ash/system/tray/tray_popup_header_button.h ('k') | ash/system/tray/tray_popup_item_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698