diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 20:43:48 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 20:43:48 +0000 |
commit | 21855c7092344a1652e7bddeb2a114994f20e6b7 (patch) | |
tree | a50000c52e4796792dfa7bf7ebd3831897958e1d /ash | |
parent | fe60c198e543f1d140dbab1f711e48d54a451493 (diff) | |
download | chromium_src-21855c7092344a1652e7bddeb2a114994f20e6b7.zip chromium_src-21855c7092344a1652e7bddeb2a114994f20e6b7.tar.gz chromium_src-21855c7092344a1652e7bddeb2a114994f20e6b7.tar.bz2 |
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
Diffstat (limited to 'ash')
-rw-r--r-- | ash/system/network/tray_network.cc | 14 | ||||
-rw-r--r-- | ash/system/tray/tray_views.cc | 6 | ||||
-rw-r--r-- | ash/system/tray/tray_views.h | 1 |
3 files changed, 14 insertions, 7 deletions
diff --git a/ash/system/network/tray_network.cc b/ash/system/network/tray_network.cc index 9fa70e6..335337f 100644 --- a/ash/system/network/tray_network.cc +++ b/ash/system/network/tray_network.cc @@ -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()); } } } diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc index d5a4571..cd03209 100644 --- a/ash/system/tray/tray_views.cc +++ b/ash/system/tray/tray_views.cc @@ -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_); } diff --git a/ash/system/tray/tray_views.h b/ash/system/tray/tray_views.h index 8757f3b..5105c09 100644 --- a/ash/system/tray/tray_views.h +++ b/ash/system/tray/tray_views.h @@ -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_; |