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

Side by Side Diff: ash/system/network/tray_network.cc

Issue 10079006: ash: Disable some entries in the network tray-popup instead of removing them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/system/tray/tray_views.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/system/network/tray_network.h" 5 #include "ash/system/network/tray_network.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/system/tray/system_tray.h" 9 #include "ash/system/tray/system_tray.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 scroller->GetScrollBarWidth(), 269 scroller->GetScrollBarWidth(),
270 kNetworkListHeight)); 270 kNetworkListHeight));
271 scroller->SetContentsView(networks); 271 scroller->SetContentsView(networks);
272 AddChildView(scroller); 272 AddChildView(scroller);
273 } 273 }
274 274
275 void AppendNetworkExtra() { 275 void AppendNetworkExtra() {
276 ash::SystemTrayDelegate* delegate = 276 ash::SystemTrayDelegate* delegate =
277 ash::Shell::GetInstance()->tray_delegate(); 277 ash::Shell::GetInstance()->tray_delegate();
278 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 278 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
279 if (delegate->GetWifiEnabled()) { 279 HoverHighlightView* container = new HoverHighlightView(this);
280 HoverHighlightView* container = new HoverHighlightView(this); 280 container->AddLabel(rb.GetLocalizedString(
281 container->AddLabel(rb.GetLocalizedString(
282 IDS_ASH_STATUS_TRAY_OTHER_WIFI), gfx::Font::NORMAL); 281 IDS_ASH_STATUS_TRAY_OTHER_WIFI), gfx::Font::NORMAL);
283 AddChildView(container); 282 AddChildView(container);
284 other_wifi_ = container; 283 other_wifi_ = container;
285 } 284 other_wifi_->SetEnabled(delegate->GetWifiEnabled());
286 285
287 if (delegate->GetCellularEnabled()) { 286 if (delegate->GetCellularAvailable()) {
288 if (delegate->GetCellularScanSupported()) { 287 if (delegate->GetCellularScanSupported()) {
289 HoverHighlightView* container = new HoverHighlightView(this); 288 HoverHighlightView* container = new HoverHighlightView(this);
290 container->AddLabel(rb.GetLocalizedString( 289 container->AddLabel(rb.GetLocalizedString(
291 IDS_ASH_STATUS_TRAY_OTHER_MOBILE), gfx::Font::NORMAL); 290 IDS_ASH_STATUS_TRAY_OTHER_MOBILE), gfx::Font::NORMAL);
292 AddChildView(container); 291 AddChildView(container);
293 other_mobile_ = container; 292 other_mobile_ = container;
293 other_mobile_->SetEnabled(delegate->GetCellularEnabled());
294 } 294 }
295 } 295 }
296 } 296 }
297 297
298 void AppendNetworkToggles() { 298 void AppendNetworkToggles() {
299 ash::SystemTrayDelegate* delegate = 299 ash::SystemTrayDelegate* delegate =
300 ash::Shell::GetInstance()->tray_delegate(); 300 ash::Shell::GetInstance()->tray_delegate();
301 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 301 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
302 if (delegate->GetWifiAvailable()) { 302 if (delegate->GetWifiAvailable()) {
303 HoverHighlightView* container = new HoverHighlightView(this); 303 HoverHighlightView* container = new HoverHighlightView(this);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 if (tray_.get()) 506 if (tray_.get())
507 tray_->Update(info); 507 tray_->Update(info);
508 if (default_.get()) 508 if (default_.get())
509 default_->Update(); 509 default_->Update();
510 if (detailed_.get()) 510 if (detailed_.get())
511 detailed_->Update(); 511 detailed_->Update();
512 } 512 }
513 513
514 } // namespace internal 514 } // namespace internal
515 } // namespace ash 515 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/tray_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698