OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/status/network_menu_button.h" | 5 #include "chrome/browser/chromeos/status/network_menu_button.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 SetBadge(SkBitmap()); | 141 SetBadge(SkBitmap()); |
142 } | 142 } |
143 } else { | 143 } else { |
144 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); | 144 SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0)); |
145 SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_WARNING)); | 145 SetBadge(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_WARNING)); |
146 SetTooltipText(l10n_util::GetString( | 146 SetTooltipText(l10n_util::GetString( |
147 IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP)); | 147 IDS_STATUSBAR_NETWORK_NO_NETWORK_TOOLTIP)); |
148 } | 148 } |
149 | 149 |
150 SchedulePaint(); | 150 SchedulePaint(); |
| 151 UpdateMenu(); |
151 } | 152 } |
152 | 153 |
153 void NetworkMenuButton::SetBadge(const SkBitmap& badge) { | 154 void NetworkMenuButton::SetBadge(const SkBitmap& badge) { |
154 badge_ = badge; | 155 badge_ = badge; |
155 } | 156 } |
156 | 157 |
157 //////////////////////////////////////////////////////////////////////////////// | 158 //////////////////////////////////////////////////////////////////////////////// |
158 // NetworkMenuButton, NetworkMenu implementation: | 159 // NetworkMenuButton, NetworkMenu implementation: |
159 | 160 |
160 bool NetworkMenuButton::IsBrowserMode() const { | 161 bool NetworkMenuButton::IsBrowserMode() const { |
161 return host_->IsBrowserMode(); | 162 return host_->IsBrowserMode(); |
162 } | 163 } |
163 | 164 |
164 gfx::NativeWindow NetworkMenuButton::GetNativeWindow() const { | 165 gfx::NativeWindow NetworkMenuButton::GetNativeWindow() const { |
165 return host_->GetNativeWindow(); | 166 return host_->GetNativeWindow(); |
166 } | 167 } |
167 | 168 |
168 void NetworkMenuButton::OpenButtonOptions() const { | 169 void NetworkMenuButton::OpenButtonOptions() const { |
169 host_->OpenButtonOptions(this); | 170 host_->OpenButtonOptions(this); |
170 } | 171 } |
171 | 172 |
172 bool NetworkMenuButton::ShouldOpenButtonOptions() const { | 173 bool NetworkMenuButton::ShouldOpenButtonOptions() const { |
173 return host_->ShouldOpenButtonOptions(this); | 174 return host_->ShouldOpenButtonOptions(this); |
174 } | 175 } |
175 | 176 |
176 } // namespace chromeos | 177 } // namespace chromeos |
OLD | NEW |