OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/options/options_ui.h" | 5 #include "chrome/browser/ui/webui/options/options_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 ThemeSource* theme = new ThemeSource(contents->profile()); | 274 ThemeSource* theme = new ThemeSource(contents->profile()); |
275 contents->profile()->GetChromeURLDataManager()->AddDataSource(theme); | 275 contents->profile()->GetChromeURLDataManager()->AddDataSource(theme); |
276 | 276 |
277 #if defined(OS_CHROMEOS) | 277 #if defined(OS_CHROMEOS) |
278 // Set up the chrome://userimage/ source. | 278 // Set up the chrome://userimage/ source. |
279 chromeos::UserImageSource* user_image_source = | 279 chromeos::UserImageSource* user_image_source = |
280 new chromeos::UserImageSource(); | 280 new chromeos::UserImageSource(); |
281 contents->profile()->GetChromeURLDataManager()->AddDataSource( | 281 contents->profile()->GetChromeURLDataManager()->AddDataSource( |
282 user_image_source); | 282 user_image_source); |
283 #endif | 283 #endif |
284 | |
285 // Initialize the chrome://about/ source in case the user clicks the credits | |
286 // link. | |
287 InitializeAboutDataSource(contents->profile()); | |
288 } | 284 } |
289 | 285 |
290 OptionsUI::~OptionsUI() { | 286 OptionsUI::~OptionsUI() { |
291 // Uninitialize all registered handlers. The base class owns them and it will | 287 // Uninitialize all registered handlers. The base class owns them and it will |
292 // eventually delete them. Skip over the generic handler. | 288 // eventually delete them. Skip over the generic handler. |
293 for (std::vector<WebUIMessageHandler*>::iterator iter = handlers_.begin() + 1; | 289 for (std::vector<WebUIMessageHandler*>::iterator iter = handlers_.begin() + 1; |
294 iter != handlers_.end(); | 290 iter != handlers_.end(); |
295 ++iter) { | 291 ++iter) { |
296 static_cast<OptionsPageUIHandler*>(*iter)->Uninitialize(); | 292 static_cast<OptionsPageUIHandler*>(*iter)->Uninitialize(); |
297 } | 293 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 OptionsPageUIHandler* handler_raw) { | 348 OptionsPageUIHandler* handler_raw) { |
353 scoped_ptr<OptionsPageUIHandler> handler(handler_raw); | 349 scoped_ptr<OptionsPageUIHandler> handler(handler_raw); |
354 DCHECK(handler.get()); | 350 DCHECK(handler.get()); |
355 // Add only if handler's service is enabled. | 351 // Add only if handler's service is enabled. |
356 if (handler->IsEnabled()) { | 352 if (handler->IsEnabled()) { |
357 handler->GetLocalizedValues(localized_strings); | 353 handler->GetLocalizedValues(localized_strings); |
358 // Add handler to the list and also pass the ownership. | 354 // Add handler to the list and also pass the ownership. |
359 AddMessageHandler(handler.release()->Attach(this)); | 355 AddMessageHandler(handler.release()->Attach(this)); |
360 } | 356 } |
361 } | 357 } |
OLD | NEW |