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

Unified Diff: ash/common/system/chromeos/bluetooth/tray_bluetooth.cc

Issue 2699443004: Modify TrayItemMore to use enabled status (Closed)
Patch Set: Removed non-MD 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
diff --git a/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc b/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
index a6a6c5e287a83ede7a2e41aefbffb223d0853f1a..9a6bb5ac97354ec525848c2866f94d627ec535d5 100644
--- a/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
+++ b/ash/common/system/chromeos/bluetooth/tray_bluetooth.cc
@@ -112,9 +112,7 @@ const int kDisabledPanelLabelBaselineY = 20;
class BluetoothDefaultView : public TrayItemMore {
public:
- BluetoothDefaultView(SystemTrayItem* owner, bool show_more)
- : TrayItemMore(owner, show_more) {}
-
+ explicit BluetoothDefaultView(SystemTrayItem* owner) : TrayItemMore(owner) {}
~BluetoothDefaultView() override {}
void Update() {
@@ -136,9 +134,10 @@ class BluetoothDefaultView : public TrayItemMore {
protected:
// TrayItemMore:
- std::unique_ptr<TrayPopupItemStyle> CreateStyle() const override {
+ std::unique_ptr<TrayPopupItemStyle> HandleCreateStyle() const override {
SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
- std::unique_ptr<TrayPopupItemStyle> style = TrayItemMore::CreateStyle();
+ std::unique_ptr<TrayPopupItemStyle> style =
+ TrayItemMore::HandleCreateStyle();
style->set_color_style(
delegate->GetBluetoothEnabled()
? TrayPopupItemStyle::ColorStyle::ACTIVE
@@ -582,8 +581,8 @@ views::View* TrayBluetooth::CreateTrayView(LoginStatus status) {
views::View* TrayBluetooth::CreateDefaultView(LoginStatus status) {
CHECK(default_ == NULL);
- default_ =
- new tray::BluetoothDefaultView(this, status != LoginStatus::LOCKED);
+ default_ = new tray::BluetoothDefaultView(this);
+ default_->SetEnabled(status != LoginStatus::LOCKED);
default_->Update();
return default_;
}
« no previous file with comments | « no previous file | ash/common/system/chromeos/cast/tray_cast.cc » ('j') | ash/common/system/tray/tray_item_more.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698