master_preferences

534 views
Skip to first unread message

Anthony Quinn

unread,
Jul 4, 2013, 12:00:35 PM7/4/13
to chromi...@chromium.org
I'm editing the master_preferences.cc file in chromium/src/chrome/installer/util/ to set some default values upon installation. I know how the JSON file should look and the values I need to set but I fail to see how they're being created in the source code. For example, how would:

"first_run_tabs": [
        "http://gmail.com",
        "https://igoogle.com"
     ],
 translate into C++ in the file?

Jói Sigurðsson

unread,
Jul 4, 2013, 12:03:02 PM7/4/13
to anthq...@gmail.com, Chromium-dev
Take a look at base/values.h, in particular ListValue and its
AppendString methods. You may also need DictionaryValue and its Set
method, in the same file.

Cheers,
Jói
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
>
>

Greg Thompson

unread,
Jul 4, 2013, 12:05:57 PM7/4/13
to Anthony Quinn, chromium-dev
I'm afraid I don't understand your question. master_preferences is a JSON file that can be supplied by a packager when Chromium is installed. Chromium will load the JSON file at first run and do certain things accordingly. In the specific case of first_run_tabs, browser startup code (in chrome/browser/first_run) calls into MasterPreferences::GetFirstRunTabs to get the collection of strings in the JSON array.

Does this help answer your question?

Anthony Quinn

unread,
Jul 4, 2013, 12:16:10 PM7/4/13
to chromi...@chromium.org, Anthony Quinn
How I understood it was that master_preferences.cc created a default master_preferences JSON file in which chrome got it's initial preferences from. Is this correct or should I be writing the JSON file manually as a seperate file and placing it in myself?

Greg Thompson

unread,
Jul 4, 2013, 12:33:12 PM7/4/13
to Anthony Quinn, chromium-dev
On Thu, Jul 4, 2013 at 12:16 PM, Anthony Quinn <anthq...@gmail.com> wrote:
How I understood it was that master_preferences.cc created a default master_preferences JSON file in which chrome got it's initial preferences from. Is this correct or should I be writing the JSON file manually as a seperate file and placing it in myself?

master_preferences is an optional file created manually by packagers.

Nico Weber

unread,
Jul 4, 2013, 12:45:14 PM7/4/13
to Greg Thompson, Anthony Quinn, chromium-dev
If you just want to use a master preferences file, you don't need to edit anything in chromium's repository. There's some documentation at http://www.chromium.org/administrators/configuring-other-preferences and http://www.chromium.org/developers/design-documents/first-run-customizations (and possibly other places).

Nico
Reply all
Reply to author
Forward
0 new messages