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

Unified Diff: ash/common/system/chromeos/palette/common_palette_tool.cc

Issue 2803893002: Reuse the code within UpdateCheckMark() (Closed)
Patch Set: Rename CheckMark -> SetCheckMarkVisible, UncheckMark -> SetCheckMarkInvisible. Update the comment. Created 3 years, 8 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
Index: ash/common/system/chromeos/palette/common_palette_tool.cc
diff --git a/ash/common/system/chromeos/palette/common_palette_tool.cc b/ash/common/system/chromeos/palette/common_palette_tool.cc
index b8a049304877eb42f6ab14c345e88f66f0480563..672b2ff3e8e34b09fb4e44cb9001bceee299d0e3 100644
--- a/ash/common/system/chromeos/palette/common_palette_tool.cc
+++ b/ash/common/system/chromeos/palette/common_palette_tool.cc
@@ -9,6 +9,7 @@
#include "ash/common/system/chromeos/palette/palette_tool_manager.h"
#include "ash/common/system/tray/hover_highlight_view.h"
#include "ash/common/system/tray/tray_constants.h"
+#include "ash/common/system/tray/tray_utils.h"
#include "ash/common/system/tray/view_click_listener.h"
#include "ash/resources/grit/ash_resources.h"
#include "ash/resources/vector_icons/vector_icons.h"
@@ -52,9 +53,7 @@ void CommonPaletteTool::OnEnable() {
start_time_ = base::TimeTicks::Now();
if (highlight_view_) {
- highlight_view_->SetRightViewVisible(true);
- highlight_view_->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX);
+ SetCheckMarkVisible(highlight_view_);
}
}
@@ -63,9 +62,7 @@ void CommonPaletteTool::OnDisable() {
AddHistogramTimes(GetToolId(), base::TimeTicks::Now() - start_time_);
if (highlight_view_) {
- highlight_view_->SetRightViewVisible(false);
- highlight_view_->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
+ SetCheckMarkInvisible(highlight_view_);
}
}
@@ -95,12 +92,9 @@ views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) {
highlight_view_->set_custom_height(kMenuButtonSize);
if (enabled()) {
- highlight_view_->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX);
+ SetCheckMarkVisible(highlight_view_);
} else {
- highlight_view_->SetRightViewVisible(false);
- highlight_view_->SetAccessiblityState(
- HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX);
+ SetCheckMarkInvisible(highlight_view_);
}
return highlight_view_;

Powered by Google App Engine
This is Rietveld 408576698