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/chromeos/palette/common_palette_tool.h" | 5 #include "ash/common/system/chromeos/palette/common_palette_tool.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_constants.h" | 7 #include "ash/common/shelf/shelf_constants.h" |
8 #include "ash/common/system/chromeos/palette/palette_ids.h" | 8 #include "ash/common/system/chromeos/palette/palette_ids.h" |
9 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" | 9 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" |
10 #include "ash/common/system/tray/hover_highlight_view.h" | 10 #include "ash/common/system/tray/hover_highlight_view.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) { | 85 views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) { |
86 gfx::ImageSkia icon = | 86 gfx::ImageSkia icon = |
87 CreateVectorIcon(GetPaletteIcon(), kMenuIconSize, gfx::kChromeIconGrey); | 87 CreateVectorIcon(GetPaletteIcon(), kMenuIconSize, gfx::kChromeIconGrey); |
88 gfx::ImageSkia check = CreateVectorIcon(gfx::VectorIconId::CHECK_CIRCLE, | 88 gfx::ImageSkia check = CreateVectorIcon(gfx::VectorIconId::CHECK_CIRCLE, |
89 kMenuIconSize, gfx::kGoogleGreen700); | 89 kMenuIconSize, gfx::kGoogleGreen700); |
90 | 90 |
91 highlight_view_ = new HoverHighlightView(this); | 91 highlight_view_ = new HoverHighlightView(this); |
92 highlight_view_->SetBorder(views::CreateEmptyBorder(0, 0, 0, 0)); | 92 highlight_view_->SetBorder( |
| 93 views::CreateEmptyBorder(0, kMenuExtraMarginFromLeftEdge, 0, 0)); |
93 const int interior_button_padding = (kMenuButtonSize - kMenuIconSize) / 2; | 94 const int interior_button_padding = (kMenuButtonSize - kMenuIconSize) / 2; |
94 highlight_view_->AddIconAndLabelCustomSize(icon, name, false, kMenuIconSize, | 95 highlight_view_->AddIconAndLabelCustomSize(icon, name, false, kMenuIconSize, |
95 interior_button_padding, | 96 interior_button_padding, |
96 kTrayPopupPaddingHorizontal); | 97 kTrayPopupPaddingHorizontal); |
97 highlight_view_->AddRightIcon(check, kMenuIconSize); | 98 highlight_view_->AddRightIcon(check, kMenuIconSize); |
98 highlight_view_->set_custom_height(kMenuButtonSize); | 99 highlight_view_->set_custom_height(kMenuButtonSize); |
99 | 100 |
100 if (enabled()) { | 101 if (enabled()) { |
101 highlight_view_->SetAccessiblityState( | 102 highlight_view_->SetAccessiblityState( |
102 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); | 103 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); |
103 } else { | 104 } else { |
104 highlight_view_->SetRightViewVisible(false); | 105 highlight_view_->SetRightViewVisible(false); |
105 highlight_view_->SetAccessiblityState( | 106 highlight_view_->SetAccessiblityState( |
106 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); | 107 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); |
107 } | 108 } |
108 | 109 |
109 return highlight_view_; | 110 return highlight_view_; |
110 } | 111 } |
111 | 112 |
112 } // namespace ash | 113 } // namespace ash |
OLD | NEW |