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

Side by Side Diff: ash/common/system/chromeos/bluetooth/tray_bluetooth.cc

Issue 2228183002: Updates to icons for Ash material design system tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const ref Created 4 years, 4 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
« no previous file with comments | « ash/common/system/cast/tray_cast.cc ('k') | ash/common/system/chromeos/network/tray_network.cc » ('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/common/system/chromeos/bluetooth/tray_bluetooth.h" 5 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h"
10 #include "ash/common/system/tray/hover_highlight_view.h" 10 #include "ash/common/system/tray/hover_highlight_view.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 } // namespace 67 } // namespace
68 68
69 class BluetoothDefaultView : public TrayItemMore { 69 class BluetoothDefaultView : public TrayItemMore {
70 public: 70 public:
71 BluetoothDefaultView(SystemTrayItem* owner, bool show_more) 71 BluetoothDefaultView(SystemTrayItem* owner, bool show_more)
72 : TrayItemMore(owner, show_more) { 72 : TrayItemMore(owner, show_more) {
73 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) { 73 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) {
74 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); 74 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
75 SetImage( 75 SetImage(
76 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_BLUETOOTH).ToImageSkia()); 76 *bundle.GetImageNamed(IDR_AURA_UBER_TRAY_BLUETOOTH).ToImageSkia());
77 } 77 }
78 Update(); 78 Update();
79 } 79 }
80 80
81 ~BluetoothDefaultView() override {} 81 ~BluetoothDefaultView() override {}
82 82
83 void Update() { 83 void Update() {
84 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); 84 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate();
85 const bool enabled = delegate->GetBluetoothEnabled(); 85 const bool enabled = delegate->GetBluetoothEnabled();
86 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { 86 if (MaterialDesignController::IsSystemTrayMenuMaterial()) {
87 gfx::VectorIconId icon_id = 87 gfx::VectorIconId icon_id =
88 enabled ? gfx::VectorIconId::SYSTEM_MENU_BLUETOOTH 88 enabled ? gfx::VectorIconId::SYSTEM_MENU_BLUETOOTH
89 : gfx::VectorIconId::SYSTEM_MENU_BLUETOOTH_DISABLED; 89 : gfx::VectorIconId::SYSTEM_MENU_BLUETOOTH_DISABLED;
90 gfx::ImageSkia image = gfx::CreateVectorIcon(icon_id, kMenuIconColor); 90 SetImage(gfx::CreateVectorIcon(icon_id, kMenuIconColor));
91 SetImage(&image);
92 } 91 }
93 92
94 if (delegate->GetBluetoothAvailable()) { 93 if (delegate->GetBluetoothAvailable()) {
95 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 94 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
96 const base::string16 label = rb.GetLocalizedString( 95 const base::string16 label = rb.GetLocalizedString(
97 enabled ? IDS_ASH_STATUS_TRAY_BLUETOOTH_ENABLED 96 enabled ? IDS_ASH_STATUS_TRAY_BLUETOOTH_ENABLED
98 : IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED); 97 : IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED);
99 SetLabel(label); 98 SetLabel(label);
100 SetAccessibleName(label); 99 SetAccessibleName(label);
101 SetVisible(true); 100 SetVisible(true);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 detailed_->Update(); 458 detailed_->Update();
460 } 459 }
461 460
462 void TrayBluetooth::OnBluetoothDiscoveringChanged() { 461 void TrayBluetooth::OnBluetoothDiscoveringChanged() {
463 if (!detailed_) 462 if (!detailed_)
464 return; 463 return;
465 detailed_->Update(); 464 detailed_->Update();
466 } 465 }
467 466
468 } // namespace ash 467 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/cast/tray_cast.cc ('k') | ash/common/system/chromeos/network/tray_network.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698