diff options
author | akuegel@chromium.org <akuegel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 19:33:25 +0000 |
---|---|---|
committer | akuegel@chromium.org <akuegel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 19:33:25 +0000 |
commit | 5c8ef348c315f552f41cb69c014ffca8eeb61738 (patch) | |
tree | 6f954c12af32d659f54500dcc9926a9bd51a245c | |
parent | f7b5603437ab534806c3f9d72cc51be9760d1e70 (diff) | |
download | chromium_src-5c8ef348c315f552f41cb69c014ffca8eeb61738.zip chromium_src-5c8ef348c315f552f41cb69c014ffca8eeb61738.tar.gz chromium_src-5c8ef348c315f552f41cb69c014ffca8eeb61738.tar.bz2 |
Add observers for managed user list data changes.
Update the list of supervised users in the import overlay
when the avatar of a supervised user is changed, or a new supervised user is created.
BUG=339060
TBR=bauerb@chromium.org
Review URL: https://codereview.chromium.org/140663014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251393 0039d316-1c4b-4281-b951-d872f2087c98
20 files changed, 154 insertions, 35 deletions
diff --git a/chrome/browser/managed_mode/managed_user_registration_utility.cc b/chrome/browser/managed_mode/managed_user_registration_utility.cc index 34b02f8..82a51cc 100644 --- a/chrome/browser/managed_mode/managed_user_registration_utility.cc +++ b/chrome/browser/managed_mode/managed_user_registration_utility.cc @@ -64,6 +64,7 @@ class ManagedUserRegistrationUtilityImpl virtual void OnManagedUserAcknowledged(const std::string& managed_user_id) OVERRIDE; virtual void OnManagedUsersSyncingStopped() OVERRIDE; + virtual void OnManagedUsersChanged() OVERRIDE; private: // Fetches the managed user token when we have the device name. @@ -270,6 +271,8 @@ void ManagedUserRegistrationUtilityImpl::OnManagedUsersSyncingStopped() { GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED)); } +void ManagedUserRegistrationUtilityImpl::OnManagedUsersChanged() {} + void ManagedUserRegistrationUtilityImpl::FetchToken( const std::string& client_name) { token_fetcher_->Start( diff --git a/chrome/browser/managed_mode/managed_user_sync_service.cc b/chrome/browser/managed_mode/managed_user_sync_service.cc index a1f0f2f..18569c2 100644 --- a/chrome/browser/managed_mode/managed_user_sync_service.cc +++ b/chrome/browser/managed_mode/managed_user_sync_service.cc @@ -426,6 +426,8 @@ SyncError ManagedUserSyncService::ProcessSyncChanges( value->SetString(kChromeAvatar, managed_user.chrome_avatar()); value->SetString(kChromeOsAvatar, managed_user.chromeos_avatar()); dict->SetWithoutPathExpansion(managed_user.id(), value); + + NotifyManagedUsersChanged(); break; } case SyncChange::ACTION_DELETE: { @@ -461,6 +463,12 @@ void ManagedUserSyncService::NotifyManagedUsersSyncingStopped() { OnManagedUsersSyncingStopped()); } +void ManagedUserSyncService::NotifyManagedUsersChanged() { + FOR_EACH_OBSERVER(ManagedUserSyncServiceObserver, + observers_, + OnManagedUsersChanged()); +} + void ManagedUserSyncService::DispatchCallbacks() { const base::DictionaryValue* managed_users = prefs_->GetDictionary(prefs::kManagedUsers); diff --git a/chrome/browser/managed_mode/managed_user_sync_service.h b/chrome/browser/managed_mode/managed_user_sync_service.h index 5bd5a7d..91689f4 100644 --- a/chrome/browser/managed_mode/managed_user_sync_service.h +++ b/chrome/browser/managed_mode/managed_user_sync_service.h @@ -119,6 +119,7 @@ class ManagedUserSyncService : public BrowserContextKeyedService, void NotifyManagedUserAcknowledged(const std::string& managed_user_id); void NotifyManagedUsersSyncingStopped(); + void NotifyManagedUsersChanged(); void DispatchCallbacks(); diff --git a/chrome/browser/managed_mode/managed_user_sync_service_observer.h b/chrome/browser/managed_mode/managed_user_sync_service_observer.h index 621d841..a70cfec 100644 --- a/chrome/browser/managed_mode/managed_user_sync_service_observer.h +++ b/chrome/browser/managed_mode/managed_user_sync_service_observer.h @@ -14,6 +14,8 @@ class ManagedUserSyncServiceObserver { virtual void OnManagedUsersSyncingStopped() = 0; + virtual void OnManagedUsersChanged() = 0; + protected: virtual ~ManagedUserSyncServiceObserver() {} }; diff --git a/chrome/browser/resources/options/managed_user_import.js b/chrome/browser/resources/options/managed_user_import.js index 157910b..e766d64 100644 --- a/chrome/browser/resources/options/managed_user_import.js +++ b/chrome/browser/resources/options/managed_user_import.js @@ -76,6 +76,7 @@ cr.define('options', function() { didShowPage: function() { options.ManagedUserListData.requestExistingManagedUsers().then( this.receiveExistingManagedUsers_, this.onSigninError_.bind(this)); + options.ManagedUserListData.addObserver(this); this.updateImportInProgress_(false); $('managed-user-import-error-bubble').hidden = true; @@ -92,6 +93,13 @@ cr.define('options', function() { }, /** + * @override + */ + didClosePage: function() { + options.ManagedUserListData.removeObserver(this); + }, + + /** * Called when the user clicks the "OK" button. In case the managed * user being imported has no avatar in sync, it shows the avatar * icon grid. In case the avatar grid is visible or the managed user diff --git a/chrome/browser/resources/options/managed_user_list_data.js b/chrome/browser/resources/options/managed_user_list_data.js index 5f520a1..91619ed 100644 --- a/chrome/browser/resources/options/managed_user_list_data.js +++ b/chrome/browser/resources/options/managed_user_list_data.js @@ -12,7 +12,9 @@ cr.define('options', function() { * @constructor * @class */ - function ManagedUserListData() {}; + function ManagedUserListData() { + this.observers_ = []; + }; cr.addSingletonGetter(ManagedUserListData); @@ -31,7 +33,10 @@ cr.define('options', function() { */ ManagedUserListData.prototype.receiveExistingManagedUsers_ = function( managedUsers) { - assert(this.promise_); + if (!this.promise_) { + this.onDataChanged_(managedUsers); + return; + } this.resolve_(managedUsers); }; @@ -86,10 +91,51 @@ cr.define('options', function() { this.promise_ = null; }; + /** + * Initializes |promise| with the new data and also passes the new data to + * observers. + * @param {Array.<Object>} managedUsers An array of managed user objects. + * For the format of the objects, see receiveExistingManagedUsers_(). + * @private + */ + ManagedUserListData.prototype.onDataChanged_ = function(managedUsers) { + this.promise_ = this.createPromise_(); + this.resolve_(managedUsers); + for (var i = 0; i < this.observers_.length; ++i) + this.observers_[i].receiveExistingManagedUsers_(managedUsers); + }; + + /** + * Adds an observer to the list of observers. + * @param {Object} observer The observer to be added. + * @private + */ + ManagedUserListData.prototype.addObserver_ = function(observer) { + for (var i = 0; i < this.observers_.length; ++i) + assert(this.observers_[i] != observer); + this.observers_.push(observer); + }; + + /** + * Removes an observer from the list of observers. + * @param {Object} observer The observer to be removed. + * @private + */ + ManagedUserListData.prototype.removeObserver_ = function(observer) { + for (var i = 0; i < this.observers_.length; ++i) { + if (this.observers_[i] == observer) { + this.observers_.splice(i, 1); + return; + } + } + }; + // Forward public APIs to private implementations. [ + 'addObserver', 'onSigninError', 'receiveExistingManagedUsers', + 'removeObserver', 'requestExistingManagedUsers', 'resetPromise', ].forEach(function(name) { diff --git a/chrome/browser/ui/webui/options/browser_options_handler.h b/chrome/browser/ui/webui/options/browser_options_handler.h index c456c17..a503fc7 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.h +++ b/chrome/browser/ui/webui/options/browser_options_handler.h @@ -20,6 +20,7 @@ #include "chrome/browser/sync/profile_sync_service_observer.h" #include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/webui/options/options_ui.h" +#include "content/public/browser/notification_observer.h" #include "google_apis/gaia/google_service_auth_error.h" #include "ui/base/models/table_model_observer.h" #include "ui/shell_dialogs/select_file_dialog.h" @@ -52,7 +53,8 @@ class BrowserOptionsHandler #if defined(OS_CHROMEOS) public chromeos::system::PointerDeviceObserver::Observer, #endif - public TemplateURLServiceObserver { + public TemplateURLServiceObserver, + public content::NotificationObserver { public: BrowserOptionsHandler(); virtual ~BrowserOptionsHandler(); diff --git a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc index b8f46fd..334fd1b 100644 --- a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc @@ -404,7 +404,6 @@ void ChangePictureOptionsHandler::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - OptionsPageUIHandler::Observe(type, source, details); if (type == chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED) { // User profile image has been updated. SendProfileImage(*content::Details<const gfx::ImageSkia>(details).ptr(), diff --git a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.h b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.h index 890d0b1..f653b71 100644 --- a/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.h +++ b/chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.h @@ -8,6 +8,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/image_decoder.h" #include "chrome/browser/ui/webui/options/options_ui.h" +#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/native_widget_types.h" @@ -27,6 +28,7 @@ namespace options { // ChromeOS user image options page UI handler. class ChangePictureOptionsHandler : public ::options::OptionsPageUIHandler, public ui::SelectFileDialog::Listener, + public content::NotificationObserver, public ImageDecoder::Delegate { public: ChangePictureOptionsHandler(); diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc index c434f4b..80f2192 100644 --- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc @@ -1354,7 +1354,6 @@ void InternetOptionsHandler::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - OptionsPageUIHandler::Observe(type, source, details); if (type == chrome::NOTIFICATION_REQUIRE_PIN_SETTING_CHANGE_ENDED) { base::FundamentalValue require_pin(*content::Details<bool>(details).ptr()); web_ui()->CallJavascriptFunction( diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h index 563778b..7b44e49 100644 --- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h +++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.h @@ -12,6 +12,7 @@ #include "chrome/browser/ui/webui/options/options_ui.h" #include "chromeos/login/login_state.h" #include "chromeos/network/network_state_handler_observer.h" +#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "ui/gfx/native_widget_types.h" @@ -38,7 +39,8 @@ namespace options { class InternetOptionsHandler : public ::options::OptionsPageUIHandler, public chromeos::NetworkStateHandlerObserver, - public chromeos::LoginState::Observer { + public chromeos::LoginState::Observer, + public content::NotificationObserver { public: InternetOptionsHandler(); virtual ~InternetOptionsHandler(); @@ -100,7 +102,7 @@ class InternetOptionsHandler // Updates the logged in user type. void UpdateLoggedInUserType(); - // content::NotificationObserver (from OptionsPageUIHandler) + // content::NotificationObserver virtual void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 76b0d4e..7850af2 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -545,9 +545,6 @@ void ContentSettingsHandler::Observe( UpdateHandlersEnabledRadios(); break; } - - default: - OptionsPageUIHandler::Observe(type, source, details); } } diff --git a/chrome/browser/ui/webui/options/content_settings_handler.h b/chrome/browser/ui/webui/options/content_settings_handler.h index b6ddfaf..b5453de 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.h +++ b/chrome/browser/ui/webui/options/content_settings_handler.h @@ -23,6 +23,7 @@ class ProtocolHandlerRegistry; namespace options { class ContentSettingsHandler : public OptionsPageUIHandler, + public content::NotificationObserver, public PepperFlashSettingsManager::Client { public: ContentSettingsHandler(); diff --git a/chrome/browser/ui/webui/options/font_settings_handler.h b/chrome/browser/ui/webui/options/font_settings_handler.h index 276c8a4..3a9c8d8 100644 --- a/chrome/browser/ui/webui/options/font_settings_handler.h +++ b/chrome/browser/ui/webui/options/font_settings_handler.h @@ -8,6 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/prefs/pref_member.h" #include "chrome/browser/ui/webui/options/options_ui.h" +#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" namespace base { @@ -21,7 +22,8 @@ class Extension; namespace options { // Font settings overlay page UI handler. -class FontSettingsHandler : public OptionsPageUIHandler { +class FontSettingsHandler : public OptionsPageUIHandler, + public content::NotificationObserver { public: FontSettingsHandler(); virtual ~FontSettingsHandler(); @@ -36,7 +38,7 @@ class FontSettingsHandler : public OptionsPageUIHandler { virtual void RegisterMessages() OVERRIDE; private: - // OptionsPageUIHandler implementation. + // content::NotificationObserver implementation. virtual void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; diff --git a/chrome/browser/ui/webui/options/handler_options_handler.h b/chrome/browser/ui/webui/options/handler_options_handler.h index 93dd59d..7c6f12e 100644 --- a/chrome/browser/ui/webui/options/handler_options_handler.h +++ b/chrome/browser/ui/webui/options/handler_options_handler.h @@ -10,6 +10,7 @@ #include "chrome/browser/custom_handlers/protocol_handler_registry.h" #include "chrome/browser/ui/webui/options/options_ui.h" #include "chrome/common/custom_handlers/protocol_handler.h" +#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" //////////////////////////////////////////////////////////////////////////////// @@ -25,7 +26,8 @@ class DictionaryValue; namespace options { -class HandlerOptionsHandler : public OptionsPageUIHandler { +class HandlerOptionsHandler : public OptionsPageUIHandler, + public content::NotificationObserver { public: HandlerOptionsHandler(); virtual ~HandlerOptionsHandler(); diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.cc b/chrome/browser/ui/webui/options/manage_profile_handler.cc index b2fd4cc..aeb1ee3 100644 --- a/chrome/browser/ui/webui/options/manage_profile_handler.cc +++ b/chrome/browser/ui/webui/options/manage_profile_handler.cc @@ -193,8 +193,6 @@ void ManageProfileHandler::Observe( SendProfileNames(); base::StringValue value(kManageProfileIconGridName); SendProfileIcons(value); - } else { - OptionsPageUIHandler::Observe(type, source, details); } } diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.h b/chrome/browser/ui/webui/options/manage_profile_handler.h index 90c9820..d4286e3 100644 --- a/chrome/browser/ui/webui/options/manage_profile_handler.h +++ b/chrome/browser/ui/webui/options/manage_profile_handler.h @@ -11,6 +11,7 @@ #include "base/prefs/pref_change_registrar.h" #include "chrome/browser/sync/profile_sync_service_observer.h" #include "chrome/browser/ui/webui/options/options_ui.h" +#include "content/public/browser/notification_observer.h" namespace base { class StringValue; @@ -20,6 +21,7 @@ namespace options { // Chrome personal stuff profiles manage overlay UI handler. class ManageProfileHandler : public OptionsPageUIHandler, + public content::NotificationObserver, public ProfileSyncServiceObserver { public: ManageProfileHandler(); diff --git a/chrome/browser/ui/webui/options/managed_user_import_handler.cc b/chrome/browser/ui/webui/options/managed_user_import_handler.cc index 3eb5399..6787aff 100644 --- a/chrome/browser/ui/webui/options/managed_user_import_handler.cc +++ b/chrome/browser/ui/webui/options/managed_user_import_handler.cc @@ -48,10 +48,18 @@ scoped_ptr<base::ListValue> GetAvatarIcons() { namespace options { ManagedUserImportHandler::ManagedUserImportHandler() - : weak_ptr_factory_(this) { -} + : weak_ptr_factory_(this) {} -ManagedUserImportHandler::~ManagedUserImportHandler() {} +ManagedUserImportHandler::~ManagedUserImportHandler() { + Profile* profile = Profile::FromWebUI(web_ui()); + if (!profile->IsManaged()) { + ManagedUserSyncService* service = + ManagedUserSyncServiceFactory::GetForProfile(profile); + if (service) + service->RemoveObserver(this); + subscription_.reset(); + } +} void ManagedUserImportHandler::GetLocalizedValues( base::DictionaryValue* localized_strings) { @@ -76,8 +84,17 @@ void ManagedUserImportHandler::GetLocalizedValues( } void ManagedUserImportHandler::InitializeHandler() { + Profile* profile = Profile::FromWebUI(web_ui()); registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED, - content::Source<Profile>(Profile::FromWebUI(web_ui()))); + content::Source<Profile>(profile)); + if (!profile->IsManaged()) { + ManagedUserSyncServiceFactory::GetForProfile(profile)->AddObserver(this); + subscription_ = + ManagedUserSharedSettingsServiceFactory::GetForBrowserContext(profile) + ->Subscribe( + base::Bind(&ManagedUserImportHandler::OnSharedSettingChanged, + weak_ptr_factory_.GetWeakPtr())); + } } void ManagedUserImportHandler::RegisterMessages() { @@ -93,14 +110,18 @@ void ManagedUserImportHandler::Observe( if (type == chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED) { SigninGlobalError* error = SigninGlobalError::GetForProfile(Profile::FromWebUI(web_ui())); - if (content::Details<SigninGlobalError>(details).ptr() != error) - return; - - RequestManagedUserImportUpdate(NULL); - return; + if (content::Details<SigninGlobalError>(details).ptr() == error) + FetchManagedUsers(); } +} + +void ManagedUserImportHandler::OnManagedUsersChanged() { + FetchManagedUsers(); +} - OptionsPageUIHandler::Observe(type, source, details); +void ManagedUserImportHandler::FetchManagedUsers() { + web_ui()->CallJavascriptFunction("options.ManagedUserListData.resetPromise"); + RequestManagedUserImportUpdate(NULL); } void ManagedUserImportHandler::RequestManagedUserImportUpdate( @@ -208,4 +229,11 @@ bool ManagedUserImportHandler::HasAuthError() const { state == GoogleServiceAuthError::ACCOUNT_DISABLED; } +void ManagedUserImportHandler::OnSharedSettingChanged( + const std::string& managed_user_id, + const std::string& key) { + if (key == managed_users::kChromeAvatarIndex) + FetchManagedUsers(); +} + } // namespace options diff --git a/chrome/browser/ui/webui/options/managed_user_import_handler.h b/chrome/browser/ui/webui/options/managed_user_import_handler.h index dafb416..55dbd9c 100644 --- a/chrome/browser/ui/webui/options/managed_user_import_handler.h +++ b/chrome/browser/ui/webui/options/managed_user_import_handler.h @@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_IMPORT_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_IMPORT_HANDLER_H_ +#include "base/callback_list.h" #include "base/memory/weak_ptr.h" +#include "chrome/browser/managed_mode/managed_user_sync_service_observer.h" #include "chrome/browser/ui/webui/options/options_ui.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" @@ -18,8 +20,13 @@ class ListValue; namespace options { // Handler for the 'import existing managed user' dialog. -class ManagedUserImportHandler : public OptionsPageUIHandler { +class ManagedUserImportHandler : public OptionsPageUIHandler, + public content::NotificationObserver, + public ManagedUserSyncServiceObserver { public: + typedef base::CallbackList<void(const std::string&, const std::string&)> + CallbackList; + ManagedUserImportHandler(); virtual ~ManagedUserImportHandler(); @@ -35,7 +42,18 @@ class ManagedUserImportHandler : public OptionsPageUIHandler { virtual void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; + + // ManagedUserSyncServiceObserver implementation. + virtual void OnManagedUserAcknowledged(const std::string& managed_user_id) + OVERRIDE {} + virtual void OnManagedUsersSyncingStopped() OVERRIDE {} + virtual void OnManagedUsersChanged() OVERRIDE; + private: + // Clears the cached list of managed users and fetches the new list of managed + // users. + void FetchManagedUsers(); + // Callback for the "requestManagedUserImportUpdate" message. // Checks the sign-in status of the custodian and accordingly // sends an update to the WebUI. The update can be to show/hide @@ -61,6 +79,13 @@ class ManagedUserImportHandler : public OptionsPageUIHandler { bool IsAccountConnected() const; bool HasAuthError() const; + // Called when a managed user shared setting is changed. If the avatar was + // changed, FetchManagedUsers() is called. + void OnSharedSettingChanged(const std::string& managed_user_id, + const std::string& key); + + scoped_ptr<CallbackList::Subscription> subscription_; + base::WeakPtrFactory<ManagedUserImportHandler> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(ManagedUserImportHandler); diff --git a/chrome/browser/ui/webui/options/options_ui.h b/chrome/browser/ui/webui/options/options_ui.h index 8117ed6..609eb33 100644 --- a/chrome/browser/ui/webui/options/options_ui.h +++ b/chrome/browser/ui/webui/options/options_ui.h @@ -10,9 +10,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/browser/notification_types.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_ui_controller.h" #include "content/public/browser/web_ui_message_handler.h" @@ -37,8 +35,7 @@ class PointerDeviceObserver; namespace options { // The base class handler of Javascript messages of options pages. -class OptionsPageUIHandler : public content::WebUIMessageHandler, - public content::NotificationObserver { +class OptionsPageUIHandler : public content::WebUIMessageHandler { public: // Key for identifying the Settings App localized_strings in loadTimeData. static const char kSettingsAppKey[]; @@ -70,11 +67,6 @@ class OptionsPageUIHandler : public content::WebUIMessageHandler, // WebUIMessageHandler implementation. virtual void RegisterMessages() OVERRIDE {} - // content::NotificationObserver implementation. - virtual void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) OVERRIDE {} - protected: struct OptionsStringResource { // The name of the resource in templateData. |