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

Side by Side Diff: ash/system/lock_screen_action/lock_screen_action_tray.h

Issue 2956383002: Fixup icon for new lock screen note action item (Closed)
Patch Set: . Created 3 years, 5 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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 #ifndef ASH_SYSTEM_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_TRAY_H_ 5 #ifndef ASH_SYSTEM_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_TRAY_H_
6 #define ASH_SYSTEM_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_TRAY_H_ 6 #define ASH_SYSTEM_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_TRAY_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/public/interfaces/tray_action.mojom.h" 9 #include "ash/public/interfaces/tray_action.mojom.h"
10 #include "ash/session/session_observer.h" 10 #include "ash/session/session_observer.h"
11 #include "ash/system/tray/tray_background_view.h" 11 #include "ash/system/tray/tray_background_view.h"
12 #include "ash/tray_action/tray_action_observer.h" 12 #include "ash/tray_action/tray_action_observer.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/scoped_observer.h" 14 #include "base/scoped_observer.h"
15 15
16 namespace gfx { 16 namespace gfx {
17 class ImageSkia; 17 class ImageSkia;
18 } 18 }
19 19
20 namespace views {
21 class ImageView;
22 }
23
20 namespace ash { 24 namespace ash {
21 25
22 class SessionController; 26 class SessionController;
23 class TrayAction; 27 class TrayAction;
24 28
25 // Tray item for surfacing entry point on lock screen UI for handling actions 29 // Tray item for surfacing entry point on lock screen UI for handling actions
26 // available through mojom::TrayAction interface. The item is 30 // available through mojom::TrayAction interface. The item is
27 // shown as a system tray status area icon. Its visibility is determined by: 31 // shown as a system tray status area icon. Its visibility is determined by:
28 // * session state - the item is shown only when the session is locked 32 // * session state - the item is shown only when the session is locked
29 // * tray action state - the item is shown only when the action is available 33 // * tray action state - the item is shown only when the action is available
(...skipping 20 matching lines...) Expand all
50 54
51 // SessionObserver: 55 // SessionObserver:
52 void OnLockStateChanged(bool locked) override; 56 void OnLockStateChanged(bool locked) override;
53 57
54 // TrayActionObserver: 58 // TrayActionObserver:
55 void OnLockScreenNoteStateChanged(mojom::TrayActionState state) override; 59 void OnLockScreenNoteStateChanged(mojom::TrayActionState state) override;
56 60
57 const gfx::ImageSkia& GetImageForTesting() const; 61 const gfx::ImageSkia& GetImageForTesting() const;
58 62
59 private: 63 private:
60 class NewNoteActionView;
61
62 // Whether the tray item should be visible in its current state. 64 // Whether the tray item should be visible in its current state.
63 bool IsStateVisible() const; 65 bool IsStateVisible() const;
64 66
65 // Updates the icon displayed in the tray for the note creation action. 67 // Updates the icon displayed in the tray for the note creation action.
66 void UpdateNewNoteIcon(); 68 void UpdateNewNoteIcon();
67 69
68 // The view for the tray item - it's a wrapper around a ImageView. 70 // The view for the tray item - it's a wrapper around a ImageView.
69 NewNoteActionView* new_note_action_view_; 71 views::ImageView* new_note_action_view_;
70 72
71 mojom::TrayActionState new_note_state_ = 73 mojom::TrayActionState new_note_state_ =
72 mojom::TrayActionState::kNotAvailable; 74 mojom::TrayActionState::kNotAvailable;
73 75
74 ScopedObserver<SessionController, SessionObserver> session_observer_; 76 ScopedObserver<SessionController, SessionObserver> session_observer_;
75 ScopedObserver<TrayAction, TrayActionObserver> tray_action_observer_; 77 ScopedObserver<TrayAction, TrayActionObserver> tray_action_observer_;
76 78
77 DISALLOW_COPY_AND_ASSIGN(LockScreenActionTray); 79 DISALLOW_COPY_AND_ASSIGN(LockScreenActionTray);
78 }; 80 };
79 81
80 } // namespace ash 82 } // namespace ash
81 83
82 #endif // ASH_SYSTEM_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_TRAY_H_ 84 #endif // ASH_SYSTEM_LOCK_SCREEN_ACTION_LOCK_SCREEN_ACTION_TRAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698