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

Side by Side Diff: ash/common/system/chromeos/palette/palette_tray.h

Issue 2258553004: Add pref to enable/disable palette tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Rebase Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_
6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ash/common/palette_delegate.h"
12 #include "ash/common/session/session_state_observer.h" 13 #include "ash/common/session/session_state_observer.h"
13 #include "ash/common/shell_observer.h" 14 #include "ash/common/shell_observer.h"
14 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" 15 #include "ash/common/system/chromeos/palette/palette_tool_manager.h"
15 #include "ash/common/system/tray/tray_background_view.h" 16 #include "ash/common/system/tray/tray_background_view.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
18 #include "ui/events/devices/input_device_manager.h"
19 19
20 namespace views { 20 namespace views {
21 class ImageView; 21 class ImageView;
22 class Widget; 22 class Widget;
23 } 23 }
24 24
25 namespace ash { 25 namespace ash {
26 26
27 class TrayBubbleWrapper; 27 class TrayBubbleWrapper;
28 class PaletteToolManager; 28 class PaletteToolManager;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 // Updates the tray icon from the palette tool manager. 84 // Updates the tray icon from the palette tool manager.
85 void UpdateTrayIcon(); 85 void UpdateTrayIcon();
86 86
87 // Sets the icon to visible if the palette can be used. 87 // Sets the icon to visible if the palette can be used.
88 void UpdateIconVisibility(); 88 void UpdateIconVisibility();
89 89
90 // Called when a stylus inserted or removed event is received. 90 // Called when a stylus inserted or removed event is received.
91 void OnStylusStateChanged(ui::StylusState stylus_state); 91 void OnStylusStateChanged(ui::StylusState stylus_state);
92 92
93 // Called when the palette enabled pref has changed.
94 void OnPaletteEnabledPrefChanged(bool enabled);
95
93 bool OpenBubble(); 96 bool OpenBubble();
94 void AddToolsToView(views::View* host); 97 void AddToolsToView(views::View* host);
95 98
96 std::unique_ptr<PaletteToolManager> palette_tool_manager_; 99 std::unique_ptr<PaletteToolManager> palette_tool_manager_;
97 std::unique_ptr<TrayBubbleWrapper> bubble_; 100 std::unique_ptr<TrayBubbleWrapper> bubble_;
98 101
102 // Manages the callback OnPaletteEnabledPrefChanged callback registered to
103 // the PaletteDelegate instance.
104 std::unique_ptr<PaletteDelegate::EnableListenerSubscription>
105 palette_enabled_subscription_;
106
99 // Weak pointer, will be parented by TrayContainer for its lifetime. 107 // Weak pointer, will be parented by TrayContainer for its lifetime.
100 views::ImageView* icon_; 108 views::ImageView* icon_;
101 109
102 base::WeakPtrFactory<PaletteTray> weak_factory_; 110 base::WeakPtrFactory<PaletteTray> weak_factory_;
103 111
104 DISALLOW_COPY_AND_ASSIGN(PaletteTray); 112 DISALLOW_COPY_AND_ASSIGN(PaletteTray);
105 }; 113 };
106 114
107 } // namespace ash 115 } // namespace ash
108 116
109 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_ 117 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_BUTTON_TRAY_H_
OLDNEW
« no previous file with comments | « ash/common/session/session_state_observer.cc ('k') | ash/common/system/chromeos/palette/palette_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698