summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/options.html
blob: f23939417f431c21b445e89aad915abdb42d88d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE HTML>
<html i18n-values="dir:textdirection;" id="t">
<head>
<meta charset="utf-8">
<title i18n-content="title"></title>

<!-- TODO(zelidrag) need a better icon here -->
<link rel="icon" href="../../app/theme/history_favicon.png">

<script src="chrome://resources/js/class_list.js"></script>
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/cr/ui/array_data_model.js"></script>
<script src="chrome://resources/js/cr/ui/list_selection_model.js"></script>
<script src="chrome://resources/js/cr/ui/list_item.js"></script>
<script src="chrome://resources/js/cr/ui/list.js"></script>
<script src="chrome://resources/js/local_strings.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="options/preferences.js"></script>
<script src="options/pref_ui.js"></script>
<script src="options/options_page.js"></script>
<if expr="pp_ifdef('chromeos')">
  <script src="options/chromeos_language_list.js"></script>
  <script src="options/chromeos_language_options.js"></script>
  <script src="options/chromeos_system_options.js"></script>
  <script src="options/chromeos_accounts_options.js"></script>
  <script src="options/chromeos_accounts_user_list.js"></script>
  <script src="options/chromeos_accounts_add_user_overlay.js"></script>
</if>
<script src="options/add_startup_page_overlay.js"></script>
<script src="options/advanced_options.js"></script>
<script src="options/browser_options.js"></script>
<script src="options/clear_browser_data_overlay.js"></script>
<script src="options/content_settings.js"></script>
<script src="options/content_settings_exceptions_list.js"></script>
<script src="options/content_settings_ui.js"></script>
<script src="options/font_settings_overlay.js"></script>
<script src="options/personal_options.js"></script>
<script src="options/search_engine_manager.js"></script>
<script>

///////////////////////////////////////////////////////////////////////////////
// Document Functions:
/**
 * Window onload handler, sets up the page.
 */
function load() {
  localStrings = new LocalStrings();

  if (cr.isChromeOS) {
    OptionsPage.register(SystemOptions.getInstance());
    OptionsPage.register(AccountsOptions.getInstance());
    // TODO(mazda): uncomment this once the language options is ready
    // OptionsPage.register(new OptionsPage(
    //     'languageChewing',
    //     localStrings.getString('languageChewingPage'),
    //     'languageChewingPage'));
    // OptionsPage.register(new OptionsPage(
    //     'languageHangul',
    //     localStrings.getString('languageHangulPage'),
    //     'languageHangulPage'));
    // OptionsPage.register(new OptionsPage(
    //     'languageMozc',
    //     localStrings.getString('languageMozcPage'),
    //     'languageMozcPage'));
    // OptionsPage.register(new OptionsPage(
    //     'languagePinyin',
    //     localStrings.getString('languagePinyinPage'),
    //     'languagePinyinPage'));
  }

  OptionsPage.register(BrowserOptions.getInstance());
  OptionsPage.register(PersonalOptions.getInstance());
  OptionsPage.register(AdvancedOptions.getInstance());
  OptionsPage.registerSubPage(ContentSettings.getInstance());
  OptionsPage.registerSubPage(SearchEngineManager.getInstance());
  OptionsPage.registerOverlay(AddStartupPageOverlay.getInstance());
  OptionsPage.registerOverlay(ClearBrowserDataOverlay.getInstance());
  OptionsPage.registerOverlay(FontSettingsOverlay.getInstance());

  if (cr.isChromeOS) {
    var labsOptions = new OptionsPage('labs',
                                      localStrings.getString('labsPage'),
                                      'labsPage');
    OptionsPage.register(labsOptions);
    OptionsPage.registerSubPage(LanguageOptions.getInstance());
  }

  var syncSettings = new OptionsPage('sync',
                                     localStrings.getString('syncPage'),
                                     'syncPage');
  OptionsPage.registerSubPage(syncSettings);

  Preferences.getInstance().initialize();
  OptionsPage.initialize();

  // TODO(csilv): Save/restore last selected page.
  if (cr.isChromeOS) {
    OptionsPage.showPageByName(SystemOptions.getInstance().name);
  } else {
    OptionsPage.showPageByName(BrowserOptions.getInstance().name);
  }
}

document.addEventListener('DOMContentLoaded', load);

window.onpopstate = function(e) {
  OptionsPage.setState(e.state);
};

</script>
<link rel="stylesheet" href="chrome://resources/css/list.css">
<link rel="stylesheet" href="dom_ui.css">
<link rel="stylesheet" href="options/options_page.css">
<link rel="stylesheet" href="options/browser_options_page.css">
<link rel="stylesheet" href="options/content_settings_page.css">
<link rel="stylesheet" href="options/clear_browser_data_overlay.css">
<if expr="pp_ifdef('chromeos')">
  <link rel="stylesheet" href="options/chromeos_accounts_options_page.css">
  <link rel="stylesheet" href="options/chromeos_language_options.css">
</if>
<link rel="stylesheet" href="options/personal_options.css">
</head>
<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
<div class="header">
</div>
<div id="overlay" class="overlay hidden">
  <div id="overlayview">
    <include src="options/add_startup_page_overlay.html">
    <include src="options/clear_browser_data_overlay.html">
    <include src="options/font_settings_overlay.html">
    <if expr="pp_ifdef('chromeos')">
       <include src="options/chromeos_accounts_add_user_overlay.html">
    </if>
  </div>
</div>
<div id="main-content">
  <div id="navbar-container">
     <h1 id="settings-title" i18n-content="title"></h1>
     <ul id="navbar">
     </ul>
     <hr/>
     <ul id="subpagesnav">
     </ul>
  </div>
  <div id="mainview">
     <if expr="pp_ifdef('chromeos')">
        <include src="options/chromeos_system_options.html">
        <include src="options/chromeos_language_options.html">
        <include src="options/chromeos_labs.html">
        <include src="options/chromeos_accounts_options.html">
        <!-- TODO(mazda): include the following htmls once the language options
             dialog is ready.
             - options/chromeos_language_chewing_options.html
             - options/chromeos_language_hangul_options.html
             - options/chromeos_language_mozc_options.html
             - options/chromeos_language_pinyin_options.html
        -->
     </if>
     <include src="options/advanced_options.html">
     <include src="options/browser_options.html">
     <include src="options/content_settings.html">
     <include src="options/personal_options.html">
     <include src="options/search_engine_manager.html">
     <include src="options/sync_options.html">
  </div>
</div>

<script>
// Decorate the existing elements in the document.
cr.ui.decorate('input[pref][type=checkbox]', PrefCheckbox);
cr.ui.decorate('input[pref][type=number]', PrefNumber);
cr.ui.decorate('input[pref][type=radio]', PrefRadio);
cr.ui.decorate('input[pref][type=range]', PrefRange);
cr.ui.decorate('select[pref]', PrefSelect);
cr.ui.decorate('input[pref][type=url]', PrefTextField);
cr.ui.decorate('#contentSettingsPage input[type=radio]', ContentSettingsRadio);
// TODO(zelidrag) add other elements here when we implement them
</script>
</body>
</html>