diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 00:02:10 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 00:02:10 +0000 |
commit | edaa05ab147ea0e576dae69da7077957745c8ccc (patch) | |
tree | 8c5ff13d1158ae7771e132e2f0e11dec65448e58 /chrome/browser/session_startup_pref.cc | |
parent | dff529739ad92782faaefbba447f7b7244c06ae4 (diff) | |
download | chromium_src-edaa05ab147ea0e576dae69da7077957745c8ccc.zip chromium_src-edaa05ab147ea0e576dae69da7077957745c8ccc.tar.gz chromium_src-edaa05ab147ea0e576dae69da7077957745c8ccc.tar.bz2 |
Add a notification when the list of startup URLs change.
BUG=38557
TEST=Run two instances of chromes with difference profiles that are syncing. Change the startup pages. Check that the change propagates.
Review URL: http://codereview.chromium.org/1562008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/session_startup_pref.cc')
-rw-r--r-- | chrome/browser/session_startup_pref.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/session_startup_pref.cc b/chrome/browser/session_startup_pref.cc index ff919d0..32d85d6 100644 --- a/chrome/browser/session_startup_pref.cc +++ b/chrome/browser/session_startup_pref.cc @@ -10,6 +10,7 @@ #include "chrome/browser/defaults.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" +#include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" namespace { @@ -72,6 +73,20 @@ void SessionStartupPref::SetStartupPref(PrefService* prefs, url_pref_list->Set(static_cast<int>(i), new StringValue(UTF8ToWide(pref.urls[i].spec()))); } + + std::wstring path_str(prefs::kURLsToRestoreOnStartup); + PrefService::PrefObserverMap::iterator observer_iterator = + prefs->pref_observers_.find(path_str); + if (observer_iterator != prefs->pref_observers_.end()) { + PrefService::NotificationObserverList::Iterator it( + *(observer_iterator->second)); + NotificationObserver* observer; + while ((observer = it.GetNext()) != NULL) { + observer->Observe(NotificationType::PREF_CHANGED, + Source<PrefService>(prefs), + Details<std::wstring>(&path_str)); + } + } } // static |