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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 AddOptionsPageUIHandler(localized_strings, | 160 AddOptionsPageUIHandler(localized_strings, |
161 new chromeos::LanguagePinyinOptionsHandler()); | 161 new chromeos::LanguagePinyinOptionsHandler()); |
162 AddOptionsPageUIHandler(localized_strings, new chromeos::ProxyHandler()); | 162 AddOptionsPageUIHandler(localized_strings, new chromeos::ProxyHandler()); |
163 AddOptionsPageUIHandler(localized_strings, new SystemOptionsHandler()); | 163 AddOptionsPageUIHandler(localized_strings, new SystemOptionsHandler()); |
164 #endif | 164 #endif |
165 | 165 |
166 // |localized_strings| ownership is taken over by this constructor. | 166 // |localized_strings| ownership is taken over by this constructor. |
167 OptionsUIHTMLSource* html_source = | 167 OptionsUIHTMLSource* html_source = |
168 new OptionsUIHTMLSource(localized_strings); | 168 new OptionsUIHTMLSource(localized_strings); |
169 | 169 |
170 // Set up the chrome://options/ source. | 170 // Set up the chrome://settings/ source. |
171 ChromeThread::PostTask( | 171 ChromeThread::PostTask( |
172 ChromeThread::IO, FROM_HERE, | 172 ChromeThread::IO, FROM_HERE, |
173 NewRunnableMethod( | 173 NewRunnableMethod( |
174 Singleton<ChromeURLDataManager>::get(), | 174 Singleton<ChromeURLDataManager>::get(), |
175 &ChromeURLDataManager::AddDataSource, | 175 &ChromeURLDataManager::AddDataSource, |
176 make_scoped_refptr(html_source))); | 176 make_scoped_refptr(html_source))); |
177 | 177 |
178 // Set up chrome://theme/ source. | 178 // Set up chrome://theme/ source. |
179 DOMUIThemeSource* theme = new DOMUIThemeSource(GetProfile()); | 179 DOMUIThemeSource* theme = new DOMUIThemeSource(GetProfile()); |
180 ChromeThread::PostTask( | 180 ChromeThread::PostTask( |
(...skipping 26 matching lines...) Expand all Loading... |
207 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); | 207 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, | 211 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, |
212 OptionsPageUIHandler* handler) { | 212 OptionsPageUIHandler* handler) { |
213 DCHECK(handler); | 213 DCHECK(handler); |
214 handler->GetLocalizedValues(localized_strings); | 214 handler->GetLocalizedValues(localized_strings); |
215 AddMessageHandler(handler->Attach(this)); | 215 AddMessageHandler(handler->Attach(this)); |
216 } | 216 } |
OLD | NEW |