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

Side by Side Diff: ash/common/system/chromeos/palette/common_palette_tool.cc

Issue 2696033003: [Ash MD] Remove some non-MD code from HoverHighlightView (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 unified diff | Download patch
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(views::CreateEmptyBorder(0, 0, 0, 0));
93 const int interior_button_padding = (kMenuButtonSize - kMenuIconSize) / 2; 93 highlight_view_->AddIconAndLabel(icon, name);
94 highlight_view_->AddIconAndLabelCustomSize(icon, name, false, kMenuIconSize,
95 interior_button_padding,
96 kTrayPopupPaddingHorizontal);
97 highlight_view_->AddRightIcon(check, kMenuIconSize); 94 highlight_view_->AddRightIcon(check, kMenuIconSize);
98 highlight_view_->set_custom_height(kMenuButtonSize); 95 highlight_view_->set_custom_height(kMenuButtonSize);
99 96
100 if (enabled()) { 97 if (enabled()) {
101 highlight_view_->SetAccessiblityState( 98 highlight_view_->SetAccessiblityState(
102 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); 99 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX);
103 } else { 100 } else {
104 highlight_view_->SetRightViewVisible(false); 101 highlight_view_->SetRightViewVisible(false);
105 highlight_view_->SetAccessiblityState( 102 highlight_view_->SetAccessiblityState(
106 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); 103 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
107 } 104 }
108 105
109 return highlight_view_; 106 return highlight_view_;
110 } 107 }
111 108
112 } // namespace ash 109 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698