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