OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/dom_ui/options_ui.h" | 5 #include "chrome/browser/dom_ui/options_ui.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 #include "grit/browser_resources.h" | 36 #include "grit/browser_resources.h" |
37 #include "grit/chromium_strings.h" | 37 #include "grit/chromium_strings.h" |
38 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
39 #include "grit/locale_settings.h" | 39 #include "grit/locale_settings.h" |
40 #include "grit/theme_resources.h" | 40 #include "grit/theme_resources.h" |
41 | 41 |
42 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
43 #include "chrome/browser/chromeos/dom_ui/sync_options_handler.h" | 43 #include "chrome/browser/chromeos/dom_ui/sync_options_handler.h" |
44 #include "chrome/browser/chromeos/dom_ui/labs_handler.h" | 44 #include "chrome/browser/chromeos/dom_ui/labs_handler.h" |
| 45 #include "chrome/browser/chromeos/dom_ui/language_options_handler.h" |
45 #include "chrome/browser/chromeos/dom_ui/system_options_handler.h" | 46 #include "chrome/browser/chromeos/dom_ui/system_options_handler.h" |
46 #endif | 47 #endif |
47 | 48 |
48 //////////////////////////////////////////////////////////////////////////////// | 49 //////////////////////////////////////////////////////////////////////////////// |
49 // | 50 // |
50 // OptionsUIHTMLSource | 51 // OptionsUIHTMLSource |
51 // | 52 // |
52 //////////////////////////////////////////////////////////////////////////////// | 53 //////////////////////////////////////////////////////////////////////////////// |
53 | 54 |
54 OptionsUIHTMLSource::OptionsUIHTMLSource(DictionaryValue* localized_strings) | 55 OptionsUIHTMLSource::OptionsUIHTMLSource(DictionaryValue* localized_strings) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 106 |
106 // TODO(zelidrag): Add all other page handlers here as we implement them. | 107 // TODO(zelidrag): Add all other page handlers here as we implement them. |
107 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); | 108 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); |
108 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); | 109 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); |
109 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); | 110 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); |
110 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); | 111 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); |
111 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
112 AddOptionsPageUIHandler(localized_strings, new SystemOptionsHandler()); | 113 AddOptionsPageUIHandler(localized_strings, new SystemOptionsHandler()); |
113 AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler()); | 114 AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler()); |
114 AddOptionsPageUIHandler(localized_strings, new LabsHandler()); | 115 AddOptionsPageUIHandler(localized_strings, new LabsHandler()); |
| 116 AddOptionsPageUIHandler(localized_strings, new LanguageOptionsHandler()); |
115 #endif | 117 #endif |
116 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); | 118 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); |
117 | 119 |
118 // |localized_strings| ownership is taken over by this constructor. | 120 // |localized_strings| ownership is taken over by this constructor. |
119 OptionsUIHTMLSource* html_source = | 121 OptionsUIHTMLSource* html_source = |
120 new OptionsUIHTMLSource(localized_strings); | 122 new OptionsUIHTMLSource(localized_strings); |
121 | 123 |
122 // Set up the chrome://options/ source. | 124 // Set up the chrome://options/ source. |
123 ChromeThread::PostTask( | 125 ChromeThread::PostTask( |
124 ChromeThread::IO, FROM_HERE, | 126 ChromeThread::IO, FROM_HERE, |
(...skipping 10 matching lines...) Expand all Loading... |
135 // LoadDataResourceBytes(IDR_OPTIONS_FAVICON); | 137 // LoadDataResourceBytes(IDR_OPTIONS_FAVICON); |
136 return NULL; | 138 return NULL; |
137 } | 139 } |
138 | 140 |
139 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, | 141 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, |
140 OptionsPageUIHandler* handler) { | 142 OptionsPageUIHandler* handler) { |
141 DCHECK(handler); | 143 DCHECK(handler); |
142 handler->GetLocalizedValues(localized_strings); | 144 handler->GetLocalizedValues(localized_strings); |
143 AddMessageHandler(handler->Attach(this)); | 145 AddMessageHandler(handler->Attach(this)); |
144 } | 146 } |
OLD | NEW |