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

Side by Side Diff: ash/system/night_light/tray_night_light.cc

Issue 2857103007: [Night Light] CL2: Ash and system tray work (Closed)
Patch Set: Exclude one test from mash Created 3 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/system/night_light/tray_night_light.h"
6
7 #include "ash/resources/vector_icons/vector_icons.h"
8 #include "ash/shell.h"
9 #include "ui/views/view.h"
10
11 namespace ash {
12
13 TrayNightLight::TrayNightLight(SystemTray* system_tray)
14 : TrayImageItem(system_tray, kSystemTrayNightLightIcon, UMA_NIGHT_LIGHT) {
15 ash::Shell::Get()->night_light_controller()->AddObserver(this);
James Cook 2017/05/05 17:12:32 nit: no ash::
afakhry 2017/05/05 20:04:11 Done.
16 }
17
18 TrayNightLight::~TrayNightLight() {
19 ash::Shell::Get()->night_light_controller()->RemoveObserver(this);
20 }
21
22 void TrayNightLight::OnStatusChanged(bool new_status) {
23 if (tray_view())
24 tray_view()->SetVisible(new_status);
25 }
26
27 bool TrayNightLight::GetInitialVisibility() {
28 return ash::Shell::Get()->night_light_controller()->enabled();
29 }
James Cook 2017/05/05 17:12:32 optional: This class is very light weight, so I'm
afakhry 2017/05/05 20:04:11 Thanks for the pointers. I added a test. Please t
30
31 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698