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

Side by Side Diff: chrome/browser/accessibility/accessibility_notifier.h

Issue 785723002: Add new extension APIs related to animation policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AccessibilityNotifier Created 5 years, 11 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_NOTIFIER_H_
6 #define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_NOTIFIER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/prefs/pref_change_registrar.h"
13 #include "components/keyed_service/core/keyed_service.h"
14 #include "content/public/browser/notification_observer.h"
15 #include "content/public/browser/notification_registrar.h"
16
17 class Profile;
18
19 // Observes a set of prefs in the login profile. If any of the prefs
20 // related to Accessibility is updated, the status is reported to callback.
21 class AccessibilityNotifier : public KeyedService {
22 public:
23 explicit AccessibilityNotifier(Profile* profile);
24 ~AccessibilityNotifier() override;
25
26 // KeyedService:
27 void Shutdown() override;
28
29 private:
30 enum AnimationPolicy {
31 ANIMATION_POLICY_ALLOWED,
32 ANIMATION_POLICY_ANIMATION_ONCE,
33 ANIMATION_POLICY_NO_ANIMATION
34 };
35
36 void UpdateAnimationPolicyFromPref();
37 void SetProfile(Profile*);
38
39 // Profile which has the current a11y context.
40 Profile* profile_;
41 AnimationPolicy animation_policy_;
42 content::NotificationRegistrar notification_registrar_;
43 scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
44
45 DISALLOW_COPY_AND_ASSIGN(AccessibilityNotifier);
46 };
47 #endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_NOTIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698