OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 #else | 263 #else |
264 core_handler = new CoreOptionsHandler(); | 264 core_handler = new CoreOptionsHandler(); |
265 #endif | 265 #endif |
266 core_handler->set_handlers_host(this); | 266 core_handler->set_handlers_host(this); |
267 AddOptionsPageUIHandler(localized_strings, core_handler); | 267 AddOptionsPageUIHandler(localized_strings, core_handler); |
268 | 268 |
269 AddOptionsPageUIHandler(localized_strings, new AutofillOptionsHandler()); | 269 AddOptionsPageUIHandler(localized_strings, new AutofillOptionsHandler()); |
270 AddOptionsPageUIHandler(localized_strings, | 270 AddOptionsPageUIHandler(localized_strings, |
271 new AutomaticSettingsResetHandler()); | 271 new AutomaticSettingsResetHandler()); |
272 | 272 |
| 273 #if !defined(OS_ANDROID) |
273 BrowserOptionsHandler* browser_options_handler = new BrowserOptionsHandler(); | 274 BrowserOptionsHandler* browser_options_handler = new BrowserOptionsHandler(); |
274 AddOptionsPageUIHandler(localized_strings, browser_options_handler); | 275 AddOptionsPageUIHandler(localized_strings, browser_options_handler); |
| 276 #endif |
275 | 277 |
276 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); | 278 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); |
277 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); | 279 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); |
278 AddOptionsPageUIHandler(localized_strings, new CookiesViewHandler()); | 280 AddOptionsPageUIHandler(localized_strings, new CookiesViewHandler()); |
| 281 #if !defined(OS_ANDROID) |
279 AddOptionsPageUIHandler(localized_strings, new CreateProfileHandler()); | 282 AddOptionsPageUIHandler(localized_strings, new CreateProfileHandler()); |
| 283 #endif |
| 284 |
280 AddOptionsPageUIHandler(localized_strings, new EasyUnlockHandler()); | 285 AddOptionsPageUIHandler(localized_strings, new EasyUnlockHandler()); |
| 286 |
| 287 #if !defined(OS_ANDROID) |
281 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); | 288 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); |
| 289 #endif |
| 290 |
282 #if defined(ENABLE_GOOGLE_NOW) | 291 #if defined(ENABLE_GOOGLE_NOW) |
283 AddOptionsPageUIHandler(localized_strings, new GeolocationOptionsHandler()); | 292 AddOptionsPageUIHandler(localized_strings, new GeolocationOptionsHandler()); |
284 #endif | 293 #endif |
| 294 #if !defined(OS_ANDROID) |
285 AddOptionsPageUIHandler(localized_strings, new options::HelpOverlayHandler()); | 295 AddOptionsPageUIHandler(localized_strings, new options::HelpOverlayHandler()); |
| 296 #endif |
| 297 |
286 AddOptionsPageUIHandler(localized_strings, new HomePageOverlayHandler()); | 298 AddOptionsPageUIHandler(localized_strings, new HomePageOverlayHandler()); |
287 AddOptionsPageUIHandler(localized_strings, | 299 AddOptionsPageUIHandler(localized_strings, |
288 new MediaDevicesSelectionHandler()); | 300 new MediaDevicesSelectionHandler()); |
289 #if defined(OS_CHROMEOS) | 301 #if defined(OS_CHROMEOS) |
290 AddOptionsPageUIHandler(localized_strings, | 302 AddOptionsPageUIHandler(localized_strings, |
291 new chromeos::options::CrosLanguageOptionsHandler()); | 303 new chromeos::options::CrosLanguageOptionsHandler()); |
292 #else | 304 #else |
293 AddOptionsPageUIHandler(localized_strings, new LanguageOptionsHandler()); | 305 AddOptionsPageUIHandler(localized_strings, new LanguageOptionsHandler()); |
294 #endif | 306 #endif |
295 AddOptionsPageUIHandler(localized_strings, | 307 AddOptionsPageUIHandler(localized_strings, |
296 new LanguageDictionaryOverlayHandler()); | 308 new LanguageDictionaryOverlayHandler()); |
297 AddOptionsPageUIHandler(localized_strings, new ManageProfileHandler()); | 309 AddOptionsPageUIHandler(localized_strings, new ManageProfileHandler()); |
298 AddOptionsPageUIHandler(localized_strings, new PasswordManagerHandler()); | 310 AddOptionsPageUIHandler(localized_strings, new PasswordManagerHandler()); |
299 AddOptionsPageUIHandler(localized_strings, new ResetProfileSettingsHandler()); | 311 AddOptionsPageUIHandler(localized_strings, new ResetProfileSettingsHandler()); |
300 AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler()); | 312 AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler()); |
| 313 |
| 314 #if !defined(OS_ANDROID) |
301 AddOptionsPageUIHandler(localized_strings, new ImportDataHandler()); | 315 AddOptionsPageUIHandler(localized_strings, new ImportDataHandler()); |
| 316 #endif |
| 317 |
302 AddOptionsPageUIHandler(localized_strings, new StartupPagesHandler()); | 318 AddOptionsPageUIHandler(localized_strings, new StartupPagesHandler()); |
303 #if defined(ENABLE_SUPERVISED_USERS) | 319 #if defined(ENABLE_SUPERVISED_USERS) && !defined(OS_ANDROID) |
304 AddOptionsPageUIHandler(localized_strings, | 320 AddOptionsPageUIHandler(localized_strings, |
305 new SupervisedUserCreateConfirmHandler()); | 321 new SupervisedUserCreateConfirmHandler()); |
306 AddOptionsPageUIHandler(localized_strings, new SupervisedUserImportHandler()); | 322 AddOptionsPageUIHandler(localized_strings, new SupervisedUserImportHandler()); |
307 AddOptionsPageUIHandler(localized_strings, | 323 AddOptionsPageUIHandler(localized_strings, |
308 new SupervisedUserLearnMoreHandler()); | 324 new SupervisedUserLearnMoreHandler()); |
309 #endif | 325 #endif |
310 AddOptionsPageUIHandler(localized_strings, new SyncSetupHandler()); | 326 AddOptionsPageUIHandler(localized_strings, new SyncSetupHandler()); |
311 #if defined(OS_CHROMEOS) | 327 #if defined(OS_CHROMEOS) |
312 AddOptionsPageUIHandler(localized_strings, | 328 AddOptionsPageUIHandler(localized_strings, |
313 new chromeos::options::AccountsOptionsHandler()); | 329 new chromeos::options::AccountsOptionsHandler()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 content::URLDataSource::Add(profile, theme); | 385 content::URLDataSource::Add(profile, theme); |
370 | 386 |
371 #if defined(OS_CHROMEOS) | 387 #if defined(OS_CHROMEOS) |
372 // Set up the chrome://userimage/ source. | 388 // Set up the chrome://userimage/ source. |
373 chromeos::options::UserImageSource* user_image_source = | 389 chromeos::options::UserImageSource* user_image_source = |
374 new chromeos::options::UserImageSource(); | 390 new chromeos::options::UserImageSource(); |
375 content::URLDataSource::Add(profile, user_image_source); | 391 content::URLDataSource::Add(profile, user_image_source); |
376 | 392 |
377 pointer_device_observer_.reset( | 393 pointer_device_observer_.reset( |
378 new chromeos::system::PointerDeviceObserver()); | 394 new chromeos::system::PointerDeviceObserver()); |
| 395 |
| 396 #if !defined(OS_ANDROID) |
379 pointer_device_observer_->AddObserver(browser_options_handler); | 397 pointer_device_observer_->AddObserver(browser_options_handler); |
| 398 #endif |
380 pointer_device_observer_->AddObserver(pointer_handler); | 399 pointer_device_observer_->AddObserver(pointer_handler); |
381 #endif | 400 #endif |
382 } | 401 } |
383 | 402 |
384 OptionsUI::~OptionsUI() { | 403 OptionsUI::~OptionsUI() { |
385 // Uninitialize all registered handlers. Deleted by WebUIImpl. | 404 // Uninitialize all registered handlers. Deleted by WebUIImpl. |
386 for (size_t i = 0; i < handlers_.size(); ++i) | 405 for (size_t i = 0; i < handlers_.size(); ++i) |
387 handlers_[i]->Uninitialize(); | 406 handlers_[i]->Uninitialize(); |
388 } | 407 } |
389 | 408 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // Add only if handler's service is enabled. | 495 // Add only if handler's service is enabled. |
477 if (handler->IsEnabled()) { | 496 if (handler->IsEnabled()) { |
478 // Add handler to the list and also pass the ownership. | 497 // Add handler to the list and also pass the ownership. |
479 web_ui()->AddMessageHandler(handler.release()); | 498 web_ui()->AddMessageHandler(handler.release()); |
480 handler_raw->GetLocalizedValues(localized_strings); | 499 handler_raw->GetLocalizedValues(localized_strings); |
481 handlers_.push_back(handler_raw); | 500 handlers_.push_back(handler_raw); |
482 } | 501 } |
483 } | 502 } |
484 | 503 |
485 } // namespace options | 504 } // namespace options |
OLD | NEW |