diff options
14 files changed, 83 insertions, 150 deletions
diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc index a3ec651..42f93a0 100644 --- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc @@ -85,13 +85,14 @@ std::string MaybeGetLocalizedFontName(const std::string& font_name) { } // Registers |obs| to observe per-script font prefs under the path |map_name|. -void RegisterFontFamilyMapObserver(PrefChangeRegistrar* registrar, - const char* map_name, - PrefObserver* obs) { +void RegisterFontFamilyMapObserver( + PrefChangeRegistrar* registrar, + const char* map_name, + const PrefChangeRegistrar::NamedChangeCallback& callback) { for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) { const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i]; std::string pref_name = base::StringPrintf("%s.%s", map_name, script); - registrar->Add(pref_name.c_str(), obs); + registrar->Add(pref_name.c_str(), callback); } } @@ -111,20 +112,24 @@ FontSettingsEventRouter::FontSettingsEventRouter( kOnMinimumFontSizeChanged, kPixelSizeKey); + PrefChangeRegistrar::NamedChangeCallback callback = + base::Bind(&FontSettingsEventRouter::OnFontFamilyMapPrefChanged, + base::Unretained(this)); RegisterFontFamilyMapObserver(®istrar_, - prefs::kWebKitStandardFontFamilyMap, this); + prefs::kWebKitStandardFontFamilyMap, callback); RegisterFontFamilyMapObserver(®istrar_, - prefs::kWebKitSerifFontFamilyMap, this); + prefs::kWebKitSerifFontFamilyMap, callback); RegisterFontFamilyMapObserver(®istrar_, - prefs::kWebKitSansSerifFontFamilyMap, this); + prefs::kWebKitSansSerifFontFamilyMap, callback); RegisterFontFamilyMapObserver(®istrar_, - prefs::kWebKitFixedFontFamilyMap, this); + prefs::kWebKitFixedFontFamilyMap, callback); RegisterFontFamilyMapObserver(®istrar_, - prefs::kWebKitCursiveFontFamilyMap, this); + prefs::kWebKitCursiveFontFamilyMap, callback); RegisterFontFamilyMapObserver(®istrar_, - prefs::kWebKitFantasyFontFamilyMap, this); + prefs::kWebKitFantasyFontFamilyMap, callback); RegisterFontFamilyMapObserver(®istrar_, - prefs::kWebKitPictographFontFamilyMap, this); + prefs::kWebKitPictographFontFamilyMap, + callback); } FontSettingsEventRouter::~FontSettingsEventRouter() {} @@ -132,31 +137,19 @@ FontSettingsEventRouter::~FontSettingsEventRouter() {} void FontSettingsEventRouter::AddPrefToObserve(const char* pref_name, const char* event_name, const char* key) { - registrar_.Add(pref_name, this); - pref_event_map_[pref_name] = std::make_pair(event_name, key); + registrar_.Add(pref_name, + base::Bind(&FontSettingsEventRouter::OnFontPrefChanged, + base::Unretained(this), + event_name, key)); } -void FontSettingsEventRouter::OnPreferenceChanged( - PrefServiceBase* pref_service, +void FontSettingsEventRouter::OnFontFamilyMapPrefChanged( const std::string& pref_name) { - bool incognito = (pref_service != profile_->GetPrefs()); - // We're only observing pref changes on the regular profile. - DCHECK(!incognito); - - PrefEventMap::iterator iter = pref_event_map_.find(pref_name); - if (iter != pref_event_map_.end()) { - const std::string& event_name = iter->second.first; - const std::string& key = iter->second.second; - OnFontPrefChanged(pref_service, pref_name, event_name, key, incognito); - return; - } - std::string generic_family; std::string script; if (pref_names_util::ParseFontNamePrefPath(pref_name, &generic_family, &script)) { - OnFontNamePrefChanged(pref_service, pref_name, generic_family, script, - incognito); + OnFontNamePrefChanged(pref_name, generic_family, script); return; } @@ -164,12 +157,10 @@ void FontSettingsEventRouter::OnPreferenceChanged( } void FontSettingsEventRouter::OnFontNamePrefChanged( - PrefServiceBase* pref_service, const std::string& pref_name, const std::string& generic_family, - const std::string& script, - bool incognito) { - const PrefServiceBase::Preference* pref = pref_service->FindPreference( + const std::string& script) { + const PrefServiceBase::Preference* pref = registrar_.prefs()->FindPreference( pref_name.c_str()); CHECK(pref); @@ -192,17 +183,15 @@ void FontSettingsEventRouter::OnFontNamePrefChanged( kOnFontChanged, &args, APIPermission::kFontSettings, - incognito, + false, pref_name); } void FontSettingsEventRouter::OnFontPrefChanged( - PrefServiceBase* pref_service, - const std::string& pref_name, const std::string& event_name, const std::string& key, - bool incognito) { - const PrefServiceBase::Preference* pref = pref_service->FindPreference( + const std::string& pref_name) { + const PrefServiceBase::Preference* pref = registrar_.prefs()->FindPreference( pref_name.c_str()); CHECK(pref); @@ -216,7 +205,7 @@ void FontSettingsEventRouter::OnFontPrefChanged( event_name, &args, APIPermission::kFontSettings, - incognito, + false, pref_name); } diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.h b/chrome/browser/extensions/api/font_settings/font_settings_api.h index a81c7a9..8271aac 100644 --- a/chrome/browser/extensions/api/font_settings/font_settings_api.h +++ b/chrome/browser/extensions/api/font_settings/font_settings_api.h @@ -8,12 +8,9 @@ #ifndef CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H__ #define CHROME_BROWSER_EXTENSIONS_API_FONT_SETTINGS_FONT_SETTINGS_API_H__ -#include <map> #include <string> -#include <utility> #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/prefs/pref_service.h" @@ -21,7 +18,7 @@ namespace extensions { // This class observes pref changed events on a profile and dispatches the // corresponding extension API events to extensions. -class FontSettingsEventRouter : public PrefObserver { +class FontSettingsEventRouter { public: // Constructor for observing pref changed events on |profile|. Stores a // pointer to |profile| but does not take ownership. |profile| must be @@ -30,13 +27,6 @@ class FontSettingsEventRouter : public PrefObserver { virtual ~FontSettingsEventRouter(); private: - typedef std::pair<std::string, std::string> EventAndKeyPair; - // Map of pref name to a pair of event name and key (defined in the extension - // API) for dispatching a pref changed event. For example, - // "webkit.webprefs.default_font_size" to ("onDefaultFontSizedChanged", - // "pixelSize"). - typedef std::map<std::string, EventAndKeyPair> PrefEventMap; - // Observes browser pref |pref_name|. When a change is observed, dispatches // event |event_name| to extensions. A JavaScript object is passed to the // extension event function with the new value of the pref in property |key|. @@ -44,39 +34,28 @@ class FontSettingsEventRouter : public PrefObserver { const char* event_name, const char* key); - // PrefObserver implementation. - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; + // Decodes a preference change for a font family map and invokes + // OnFontNamePrefChange with the right parameters. + void OnFontFamilyMapPrefChanged(const std::string& pref_name); // Dispatches a changed event for the font setting for |generic_family| and // |script| to extensions. The new value of the setting is the value of - // browser pref |pref_name|. If the pref changed on the incognito profile, - // |incognito| must be set to true for extensions to get the appropriate - // event. - void OnFontNamePrefChanged(PrefServiceBase* pref_service, - const std::string& pref_name, + // browser pref |pref_name|. + void OnFontNamePrefChanged(const std::string& pref_name, const std::string& generic_family, - const std::string& script, - bool incognito); + const std::string& script); // Dispatches the setting changed event |event_name| to extensions. The new // value of the setting is the value of browser pref |pref_name|. This value // is passed in the JavaScript object argument to the extension event function - // under the key |key|. If the pref changed on the incognito profile, - // |incognito| must be set to true for extensions to get the appropriate - // event. - void OnFontPrefChanged(PrefServiceBase* pref_service, - const std::string& pref_name, - const std::string& event_name, + // under the key |key|. + void OnFontPrefChanged(const std::string& event_name, const std::string& key, - bool incognito); + const std::string& pref_name); // Manages pref observation registration. PrefChangeRegistrar registrar_; - // Maps browser pref names to extension API <event name, key> pairs. - PrefEventMap pref_event_map_; - // Weak, owns us (transitively via ExtensionService). Profile* profile_; diff --git a/chrome/browser/extensions/api/managed_mode/managed_mode_api.cc b/chrome/browser/extensions/api/managed_mode/managed_mode_api.cc index ce0f4b4..44e0263 100644 --- a/chrome/browser/extensions/api/managed_mode/managed_mode_api.cc +++ b/chrome/browser/extensions/api/managed_mode/managed_mode_api.cc @@ -42,17 +42,16 @@ namespace extensions { ExtensionManagedModeEventRouter::ExtensionManagedModeEventRouter( Profile* profile) : profile_(profile) { registrar_.Init(g_browser_process->local_state()); - registrar_.Add(prefs::kInManagedMode, this); + registrar_.Add( + prefs::kInManagedMode, + base::Bind(&ExtensionManagedModeEventRouter::OnInManagedModeChanged, + base::Unretained(this))); } ExtensionManagedModeEventRouter::~ExtensionManagedModeEventRouter() { } -void ExtensionManagedModeEventRouter::OnPreferenceChanged( - PrefServiceBase* service, - const std::string& pref_name) { - DCHECK_EQ(std::string(prefs::kInManagedMode), pref_name); - +void ExtensionManagedModeEventRouter::OnInManagedModeChanged() { DictionaryValue* dict = new DictionaryValue(); dict->SetBoolean( keys::kValue, diff --git a/chrome/browser/extensions/api/managed_mode/managed_mode_api.h b/chrome/browser/extensions/api/managed_mode/managed_mode_api.h index 7df8db7..d61dbb6 100644 --- a/chrome/browser/extensions/api/managed_mode/managed_mode_api.h +++ b/chrome/browser/extensions/api/managed_mode/managed_mode_api.h @@ -9,7 +9,6 @@ #define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "chrome/browser/extensions/extension_function.h" #include "content/public/browser/notification_observer.h" @@ -17,16 +16,14 @@ class Profile; namespace extensions { -class ExtensionManagedModeEventRouter : public PrefObserver { +class ExtensionManagedModeEventRouter { public: explicit ExtensionManagedModeEventRouter(Profile* profile); virtual ~ExtensionManagedModeEventRouter(); - // PrefObserver implementation: - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; - private: + void OnInManagedModeChanged(); + PrefChangeRegistrar registrar_; Profile* profile_; diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc index 46e6751..50d279e 100644 --- a/chrome/browser/extensions/api/preference/preference_api.cc +++ b/chrome/browser/extensions/api/preference/preference_api.cc @@ -246,18 +246,19 @@ PreferenceEventRouter::PreferenceEventRouter(Profile* profile) registrar_.Init(profile_->GetPrefs()); incognito_registrar_.Init(profile_->GetOffTheRecordPrefs()); for (size_t i = 0; i < arraysize(kPrefMapping); ++i) { - registrar_.Add(kPrefMapping[i].browser_pref, this); - incognito_registrar_.Add(kPrefMapping[i].browser_pref, this); + registrar_.Add(kPrefMapping[i].browser_pref, + base::Bind(&PreferenceEventRouter::OnPrefChanged, + base::Unretained(this), + registrar_.prefs())); + incognito_registrar_.Add(kPrefMapping[i].browser_pref, + base::Bind(&PreferenceEventRouter::OnPrefChanged, + base::Unretained(this), + incognito_registrar_.prefs())); } } PreferenceEventRouter::~PreferenceEventRouter() { } -void PreferenceEventRouter::OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) { - OnPrefChanged(service, pref_name); -} - void PreferenceEventRouter::OnPrefChanged(PrefServiceBase* pref_service, const std::string& browser_pref) { bool incognito = (pref_service != profile_->GetPrefs()); diff --git a/chrome/browser/extensions/api/preference/preference_api.h b/chrome/browser/extensions/api/preference/preference_api.h index c6e7f4b..b627b21 100644 --- a/chrome/browser/extensions/api/preference/preference_api.h +++ b/chrome/browser/extensions/api/preference/preference_api.h @@ -8,7 +8,6 @@ #include <string> #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "chrome/browser/extensions/extension_function.h" #include "content/public/browser/notification_observer.h" @@ -20,16 +19,12 @@ class Value; namespace extensions { -class PreferenceEventRouter : public PrefObserver { +class PreferenceEventRouter { public: explicit PreferenceEventRouter(Profile* profile); virtual ~PreferenceEventRouter(); private: - // PrefObserver implementation. - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; - void OnPrefChanged(PrefServiceBase* pref_service, const std::string& pref_key); diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc index dc99e22..82a2c28 100644 --- a/chrome/browser/extensions/component_loader.cc +++ b/chrome/browser/extensions/component_loader.cc @@ -77,7 +77,10 @@ ComponentLoader::ComponentLoader(ExtensionServiceInterface* extension_service, // This pref is set by policy. We have to watch it for change because on // ChromeOS, policy isn't loaded until after the browser process is started. - pref_change_registrar_.Add(prefs::kEnterpriseWebStoreURL, this); + pref_change_registrar_.Add( + prefs::kEnterpriseWebStoreURL, + base::Bind(&ComponentLoader::AddOrReloadEnterpriseWebStore, + base::Unretained(this))); } ComponentLoader::~ComponentLoader() { @@ -399,12 +402,6 @@ void ComponentLoader::AddDefaultComponentExtensions() { AddScriptBubble(); } -void ComponentLoader::OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) { - DCHECK_EQ(std::string(prefs::kEnterpriseWebStoreURL), pref_name); - AddOrReloadEnterpriseWebStore(); -} - // static void ComponentLoader::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterStringPref(prefs::kEnterpriseWebStoreURL, diff --git a/chrome/browser/extensions/component_loader.h b/chrome/browser/extensions/component_loader.h index beb2e6b..4904e1c 100644 --- a/chrome/browser/extensions/component_loader.h +++ b/chrome/browser/extensions/component_loader.h @@ -11,7 +11,6 @@ #include "base/file_path.h" #include "base/gtest_prod_util.h" #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "base/values.h" class ExtensionServiceInterface; @@ -22,7 +21,7 @@ namespace extensions { class Extension; // For registering, loading, and unloading component extensions. -class ComponentLoader : public PrefObserver { +class ComponentLoader { public: ComponentLoader(ExtensionServiceInterface* extension_service, PrefService* prefs, @@ -69,10 +68,6 @@ class ComponentLoader : public PrefObserver { // Adds the default component extensions. void AddDefaultComponentExtensions(); - // PrefObserver implementation - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; - static void RegisterUserPrefs(PrefService* prefs); // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index eb2812d..044a530 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -386,8 +386,11 @@ ExtensionService::ExtensionService(Profile* profile, registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, content::NotificationService::AllBrowserContextsAndSources()); pref_change_registrar_.Init(profile->GetPrefs()); - pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, this); - pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, this); + base::Closure callback = + base::Bind(&ExtensionService::OnExtensionInstallPrefChanged, + base::Unretained(this)); + pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, callback); + pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, callback); // Set up the ExtensionUpdater if (autoupdate_enabled) { @@ -2697,11 +2700,7 @@ void ExtensionService::Observe(int type, } } -void ExtensionService::OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) { - DCHECK(pref_name == prefs::kExtensionInstallAllowList || - pref_name == prefs::kExtensionInstallDenyList) - << "Unexpected preference name " << pref_name; +void ExtensionService::OnExtensionInstallPrefChanged() { IdentifyAlertableExtensions(); CheckManagementPolicy(); } diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index e2536b8..c27d7af9 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -17,7 +17,6 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "base/string16.h" #include "chrome/browser/extensions/app_shortcut_manager.h" #include "chrome/browser/extensions/app_sync_bundle.h" @@ -139,8 +138,7 @@ class ExtensionServiceInterface : public syncer::SyncableService { class ExtensionService : public ExtensionServiceInterface, public extensions::ExternalProviderInterface::VisitorInterface, - public content::NotificationObserver, - public PrefObserver { + public content::NotificationObserver { public: // The name of the directory inside the profile where extensions are // installed to. @@ -632,10 +630,6 @@ class ExtensionService const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // PrefObserver - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; - // Whether there are any apps installed. Component apps are not included. bool HasApps() const; @@ -705,6 +699,8 @@ class ExtensionService syncer::ModelType type) const; + void OnExtensionInstallPrefChanged(); + // Handles setting the extension specific values in |extension_sync_data| to // the current system. // Returns false if the changes were not completely applied and need to be diff --git a/chrome/browser/extensions/external_policy_loader.cc b/chrome/browser/extensions/external_policy_loader.cc index 79ddb8d..6df0304c 100644 --- a/chrome/browser/extensions/external_policy_loader.cc +++ b/chrome/browser/extensions/external_policy_loader.cc @@ -41,7 +41,9 @@ bool CheckExtension(const std::string& id, const std::string& update_url) { ExternalPolicyLoader::ExternalPolicyLoader(Profile* profile) : profile_(profile) { pref_change_registrar_.Init(profile_->GetPrefs()); - pref_change_registrar_.Add(prefs::kExtensionInstallForceList, this); + pref_change_registrar_.Add(prefs::kExtensionInstallForceList, + base::Bind(&ExternalPolicyLoader::StartLoading, + base::Unretained(this))); notification_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, content::Source<Profile>(profile_)); @@ -88,12 +90,4 @@ void ExternalPolicyLoader::Observe( } } -void ExternalPolicyLoader::OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) { - if (service == profile_->GetPrefs()) { - DCHECK_EQ(std::string(prefs::kExtensionInstallForceList), pref_name); - StartLoading(); - } -} - } // namespace extensions diff --git a/chrome/browser/extensions/external_policy_loader.h b/chrome/browser/extensions/external_policy_loader.h index 44f9f1b..bd0f5f5 100644 --- a/chrome/browser/extensions/external_policy_loader.h +++ b/chrome/browser/extensions/external_policy_loader.h @@ -9,7 +9,6 @@ #include "base/compiler_specific.h" #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" @@ -22,8 +21,7 @@ namespace extensions { // registered. class ExternalPolicyLoader : public ExternalLoader, - public content::NotificationObserver, - public PrefObserver { + public content::NotificationObserver { public: explicit ExternalPolicyLoader(Profile* profile); @@ -32,10 +30,6 @@ class ExternalPolicyLoader const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // PrefObserver implementation - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; - protected: virtual void StartLoading() OVERRIDE; diff --git a/chrome/browser/media_gallery/media_file_system_registry.cc b/chrome/browser/media_gallery/media_file_system_registry.cc index c97943d..10811764f 100644 --- a/chrome/browser/media_gallery/media_file_system_registry.cc +++ b/chrome/browser/media_gallery/media_file_system_registry.cc @@ -490,7 +490,12 @@ void MediaFileSystemRegistry::GetMediaFileSystemsForExtension( if (!ContainsKey(pref_change_registrar_map_, profile)) { PrefChangeRegistrar* pref_registrar = new PrefChangeRegistrar; pref_registrar->Init(profile->GetPrefs()); - pref_registrar->Add(prefs::kMediaGalleriesRememberedGalleries, this); + pref_registrar->Add( + prefs::kMediaGalleriesRememberedGalleries, + base::Bind(&MediaFileSystemRegistry:: + OnMediaGalleriesRememberedGalleriesChanged, + base::Unretained(this), + pref_registrar->prefs())); pref_change_registrar_map_[profile] = pref_registrar; } @@ -672,11 +677,8 @@ MediaFileSystemRegistry::~MediaFileSystemRegistry() { system_monitor->RemoveDevicesChangedObserver(this); } -void MediaFileSystemRegistry::OnPreferenceChanged( - PrefServiceBase* prefs, - const std::string& pref_name) { - DCHECK_EQ(std::string(prefs::kMediaGalleriesRememberedGalleries), pref_name); - +void MediaFileSystemRegistry::OnMediaGalleriesRememberedGalleriesChanged( + PrefServiceBase* prefs) { // Find the Profile that contains the source PrefService. PrefChangeRegistrarMap::iterator pref_change_it = pref_change_registrar_map_.begin(); diff --git a/chrome/browser/media_gallery/media_file_system_registry.h b/chrome/browser/media_gallery/media_file_system_registry.h index 1fc2ac1..674581a 100644 --- a/chrome/browser/media_gallery/media_file_system_registry.h +++ b/chrome/browser/media_gallery/media_file_system_registry.h @@ -19,7 +19,6 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "base/system_monitor/system_monitor.h" #include "webkit/fileapi/media/mtp_device_file_system_config.h" @@ -80,8 +79,7 @@ typedef base::Callback<void(const std::vector<MediaFileSystemInfo>&)> MediaFileSystemsCallback; class MediaFileSystemRegistry - : public base::SystemMonitor::DevicesChangedObserver, - public PrefObserver { + : public base::SystemMonitor::DevicesChangedObserver { public: // The instance is lazily created per browser process. static MediaFileSystemRegistry* GetInstance(); @@ -131,9 +129,7 @@ class MediaFileSystemRegistry MediaFileSystemRegistry(); virtual ~MediaFileSystemRegistry(); - // PrefObserver implementation. - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; + void OnMediaGalleriesRememberedGalleriesChanged(PrefServiceBase* service); #if defined(SUPPORT_MTP_DEVICE_FILESYSTEM) // Returns ScopedMTPDeviceMapEntry object for the given |device_location|. |