Commit 2dd9ae13 authored by Katie D's avatar Katie D Committed by Commit Bot

Adds Select-to-Speak button in the tray.

The button will allow touch and stylus users to activate Select-to-Speak
without a keyboard, but is also able to be used with a mouse.

This adds a button to the tray that is notified and updates its appearence when
Select-to-Speak state changes. In a following change, the Select-to-Speak
extension will listen to state change requests from the button.

Bug: 753018
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I3a1ab08c579696cf199c32deec368473952b57fc
Reviewed-on: https://chromium-review.googlesource.com/1040268
Commit-Queue: Katie Dektar <katie@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555840}
parent ee4464dd
......@@ -519,6 +519,8 @@ component("ash") {
"sticky_keys/sticky_keys_overlay.cc",
"sticky_keys/sticky_keys_overlay.h",
"sticky_keys/sticky_keys_state.h",
"system/accessibility/select_to_speak_tray.cc",
"system/accessibility/select_to_speak_tray.h",
"system/audio/audio_detailed_view.cc",
"system/audio/audio_detailed_view.h",
"system/audio/tray_audio.cc",
......@@ -1631,6 +1633,7 @@ test("ash_unittests") {
"shell_unittest.cc",
"sticky_keys/sticky_keys_overlay_unittest.cc",
"sticky_keys/sticky_keys_unittest.cc",
"system/accessibility/select_to_speak_tray_unittest.cc",
"system/audio/tray_audio_unittest.cc",
"system/bluetooth/bluetooth_power_controller_unittest.cc",
"system/bluetooth/tray_bluetooth_helper_unittest.cc",
......
......@@ -61,7 +61,9 @@ void TestAccessibilityControllerClient::ShouldToggleSpokenFeedbackViaTouch(
void TestAccessibilityControllerClient::PlaySpokenFeedbackToggleCountdown(
int tick_count) {}
void TestAccessibilityControllerClient::RequestSelectToSpeakStateChange() {}
void TestAccessibilityControllerClient::RequestSelectToSpeakStateChange() {
++select_to_speak_state_change_requests_;
}
int32_t TestAccessibilityControllerClient::GetPlayedEarconAndReset() {
int32_t tmp = sound_key_;
......
......@@ -45,6 +45,9 @@ class TestAccessibilityControllerClient
mojom::AccessibilityAlert last_a11y_alert() const { return last_a11y_alert_; }
ax::mojom::Gesture last_a11y_gesture() const { return last_a11y_gesture_; }
int select_to_speak_change_change_requests() const {
return select_to_speak_state_change_requests_;
}
private:
mojom::AccessibilityAlert last_a11y_alert_ = mojom::AccessibilityAlert::NONE;
......@@ -54,6 +57,8 @@ class TestAccessibilityControllerClient
ax::mojom::Gesture last_a11y_gesture_ = ax::mojom::Gesture::kNone;
int select_to_speak_state_change_requests_ = 0;
mojo::Binding<mojom::AccessibilityControllerClient> binding_;
DISALLOW_COPY_AND_ASSIGN(TestAccessibilityControllerClient);
......
......@@ -1082,6 +1082,10 @@ This file contains the strings for ash.
IME menu button
</message>
<message name="IDS_ASH_SELECT_TO_SPEAK_TRAY_ACCESSIBLE_NAME" desc="The accessible text for the select-to-speak menu icon in the status tray.">
Select-to-Speak button
</message>
<!-- Deprecated Accelerators Messages -->
<!-- Shortcut keys MUST be connected with pluses (e.g. Ctrl+Shift+L). -->
<message name="IDS_SHORTCUT_LOCK_SCREEN_OLD" desc="the old deprecated shortcut to lock the screen.">
......
......@@ -165,7 +165,9 @@ aggregate_vector_icons("ash_vector_icons") {
"system_tray_recording.icon",
"system_tray_rotation_lock_auto.icon",
"system_tray_rotation_lock_locked.icon",
"system_tray_select_to_speak.icon",
"system_tray_screen_share.icon",
"system_tray_stop.icon",
"system_tray_tracing.icon",
"system_tray_update.icon",
"system_tray_volume_mute.icon",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 32,
MOVE_TO, 16, 28,
CUBIC_TO, 9.37f, 28, 4, 22.63f, 4, 16,
CUBIC_TO, 4, 9.37f, 9.37f, 4, 16, 4,
CUBIC_TO, 22.63f, 4, 28, 9.37f, 28, 16,
CUBIC_TO, 28, 22.63f, 22.63f, 28, 16, 28,
CLOSE,
MOVE_TO, 8, 8,
LINE_TO, 8, 12,
LINE_TO, 10, 12,
LINE_TO, 10, 10,
LINE_TO, 12, 10,
LINE_TO, 12, 8,
LINE_TO, 8, 8,
CLOSE,
MOVE_TO, 24, 24,
LINE_TO, 24, 20,
LINE_TO, 22, 20,
LINE_TO, 22, 22,
LINE_TO, 20, 22,
LINE_TO, 20, 24,
LINE_TO, 24, 24,
CLOSE,
MOVE_TO, 10, 13.95f,
LINE_TO, 10, 18.05f,
LINE_TO, 12.67f, 18.05f,
LINE_TO, 16, 21.47f,
LINE_TO, 16, 10.53f,
LINE_TO, 12.67f, 13.95f,
LINE_TO, 10, 13.95f,
CLOSE,
MOVE_TO, 19, 16,
CUBIC_TO, 19, 14.79f, 18.32f, 13.75f, 17.33f, 13.24f,
LINE_TO, 17.33f, 18.75f,
CUBIC_TO, 18.32f, 18.25f, 19, 17.21f, 19, 16,
CLOSE,
MOVE_TO, 17.33f, 10,
LINE_TO, 17.33f, 11.41f,
CUBIC_TO, 19.26f, 12, 20.67f, 13.83f, 20.67f, 16,
CUBIC_TO, 20.67f, 18.17f, 19.26f, 20, 17.33f, 20.59f,
LINE_TO, 17.33f, 22,
CUBIC_TO, 20.01f, 21.38f, 22, 18.93f, 22, 16,
CUBIC_TO, 22, 13.07f, 20.01f, 10.62f, 17.33f, 10,
CLOSE
CANVAS_DIMENSIONS, 16,
MOVE_TO, 8, 14,
CUBIC_TO, 4.69f, 14, 2, 11.31f, 2, 8,
CUBIC_TO, 2, 4.69f, 4.69f, 2, 8, 2,
CUBIC_TO, 11.31f, 2, 14, 4.69f, 14, 8,
CUBIC_TO, 14, 11.31f, 11.31f, 14, 8, 14,
CLOSE,
MOVE_TO, 4, 4,
LINE_TO, 4, 6,
LINE_TO, 5, 6,
LINE_TO, 5, 5,
LINE_TO, 6, 5,
LINE_TO, 6, 4,
LINE_TO, 4, 4,
CLOSE,
MOVE_TO, 12, 12,
LINE_TO, 12, 10,
LINE_TO, 11, 10,
LINE_TO, 11, 11,
LINE_TO, 10, 11,
LINE_TO, 10, 12,
LINE_TO, 12, 12,
CLOSE,
MOVE_TO, 5, 6.97f,
LINE_TO, 5, 9.03f,
LINE_TO, 6.33f, 9.03f,
LINE_TO, 8, 10.74f,
LINE_TO, 8, 5.26f,
LINE_TO, 6.33f, 6.97f,
LINE_TO, 5, 6.97f,
CLOSE,
MOVE_TO, 9.5f, 8,
CUBIC_TO, 9.5f, 7.39f, 9.16f, 6.87f, 8.67f, 6.62f,
LINE_TO, 8.67f, 9.38f,
CUBIC_TO, 9.16f, 9.13f, 9.5f, 8.61f, 9.5f, 8,
CLOSE,
MOVE_TO, 8.67f, 5,
LINE_TO, 8.67f, 5.7f,
CUBIC_TO, 9.63f, 6, 10.33f, 6.92f, 10.33f, 8,
CUBIC_TO, 10.33f, 9.08f, 9.63f, 10, 8.67f, 10.3f,
LINE_TO, 8.67f, 11,
CUBIC_TO, 10, 10.69f, 11, 9.46f, 11, 8,
CUBIC_TO, 11, 6.54f, 10, 5.31f, 8.67f, 5,
CLOSE
\ No newline at end of file
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 32,
MOVE_TO, 16, 28,
CUBIC_TO, 9.37f, 28, 4, 22.63f, 4, 16,
CUBIC_TO, 4, 9.37f, 9.37f, 4, 16, 4,
CUBIC_TO, 22.63f, 4, 28, 9.37f, 28, 16,
CUBIC_TO, 28, 22.63f, 22.63f, 28, 16, 28,
CLOSE,
MOVE_TO, 12, 12,
LINE_TO, 12, 20,
LINE_TO, 20, 20,
LINE_TO, 20, 12,
LINE_TO, 12, 12,
CLOSE
CANVAS_DIMENSIONS, 16,
MOVE_TO, 8, 14,
CUBIC_TO, 4.69f, 14, 2, 11.31f, 2, 8,
CUBIC_TO, 2, 4.69f, 4.69f, 2, 8, 2,
CUBIC_TO, 11.31f, 2, 14, 4.69f, 14, 8,
CUBIC_TO, 14, 11.31f, 11.31f, 14, 8, 14,
CLOSE,
MOVE_TO, 6, 6,
LINE_TO, 6, 10,
LINE_TO, 10, 10,
LINE_TO, 10, 6,
LINE_TO, 6, 6,
CLOSE
\ No newline at end of file
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/system/accessibility/select_to_speak_tray.h"
#include "ash/accessibility/accessibility_controller.h"
#include "ash/resources/vector_icons/vector_icons.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_container.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/border.h"
#include "ui/views/controls/image_view.h"
namespace views {
class ImageView;
}
namespace ash {
// This constant must be kept the same as SELECT_TO_SPEAK_TRAY_CLASS_NAME in
// chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js.
const char kSelectToSpeakTrayClassName[] =
"tray/TrayBackgroundView/SelectToSpeakTray";
SelectToSpeakTray::SelectToSpeakTray(Shelf* shelf)
: TrayBackgroundView(shelf), icon_(new views::ImageView()) {
SetInkDropMode(InkDropMode::ON);
start_selection_image_ =
gfx::CreateVectorIcon(kSystemTraySelectToSpeakIcon, kShelfIconColor);
cancel_speech_image_ =
gfx::CreateVectorIcon(kSystemTrayStopIcon, kShelfIconColor);
icon_->SetImage(start_selection_image_);
const int vertical_padding =
(kTrayItemSize - start_selection_image_.height()) / 2;
const int horizontal_padding =
(kTrayItemSize - start_selection_image_.width()) / 2;
icon_->SetBorder(views::CreateEmptyBorder(
gfx::Insets(vertical_padding, horizontal_padding)));
tray_container()->AddChildView(icon_);
CheckStatusAndUpdateIcon();
// Observe the accessibility controller state changes to know when Select to
// Speak state is updated or when it is disabled/enabled.
Shell::Get()->accessibility_controller()->AddObserver(this);
}
SelectToSpeakTray::~SelectToSpeakTray() {
Shell::Get()->accessibility_controller()->RemoveObserver(this);
}
base::string16 SelectToSpeakTray::GetAccessibleNameForTray() {
return l10n_util::GetStringUTF16(
IDS_ASH_SELECT_TO_SPEAK_TRAY_ACCESSIBLE_NAME);
}
const char* SelectToSpeakTray::GetClassName() const {
return kSelectToSpeakTrayClassName;
}
bool SelectToSpeakTray::PerformAction(const ui::Event& event) {
Shell::Get()->accessibility_controller()->RequestSelectToSpeakStateChange();
return true;
}
void SelectToSpeakTray::OnAccessibilityStatusChanged() {
CheckStatusAndUpdateIcon();
}
void SelectToSpeakTray::CheckStatusAndUpdateIcon() {
if (!Shell::Get()->accessibility_controller()->IsSelectToSpeakEnabled()) {
SetVisible(false);
return;
}
ash::mojom::SelectToSpeakState state =
Shell::Get()->accessibility_controller()->GetSelectToSpeakState();
switch (state) {
case ash::mojom::SelectToSpeakState::kSelectToSpeakStateInactive:
icon_->SetImage(start_selection_image_);
SetIsActive(false);
break;
case ash::mojom::SelectToSpeakState::kSelectToSpeakStateSelecting:
// Activate the start selection button during selection.
icon_->SetImage(start_selection_image_);
SetIsActive(true);
break;
case ash::mojom::SelectToSpeakState::kSelectToSpeakStateSpeaking:
icon_->SetImage(cancel_speech_image_);
SetIsActive(true);
break;
}
SetVisible(true);
}
} // namespace ash
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_SYSTEM_ACCESSIBILITY_SELECT_TO_SPEAK_TRAY_H_
#define ASH_SYSTEM_ACCESSIBILITY_SELECT_TO_SPEAK_TRAY_H_
#include "ash/accessibility/accessibility_observer.h"
#include "ash/ash_export.h"
#include "ash/system/tray/tray_background_view.h"
#include "base/macros.h"
#include "ui/views/controls/image_view.h"
namespace views {
class ImageView;
}
namespace ash {
// A button in the tray that lets users start/stop Select-to-Speak.
class ASH_EXPORT SelectToSpeakTray : public TrayBackgroundView,
public AccessibilityObserver {
public:
explicit SelectToSpeakTray(Shelf* shelf);
~SelectToSpeakTray() override;
// TrayBackgroundView:
base::string16 GetAccessibleNameForTray() override;
const char* GetClassName() const override;
void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override {}
void ClickedOutsideBubble() override {}
bool PerformAction(const ui::Event& event) override;
// AccessibilityObserver:
void OnAccessibilityStatusChanged() override;
private:
friend class SelectToSpeakTrayTest;
// Sets the icon when select-to-speak is activated (speaking) / deactivated.
// Also updates visibility when select-to-speak is enabled / disabled.
void CheckStatusAndUpdateIcon();
gfx::ImageSkia start_selection_image_;
gfx::ImageSkia cancel_speech_image_;
// Weak pointer, will be parented by TrayContainer for its lifetime.
views::ImageView* icon_;
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakTray);
};
} // namespace ash
#endif // ASH_SYSTEM_ACCESSIBILITY_SELECT_TO_SPEAK_TRAY_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/system/accessibility/select_to_speak_tray.h"
#include "ash/accelerators/accelerator_controller.h"
#include "ash/accessibility/accessibility_controller.h"
#include "ash/accessibility/test_accessibility_controller_client.h"
#include "ash/shell.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/status_area_widget_test_helper.h"
#include "ash/test/ash_test_base.h"
#include "base/command_line.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/ime/ime_bridge.h"
#include "ui/base/ime/text_input_flags.h"
#include "ui/events/event.h"
#include "ui/views/controls/label.h"
namespace ash {
namespace {
SelectToSpeakTray* GetTray() {
return StatusAreaWidgetTestHelper::GetStatusAreaWidget()
->select_to_speak_tray();
}
ui::GestureEvent CreateTapEvent() {
return ui::GestureEvent(0, 0, 0, base::TimeTicks(),
ui::GestureEventDetails(ui::ET_GESTURE_TAP));
}
} // namespace
class SelectToSpeakTrayTest : public AshTestBase {
public:
SelectToSpeakTrayTest() = default;
~SelectToSpeakTrayTest() override = default;
void SetUp() override {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
chromeos::switches::kEnableExperimentalAccessibilityFeatures);
AshTestBase::SetUp();
Shell::Get()->accessibility_controller()->SetSelectToSpeakEnabled(true);
}
protected:
// Returns true if the Select to Speak tray is visible.
bool IsVisible() { return GetTray()->visible(); }
// Returns true if the background color of the tray is active.
bool IsTrayBackgroundActive() { return GetTray()->is_active(); }
// Gets the current tray image view.
views::ImageView* GetImageView() { return GetTray()->icon_; }
gfx::ImageSkia GetStartSelectionImage() {
return GetTray()->start_selection_image_;
}
gfx::ImageSkia GetCancelSpeechImage() {
return GetTray()->cancel_speech_image_;
}
private:
DISALLOW_COPY_AND_ASSIGN(SelectToSpeakTrayTest);
};
// Ensures that creation doesn't cause any crashes and adds the image icon.
// Also checks that the tray is visible.
TEST_F(SelectToSpeakTrayTest, BasicConstruction) {
EXPECT_TRUE(GetImageView());
EXPECT_TRUE(IsVisible());
}
// Tests the icon disapears when select-to-speak is disabled and re-appears
// when it is enabled.
TEST_F(SelectToSpeakTrayTest, ShowsAndHidesWithSelectToSpeakEnabled) {
Shell::Get()->accessibility_controller()->SetSelectToSpeakEnabled(false);
EXPECT_FALSE(IsVisible());
Shell::Get()->accessibility_controller()->SetSelectToSpeakEnabled(true);
EXPECT_TRUE(IsVisible());
}
// Test that clicking the button sends a Select to Speak state change request.
TEST_F(SelectToSpeakTrayTest, ButtonRequestsSelectToSpeakStateChange) {
AccessibilityController* controller =
Shell::Get()->accessibility_controller();
TestAccessibilityControllerClient client;
controller->SetClient(client.CreateInterfacePtrAndBind());
EXPECT_EQ(0, client.select_to_speak_change_change_requests());
GetTray()->PerformAction(CreateTapEvent());
controller->FlushMojoForTest();
EXPECT_EQ(1, client.select_to_speak_change_change_requests());
GetTray()->PerformAction(CreateTapEvent());
controller->FlushMojoForTest();
EXPECT_EQ(2, client.select_to_speak_change_change_requests());
}
// Test that changing the SelectToSpeakState in the AccessibilityController
// results in a change of icon and activation in the tray.
TEST_F(SelectToSpeakTrayTest, SelectToSpeakStateImpactsImageAndActivation) {
AccessibilityController* controller =
Shell::Get()->accessibility_controller();
controller->SetSelectToSpeakState(
ash::mojom::SelectToSpeakState::kSelectToSpeakStateSelecting);
EXPECT_TRUE(IsTrayBackgroundActive());
EXPECT_TRUE(GetStartSelectionImage().BackedBySameObjectAs(
GetImageView()->GetImage()));
controller->SetSelectToSpeakState(
ash::mojom::SelectToSpeakState::kSelectToSpeakStateSpeaking);
EXPECT_TRUE(IsTrayBackgroundActive());
EXPECT_TRUE(
GetCancelSpeechImage().BackedBySameObjectAs(GetImageView()->GetImage()));
controller->SetSelectToSpeakState(
ash::mojom::SelectToSpeakState::kSelectToSpeakStateInactive);
EXPECT_FALSE(IsTrayBackgroundActive());
EXPECT_TRUE(GetStartSelectionImage().BackedBySameObjectAs(
GetImageView()->GetImage()));
}
} // namespace ash
......@@ -9,6 +9,7 @@
#include "ash/session/session_controller.h"
#include "ash/shelf/shelf.h"
#include "ash/shell.h"
#include "ash/system/accessibility/select_to_speak_tray.h"
#include "ash/system/dictation/dictation_button_tray.h"
#include "ash/system/flag_warning/flag_warning_tray.h"
#include "ash/system/ime_menu/ime_menu_tray.h"
......@@ -73,16 +74,22 @@ void StatusAreaWidget::Initialize() {
ime_menu_tray_ = std::make_unique<ImeMenuTray>(shelf_);
status_area_widget_delegate_->AddChildView(ime_menu_tray_.get());
logout_button_tray_ = std::make_unique<LogoutButtonTray>(shelf_);
status_area_widget_delegate_->AddChildView(logout_button_tray_.get());
// Dictation is currently only available behind the experimental
// accessibility features flag.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableExperimentalAccessibilityFeatures)) {
// The Select-to-Speak button is currently only available behind the
// experimental accessibility features flag.
select_to_speak_tray_ = std::make_unique<SelectToSpeakTray>(shelf_);
status_area_widget_delegate_->AddChildView(select_to_speak_tray_.get());
// Dictation is currently only available behind the experimental
// accessibility features flag.
dictation_button_tray_ = std::make_unique<DictationButtonTray>(shelf_);
status_area_widget_delegate_->AddChildView(dictation_button_tray_.get());
}
logout_button_tray_ = std::make_unique<LogoutButtonTray>(shelf_);
status_area_widget_delegate_->AddChildView(logout_button_tray_.get());
if (Shell::GetAshConfig() == ash::Config::MASH) {
// Flag warning tray is not currently used in non-MASH environments, because
// mus will roll out via experiment/Finch trial and showing the tray would
......@@ -105,9 +112,11 @@ void StatusAreaWidget::Initialize() {
palette_tray_->Initialize();
virtual_keyboard_tray_->Initialize();
ime_menu_tray_->Initialize();
overview_button_tray_->Initialize();
if (select_to_speak_tray_)
select_to_speak_tray_->Initialize();
if (dictation_button_tray_)
dictation_button_tray_->Initialize();
overview_button_tray_->Initialize();
UpdateAfterShelfAlignmentChange();
UpdateAfterLoginStatusChange(
Shell::Get()->session_controller()->login_status());
......@@ -124,11 +133,12 @@ StatusAreaWidget::~StatusAreaWidget() {
system_tray_.reset();
unified_system_tray_.reset();
ime_menu_tray_.reset();
select_to_speak_tray_.reset();
dictation_button_tray_.reset();
virtual_keyboard_tray_.reset();
palette_tray_.reset();
logout_button_tray_.reset();
overview_button_tray_.reset();
dictation_button_tray_.reset();
flag_warning_tray_.reset();
// All child tray views have been removed.
......@@ -142,10 +152,12 @@ void StatusAreaWidget::UpdateAfterShelfAlignmentChange() {
logout_button_tray_->UpdateAfterShelfAlignmentChange();
virtual_keyboard_tray_->UpdateAfterShelfAlignmentChange();
ime_menu_tray_->UpdateAfterShelfAlignmentChange();
palette_tray_->UpdateAfterShelfAlignmentChange();
overview_button_tray_->UpdateAfterShelfAlignmentChange();
if (select_to_speak_tray_)
select_to_speak_tray_->UpdateAfterShelfAlignmentChange();
if (dictation_button_tray_)
dictation_button_tray_->UpdateAfterShelfAlignmentChange();
palette_tray_->UpdateAfterShelfAlignmentChange();
overview_button_tray_->UpdateAfterShelfAlignmentChange();
if (flag_warning_tray_)
flag_warning_tray_->UpdateAfterShelfAlignmentChange();
status_area_widget_delegate_->UpdateLayout();
......@@ -204,10 +216,12 @@ void StatusAreaWidget::SchedulePaint() {
virtual_keyboard_tray_->SchedulePaint();
logout_button_tray_->SchedulePaint();
ime_menu_tray_->SchedulePaint();
palette_tray_->SchedulePaint();
overview_button_tray_->SchedulePaint();
if (select_to_speak_tray_)
select_to_speak_tray_->SchedulePaint();
if (dictation_button_tray_)
dictation_button_tray_->SchedulePaint();
palette_tray_->SchedulePaint();
overview_button_tray_->SchedulePaint();
if (flag_warning_tray_)
flag_warning_tray_->SchedulePaint();
}
......@@ -230,10 +244,12 @@ void StatusAreaWidget::UpdateShelfItemBackground(SkColor color) {
system_tray_->UpdateShelfItemBackground(color);
virtual_keyboard_tray_->UpdateShelfItemBackground(color);
ime_menu_tray_->UpdateShelfItemBackground(color);
palette_tray_->UpdateShelfItemBackground(color);
overview_button_tray_->UpdateShelfItemBackground(color);
if (select_to_speak_tray_)
select_to_speak_tray_->UpdateShelfItemBackground(color);
if (dictation_button_tray_)
dictation_button_tray_->UpdateShelfItemBackground(color);
palette_tray_->UpdateShelfItemBackground(color);
overview_button_tray_->UpdateShelfItemBackground(color);
}
} // namespace ash
......@@ -23,6 +23,7 @@ class LogoutButtonTray;
class OverviewButtonTray;
class DictationButtonTray;
class PaletteTray;
class SelectToSpeakTray;
class Shelf;
class StatusAreaWidgetDelegate;
class SystemTray;
......@@ -81,6 +82,9 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget,
}
PaletteTray* palette_tray() { return palette_tray_.get(); }
ImeMenuTray* ime_menu_tray() { return ime_menu_tray_.get(); }
SelectToSpeakTray* select_to_speak_tray() {
return select_to_speak_tray_.get();
}
Shelf* shelf() { return shelf_; }
......@@ -128,6 +132,7 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget,
std::unique_ptr<PaletteTray> palette_tray_;
std::unique_ptr<VirtualKeyboardTray> virtual_keyboard_tray_;
std::unique_ptr<ImeMenuTray> ime_menu_tray_;
std::unique_ptr<SelectToSpeakTray> select_to_speak_tray_;
std::unique_ptr<FlagWarningTray> flag_warning_tray_;
LoginStatus login_status_ = LoginStatus::NOT_LOGGED_IN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment