| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tray/system_menu_button.h" | 5 #include "ash/system/tray/system_menu_button.h" |
| 6 | 6 |
| 7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
| 8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "ash/system/tray/tray_popup_utils.h" | 10 #include "ash/system/tray/tray_popup_utils.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener, | 22 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener, |
| 23 TrayPopupInkDropStyle ink_drop_style, | 23 TrayPopupInkDropStyle ink_drop_style, |
| 24 gfx::ImageSkia normal_icon, | 24 gfx::ImageSkia normal_icon, |
| 25 gfx::ImageSkia disabled_icon, | 25 gfx::ImageSkia disabled_icon, |
| 26 int accessible_name_id) | 26 int accessible_name_id) |
| 27 : views::ImageButton(listener), ink_drop_style_(ink_drop_style) { | 27 : views::ImageButton(listener), ink_drop_style_(ink_drop_style) { |
| 28 DCHECK_EQ(normal_icon.width(), disabled_icon.width()); | 28 DCHECK_EQ(normal_icon.width(), disabled_icon.width()); |
| 29 DCHECK_EQ(normal_icon.height(), disabled_icon.height()); | 29 DCHECK_EQ(normal_icon.height(), disabled_icon.height()); |
| 30 | 30 |
| 31 SetImage(views::Button::STATE_NORMAL, &normal_icon); | 31 SetImage(STATE_NORMAL, &normal_icon); |
| 32 SetImage(views::Button::STATE_DISABLED, &disabled_icon); | 32 SetImage(STATE_DISABLED, &disabled_icon); |
| 33 | 33 |
| 34 SetImageAlignment(ALIGN_CENTER, ALIGN_MIDDLE); |
| 34 set_preferred_size(gfx::Size(kMenuButtonSize, kMenuButtonSize)); | 35 set_preferred_size(gfx::Size(kMenuButtonSize, kMenuButtonSize)); |
| 35 | 36 |
| 36 SetTooltipText(l10n_util::GetStringUTF16(accessible_name_id)); | 37 SetTooltipText(l10n_util::GetStringUTF16(accessible_name_id)); |
| 37 | 38 |
| 38 SetFocusPainter(TrayPopupUtils::CreateFocusPainter()); | 39 SetFocusPainter(TrayPopupUtils::CreateFocusPainter()); |
| 39 TrayPopupUtils::ConfigureTrayPopupButton(this); | 40 TrayPopupUtils::ConfigureTrayPopupButton(this); |
| 40 } | 41 } |
| 41 | 42 |
| 42 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener, | 43 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener, |
| 43 TrayPopupInkDropStyle ink_drop_style, | 44 TrayPopupInkDropStyle ink_drop_style, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 : TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this, | 77 : TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this, |
| 77 ink_drop_color_.value()); | 78 ink_drop_color_.value()); |
| 78 } | 79 } |
| 79 | 80 |
| 80 std::unique_ptr<views::InkDropMask> SystemMenuButton::CreateInkDropMask() | 81 std::unique_ptr<views::InkDropMask> SystemMenuButton::CreateInkDropMask() |
| 81 const { | 82 const { |
| 82 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this); | 83 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this); |
| 83 } | 84 } |
| 84 | 85 |
| 85 } // namespace ash | 86 } // namespace ash |
| OLD | NEW |