Index: chrome/browser/ui/ash/palette_delegate_chromeos.h |
diff --git a/chrome/browser/ui/ash/palette_delegate_chromeos.h b/chrome/browser/ui/ash/palette_delegate_chromeos.h |
index 78cc1b718a5c071802e5eb1dd961f3f801c66205..f5b216a155f7b0a05843d495224646e9fbca720e 100644 |
--- a/chrome/browser/ui/ash/palette_delegate_chromeos.h |
+++ b/chrome/browser/ui/ash/palette_delegate_chromeos.h |
@@ -8,22 +8,36 @@ |
#include <string> |
#include "ash/common/palette_delegate.h" |
-#include "base/compiler_specific.h" |
+#include "ash/common/session/session_state_observer.h" |
+#include "base/callback_list.h" |
#include "base/macros.h" |
#include "base/values.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
#include "ui/events/devices/input_device_event_observer.h" |
+class PrefChangeRegistrar; |
+class Profile; |
+ |
+namespace ash { |
+class ScopedSessionStateObserver; |
+} |
+ |
namespace chromeos { |
// A class which allows the Ash palette to perform chrome actions. |
class PaletteDelegateChromeOS : public ash::PaletteDelegate, |
- public ui::InputDeviceEventObserver { |
+ public ui::InputDeviceEventObserver, |
+ public ash::SessionStateObserver, |
+ public content::NotificationObserver { |
public: |
PaletteDelegateChromeOS(); |
~PaletteDelegateChromeOS() override; |
private: |
// ash::PaletteDelegate: |
+ std::unique_ptr<EnableListenerSubscription> AddPaletteEnableListener( |
+ const EnableListener& on_state_changed) override; |
void CreateNote() override; |
bool HasNoteApp() override; |
void SetPartialMagnifierState(bool enabled) override; |
@@ -33,11 +47,31 @@ class PaletteDelegateChromeOS : public ash::PaletteDelegate, |
void TakeScreenshot() override; |
void TakePartialScreenshot() override; |
+ // ash::SessionStateObserver: |
+ void ActiveUserChanged(const AccountId& account_id) override; |
+ |
+ // content::NotificationObserver: |
+ void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) override; |
+ |
// ui::InputDeviceObserver: |
void OnStylusStateChanged(ui::StylusState state) override; |
+ // Called when the palette enabled pref has changed. |
+ void OnPaletteEnabledPrefChanged(); |
+ |
+ void SetProfile(Profile* profile); |
+ |
+ base::CallbackList<void(bool)> palette_enabled_callback_list_; |
OnStylusStateChangedCallback on_stylus_state_changed_; |
+ // Unowned pointer to the active profile. |
+ Profile* profile_ = nullptr; |
+ std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; |
+ std::unique_ptr<ash::ScopedSessionStateObserver> session_state_observer_; |
+ content::NotificationRegistrar registrar_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PaletteDelegateChromeOS); |
}; |