| 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/common/system/tray/system_menu_button.h" | 5 #include "ash/common/system/tray/system_menu_button.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_constants.h" | 7 #include "ash/common/ash_constants.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_popup_utils.h" | 10 #include "ash/common/system/tray/tray_popup_utils.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 SetImage(views::Button::STATE_NORMAL, &normal_icon); | 32 SetImage(views::Button::STATE_NORMAL, &normal_icon); |
| 33 SetImage(views::Button::STATE_DISABLED, &disabled_icon); | 33 SetImage(views::Button::STATE_DISABLED, &disabled_icon); |
| 34 | 34 |
| 35 const int horizontal_padding = (kMenuButtonSize - normal_icon.width()) / 2; | 35 const int horizontal_padding = (kMenuButtonSize - normal_icon.width()) / 2; |
| 36 const int vertical_padding = (kMenuButtonSize - normal_icon.height()) / 2; | 36 const int vertical_padding = (kMenuButtonSize - normal_icon.height()) / 2; |
| 37 SetBorder(views::CreateEmptyBorder(vertical_padding, horizontal_padding, | 37 SetBorder(views::CreateEmptyBorder(vertical_padding, horizontal_padding, |
| 38 vertical_padding, horizontal_padding)); | 38 vertical_padding, horizontal_padding)); |
| 39 | 39 |
| 40 SetTooltipText(l10n_util::GetStringUTF16(accessible_name_id)); | 40 SetTooltipText(l10n_util::GetStringUTF16(accessible_name_id)); |
| 41 | 41 |
| 42 // TODO(tdanderson): Update the focus rect color, border thickness, and | |
| 43 // location for material design. | |
| 44 SetFocusForPlatform(); | 42 SetFocusForPlatform(); |
| 45 SetFocusPainter(views::Painter::CreateSolidFocusPainter( | 43 SetFocusPainter(views::Painter::CreateSolidFocusPainter( |
| 46 kFocusBorderColor, gfx::Insets(1, 1, 1, 1))); | 44 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF())); |
| 47 | 45 |
| 48 SetInkDropMode(InkDropMode::ON); | 46 SetInkDropMode(InkDropMode::ON); |
| 49 set_has_ink_drop_action_on_click(true); | 47 set_has_ink_drop_action_on_click(true); |
| 50 set_ink_drop_base_color(kTrayPopupInkDropBaseColor); | 48 set_ink_drop_base_color(kTrayPopupInkDropBaseColor); |
| 51 set_ink_drop_visible_opacity(kTrayPopupInkDropRippleOpacity); | 49 set_ink_drop_visible_opacity(kTrayPopupInkDropRippleOpacity); |
| 52 } | 50 } |
| 53 | 51 |
| 54 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener, | 52 SystemMenuButton::SystemMenuButton(views::ButtonListener* listener, |
| 55 TrayPopupInkDropStyle ink_drop_style, | 53 TrayPopupInkDropStyle ink_drop_style, |
| 56 const gfx::VectorIcon& icon, | 54 const gfx::VectorIcon& icon, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 : TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this, | 86 : TrayPopupUtils::CreateInkDropHighlight(ink_drop_style_, this, |
| 89 ink_drop_color_.value()); | 87 ink_drop_color_.value()); |
| 90 } | 88 } |
| 91 | 89 |
| 92 std::unique_ptr<views::InkDropMask> SystemMenuButton::CreateInkDropMask() | 90 std::unique_ptr<views::InkDropMask> SystemMenuButton::CreateInkDropMask() |
| 93 const { | 91 const { |
| 94 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this); | 92 return TrayPopupUtils::CreateInkDropMask(ink_drop_style_, this); |
| 95 } | 93 } |
| 96 | 94 |
| 97 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |