Chromium Code Reviews| Index: chrome/browser/accessibility/accessibility_notifier.h |
| diff --git a/chrome/browser/accessibility/accessibility_notifier.h b/chrome/browser/accessibility/accessibility_notifier.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8ea25ef352cf091e6eebc2f2e35af4ff4683a849 |
| --- /dev/null |
| +++ b/chrome/browser/accessibility/accessibility_notifier.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_NOTIFIER_H_ |
| +#define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_NOTIFIER_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/prefs/pref_change_registrar.h" |
| +#include "components/keyed_service/core/keyed_service.h" |
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| + |
| +class Profile; |
| + |
| +// Observes a set of prefs in the login profile. If any of the prefs |
| +// related to Accessibility is updated, the status is reported to callback. |
| +class AccessibilityNotifier : public KeyedService { |
| + public: |
| + explicit AccessibilityNotifier(Profile* profile); |
| + ~AccessibilityNotifier() override; |
| + |
| + // KeyedService: |
| + void Shutdown() override; |
| + |
| + private: |
| + enum AnimationPolicy { |
|
Lei Zhang
2015/01/28 19:38:43
Can't you just reuse content::ImageAnimationPolicy
|
| + ANIMATION_POLICY_ALLOWED, |
| + ANIMATION_POLICY_ANIMATION_ONCE, |
| + ANIMATION_POLICY_NO_ANIMATION |
| + }; |
| + |
| + void UpdateAnimationPolicyFromPref(); |
| + void SetProfile(Profile*); |
|
Lei Zhang
2015/01/28 19:38:43
nit: we generally include the parameter name
|
| + |
| + // Profile which has the current a11y context. |
| + Profile* profile_; |
| + AnimationPolicy animation_policy_; |
| + content::NotificationRegistrar notification_registrar_; |
| + scoped_ptr<PrefChangeRegistrar> pref_change_registrar_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AccessibilityNotifier); |
| +}; |
| +#endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_NOTIFIER_H_ |