Commit 21855c70 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ash: Disable some entries in the network tray-popup instead of removing them.

BUG=122187
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10079006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132262 0039d316-1c4b-4281-b951-d872f2087c98
parent fe60c198
......@@ -276,21 +276,21 @@ class NetworkDetailedView : public views::View,
ash::SystemTrayDelegate* delegate =
ash::Shell::GetInstance()->tray_delegate();
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (delegate->GetWifiEnabled()) {
HoverHighlightView* container = new HoverHighlightView(this);
container->AddLabel(rb.GetLocalizedString(
HoverHighlightView* container = new HoverHighlightView(this);
container->AddLabel(rb.GetLocalizedString(
IDS_ASH_STATUS_TRAY_OTHER_WIFI), gfx::Font::NORMAL);
AddChildView(container);
other_wifi_ = container;
}
AddChildView(container);
other_wifi_ = container;
other_wifi_->SetEnabled(delegate->GetWifiEnabled());
if (delegate->GetCellularEnabled()) {
if (delegate->GetCellularAvailable()) {
if (delegate->GetCellularScanSupported()) {
HoverHighlightView* container = new HoverHighlightView(this);
container->AddLabel(rb.GetLocalizedString(
IDS_ASH_STATUS_TRAY_OTHER_MOBILE), gfx::Font::NORMAL);
AddChildView(container);
other_mobile_ = container;
other_mobile_->SetEnabled(delegate->GetCellularEnabled());
}
}
}
......
......@@ -111,6 +111,7 @@ void HoverHighlightView::AddLabel(const string16& text,
5, kTrayPopupDetailsIconWidth + kIconPaddingLeft, 5, 0));
label->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
label->SetFont(label->font().DeriveFont(0, style));
label->SetDisabledColor(SkColorSetARGB(127, 0, 0, 0));
AddChildView(label);
accessible_name_ = text;
......@@ -142,6 +143,11 @@ void HoverHighlightView::GetAccessibleState(ui::AccessibleViewState* state) {
state->name = accessible_name_;
}
void HoverHighlightView::OnEnabledChanged() {
for (int i = 0; i < child_count(); ++i)
child_at(i)->SetEnabled(enabled());
}
void HoverHighlightView::OnPaintBackground(gfx::Canvas* canvas) {
canvas->DrawColor(hover_ ? highlight_color_ : default_color_);
}
......
......@@ -98,6 +98,7 @@ class HoverHighlightView : public ActionableView {
virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE;
virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
virtual void OnEnabledChanged() OVERRIDE;
virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
ViewClickListener* listener_;
......
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