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

Side by Side Diff: chrome/browser/ui/webui/options/font_settings_handler.h

Issue 399603002: Replace usage of NOTIFICATION_EXTENSION_UNLOADED with ExtensionRegistryObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/font_settings_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/pref_member.h" 9 #include "base/prefs/pref_member.h"
10 #include "base/scoped_observer.h"
10 #include "chrome/browser/ui/webui/options/options_ui.h" 11 #include "chrome/browser/ui/webui/options/options_ui.h"
11 #include "content/public/browser/notification_observer.h" 12 #include "extensions/browser/extension_registry_observer.h"
12 #include "content/public/browser/notification_registrar.h"
13 13
14 namespace base { 14 namespace base {
15 class ListValue; 15 class ListValue;
16 } 16 }
17 17
18 namespace extensions { 18 namespace extensions {
19 class Extension; 19 class Extension;
20 class ExtensionRegistry;
20 } 21 }
21 22
22 namespace options { 23 namespace options {
23 24
24 // Font settings overlay page UI handler. 25 // Font settings overlay page UI handler.
25 class FontSettingsHandler : public OptionsPageUIHandler, 26 class FontSettingsHandler : public OptionsPageUIHandler,
26 public content::NotificationObserver { 27 public extensions::ExtensionRegistryObserver {
27 public: 28 public:
28 FontSettingsHandler(); 29 FontSettingsHandler();
29 virtual ~FontSettingsHandler(); 30 virtual ~FontSettingsHandler();
30 31
31 // OptionsPageUIHandler implementation. 32 // OptionsPageUIHandler implementation.
32 virtual void GetLocalizedValues( 33 virtual void GetLocalizedValues(
33 base::DictionaryValue* localized_strings) OVERRIDE; 34 base::DictionaryValue* localized_strings) OVERRIDE;
34 virtual void InitializeHandler() OVERRIDE; 35 virtual void InitializeHandler() OVERRIDE;
35 virtual void InitializePage() OVERRIDE; 36 virtual void InitializePage() OVERRIDE;
36 37
37 // WebUIMessageHandler implementation. 38 // WebUIMessageHandler implementation.
38 virtual void RegisterMessages() OVERRIDE; 39 virtual void RegisterMessages() OVERRIDE;
39 40
41 // ExtensionRegistryObserver implementation.
42 virtual void OnExtensionLoaded(
43 content::BrowserContext* browser_context,
44 const extensions::Extension* extension) OVERRIDE;
45 virtual void OnExtensionUnloaded(
46 content::BrowserContext* browser_context,
47 const extensions::Extension* extension,
48 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE;
49
40 private: 50 private:
41 // content::NotificationObserver implementation.
42 virtual void Observe(int type,
43 const content::NotificationSource& source,
44 const content::NotificationDetails& details) OVERRIDE;
45
46 void HandleFetchFontsData(const base::ListValue* args); 51 void HandleFetchFontsData(const base::ListValue* args);
47 52
48 void FontsListHasLoaded(scoped_ptr<base::ListValue> list); 53 void FontsListHasLoaded(scoped_ptr<base::ListValue> list);
49 54
50 void SetUpStandardFontSample(); 55 void SetUpStandardFontSample();
51 void SetUpSerifFontSample(); 56 void SetUpSerifFontSample();
52 void SetUpSansSerifFontSample(); 57 void SetUpSansSerifFontSample();
53 void SetUpFixedFontSample(); 58 void SetUpFixedFontSample();
54 void SetUpMinimumFontSample(); 59 void SetUpMinimumFontSample();
55 60
(...skipping 10 matching lines...) Expand all
66 71
67 StringPrefMember standard_font_; 72 StringPrefMember standard_font_;
68 StringPrefMember serif_font_; 73 StringPrefMember serif_font_;
69 StringPrefMember sans_serif_font_; 74 StringPrefMember sans_serif_font_;
70 StringPrefMember fixed_font_; 75 StringPrefMember fixed_font_;
71 StringPrefMember font_encoding_; 76 StringPrefMember font_encoding_;
72 IntegerPrefMember default_font_size_; 77 IntegerPrefMember default_font_size_;
73 IntegerPrefMember default_fixed_font_size_; 78 IntegerPrefMember default_fixed_font_size_;
74 IntegerPrefMember minimum_font_size_; 79 IntegerPrefMember minimum_font_size_;
75 80
76 content::NotificationRegistrar registrar_; 81 ScopedObserver<extensions::ExtensionRegistry,
82 extensions::ExtensionRegistryObserver>
83 extension_registry_observer_;
77 84
78 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler); 85 DISALLOW_COPY_AND_ASSIGN(FontSettingsHandler);
79 }; 86 };
80 87
81 } // namespace options 88 } // namespace options
82 89
83 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_ 90 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_FONT_SETTINGS_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/font_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698