On Sat, Jan 2, 2010 at 2:07 PM, Andy Ames <[email protected]> wrote:

> I have added a preference to pref_names.h/cc.
>
> In chrome/browser/browser.cc, I added the regisration of the user
> preference to ths static Browser::RegisterUserPrefs(PrefService*
> prefs) function:
>
> prefs->RegisterDictionaryPrefs(prefs::kPrinterSettings);
>

Generally prefs are used in specific classes (e.g. printer-specific code),
and you should register them from that code instead of using Browser as a
general-purpose dumping ground.

I then set a child string pref of the dictionary using:
>
> browser_->profile()->GetPrefs()->SetString(prefs::kPrinterSettings +
> L".child");
>

I don't think this would work.  Are there comments in the Value header about
how to use the classes there?  I think you need to GetMutableDictionary() on
your pref and then add a string to that dictionary.  AFAIK this will then
get saved automatically.  See e.g. the code for remembering zoom levels per
hostname, which uses strings in a dictionary.

PK

-- 
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to