| 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/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 base::Bind(&BrowserOptionsHandler::DeleteProfile, | 578 base::Bind(&BrowserOptionsHandler::DeleteProfile, |
| 579 base::Unretained(this))); | 579 base::Unretained(this))); |
| 580 web_ui()->RegisterMessageCallback( | 580 web_ui()->RegisterMessageCallback( |
| 581 "cancelCreateProfile", | 581 "cancelCreateProfile", |
| 582 base::Bind(&BrowserOptionsHandler::HandleCancelProfileCreation, | 582 base::Bind(&BrowserOptionsHandler::HandleCancelProfileCreation, |
| 583 base::Unretained(this))); | 583 base::Unretained(this))); |
| 584 web_ui()->RegisterMessageCallback( | 584 web_ui()->RegisterMessageCallback( |
| 585 "themesReset", | 585 "themesReset", |
| 586 base::Bind(&BrowserOptionsHandler::ThemesReset, | 586 base::Bind(&BrowserOptionsHandler::ThemesReset, |
| 587 base::Unretained(this))); | 587 base::Unretained(this))); |
| 588 web_ui()->RegisterMessageCallback( |
| 589 "requestProfilesInfo", |
| 590 base::Bind(&BrowserOptionsHandler::HandleRequestProfilesInfo, |
| 591 base::Unretained(this))); |
| 588 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 592 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 589 web_ui()->RegisterMessageCallback( | 593 web_ui()->RegisterMessageCallback( |
| 590 "themesSetNative", | 594 "themesSetNative", |
| 591 base::Bind(&BrowserOptionsHandler::ThemesSetNative, | 595 base::Bind(&BrowserOptionsHandler::ThemesSetNative, |
| 592 base::Unretained(this))); | 596 base::Unretained(this))); |
| 593 #endif | 597 #endif |
| 594 web_ui()->RegisterMessageCallback( | 598 web_ui()->RegisterMessageCallback( |
| 595 "selectDownloadLocation", | 599 "selectDownloadLocation", |
| 596 base::Bind(&BrowserOptionsHandler::HandleSelectDownloadLocation, | 600 base::Bind(&BrowserOptionsHandler::HandleSelectDownloadLocation, |
| 597 base::Unretained(this))); | 601 base::Unretained(this))); |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 double zoom_factor; | 1481 double zoom_factor; |
| 1478 if (ExtractDoubleValue(args, &zoom_factor)) { | 1482 if (ExtractDoubleValue(args, &zoom_factor)) { |
| 1479 default_zoom_level_.SetValue(content::ZoomFactorToZoomLevel(zoom_factor)); | 1483 default_zoom_level_.SetValue(content::ZoomFactorToZoomLevel(zoom_factor)); |
| 1480 } | 1484 } |
| 1481 } | 1485 } |
| 1482 | 1486 |
| 1483 void BrowserOptionsHandler::HandleRestartBrowser(const ListValue* args) { | 1487 void BrowserOptionsHandler::HandleRestartBrowser(const ListValue* args) { |
| 1484 chrome::AttemptRestart(); | 1488 chrome::AttemptRestart(); |
| 1485 } | 1489 } |
| 1486 | 1490 |
| 1491 void BrowserOptionsHandler::HandleRequestProfilesInfo(const ListValue* args) { |
| 1492 SendProfilesInfo(); |
| 1493 } |
| 1494 |
| 1487 #if !defined(OS_CHROMEOS) | 1495 #if !defined(OS_CHROMEOS) |
| 1488 void BrowserOptionsHandler::ShowNetworkProxySettings(const ListValue* args) { | 1496 void BrowserOptionsHandler::ShowNetworkProxySettings(const ListValue* args) { |
| 1489 content::RecordAction(UserMetricsAction("Options_ShowProxySettings")); | 1497 content::RecordAction(UserMetricsAction("Options_ShowProxySettings")); |
| 1490 AdvancedOptionsUtilities::ShowNetworkProxySettings( | 1498 AdvancedOptionsUtilities::ShowNetworkProxySettings( |
| 1491 web_ui()->GetWebContents()); | 1499 web_ui()->GetWebContents()); |
| 1492 } | 1500 } |
| 1493 #endif | 1501 #endif |
| 1494 | 1502 |
| 1495 #if !defined(USE_NSS) && !defined(USE_OPENSSL) | 1503 #if !defined(USE_NSS) && !defined(USE_OPENSSL) |
| 1496 void BrowserOptionsHandler::ShowManageSSLCertificates(const ListValue* args) { | 1504 void BrowserOptionsHandler::ShowManageSSLCertificates(const ListValue* args) { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1759 const ProfileInfoCache& cache = | 1767 const ProfileInfoCache& cache = |
| 1760 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1768 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 1761 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { | 1769 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { |
| 1762 if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i)) | 1770 if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i)) |
| 1763 return false; | 1771 return false; |
| 1764 } | 1772 } |
| 1765 return true; | 1773 return true; |
| 1766 } | 1774 } |
| 1767 | 1775 |
| 1768 } // namespace options | 1776 } // namespace options |
| OLD | NEW |