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

Unified Diff: chrome/browser/ui/ash/palette_delegate_chromeos.h

Issue 2258553004: Add pref to enable/disable palette tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Initial upload 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 side-by-side diff with in-line comments
Download patch
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 5d314f8ef174a154a7d547c46f417d6e5993ffd8..ebb8c1be9138077b5087b365274bacdf74b8669c 100644
--- a/chrome/browser/ui/ash/palette_delegate_chromeos.h
+++ b/chrome/browser/ui/ash/palette_delegate_chromeos.h
@@ -8,19 +8,55 @@
#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"
+
+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 {
+class PaletteDelegateChromeOS : public ash::PaletteDelegate,
+ public ash::SessionStateObserver,
+ public content::NotificationObserver {
public:
PaletteDelegateChromeOS();
~PaletteDelegateChromeOS() override;
private:
+ // ash::PaletteDelegate:
+ std::unique_ptr<EnableListenerSubscription> AddPaletteEnableListener(
+ const EnableListener& on_state_changed) 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;
+
+ // Called when the palette enabled pref has changed.
+ void OnPaletteEnabledPrefChanged();
+
+ void SetProfile(Profile* profile);
+
+ base::CallbackList<void(bool)> callback_list_;
+
+ // 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);
};

Powered by Google App Engine
This is Rietveld 408576698