| 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 "apps/app_window.h" | 10 #include "apps/app_window.h" |
| (...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 "BrowserOptions.updateEasyUnlock", | 1743 "BrowserOptions.updateEasyUnlock", |
| 1744 has_pairing_value); | 1744 has_pairing_value); |
| 1745 } | 1745 } |
| 1746 | 1746 |
| 1747 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { | 1747 void BrowserOptionsHandler::SetupExtensionControlledIndicators() { |
| 1748 #if defined(OS_WIN) | 1748 #if defined(OS_WIN) |
| 1749 base::DictionaryValue extension_controlled; | 1749 base::DictionaryValue extension_controlled; |
| 1750 | 1750 |
| 1751 // Check if an extension is overriding the Search Engine. | 1751 // Check if an extension is overriding the Search Engine. |
| 1752 const extensions::Extension* extension = extensions::OverridesSearchEngine( | 1752 const extensions::Extension* extension = extensions::OverridesSearchEngine( |
| 1753 Profile::FromWebUI(web_ui()), NULL); | 1753 Profile::FromWebUI(web_ui())); |
| 1754 AppendExtensionData("searchEngine", extension, &extension_controlled); | 1754 AppendExtensionData("searchEngine", extension, &extension_controlled); |
| 1755 | 1755 |
| 1756 // Check if an extension is overriding the Home page. | 1756 // Check if an extension is overriding the Home page. |
| 1757 extension = extensions::OverridesHomepage(Profile::FromWebUI(web_ui()), NULL); | 1757 extension = extensions::OverridesHomepage(Profile::FromWebUI(web_ui())); |
| 1758 AppendExtensionData("homePage", extension, &extension_controlled); | 1758 AppendExtensionData("homePage", extension, &extension_controlled); |
| 1759 | 1759 |
| 1760 // Check if an extension is overriding the Startup pages. | 1760 // Check if an extension is overriding the Startup pages. |
| 1761 extension = extensions::OverridesStartupPages( | 1761 extension = extensions::OverridesStartupPages(Profile::FromWebUI(web_ui())); |
| 1762 Profile::FromWebUI(web_ui()), NULL); | |
| 1763 AppendExtensionData("startUpPage", extension, &extension_controlled); | 1762 AppendExtensionData("startUpPage", extension, &extension_controlled); |
| 1764 | 1763 |
| 1765 // Check if an extension is overriding the NTP page. | 1764 // Check if an extension is overriding the NTP page. |
| 1766 GURL ntp_url(chrome::kChromeUINewTabURL); | 1765 GURL ntp_url(chrome::kChromeUINewTabURL); |
| 1767 bool ignored_param; | 1766 bool ignored_param; |
| 1768 extension = NULL; | 1767 extension = NULL; |
| 1769 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 1768 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
| 1770 &ntp_url, | 1769 &ntp_url, |
| 1771 web_ui()->GetWebContents()->GetBrowserContext(), | 1770 web_ui()->GetWebContents()->GetBrowserContext(), |
| 1772 &ignored_param); | 1771 &ignored_param); |
| 1773 if (ntp_url.SchemeIs("chrome-extension")) { | 1772 if (ntp_url.SchemeIs("chrome-extension")) { |
| 1774 using extensions::ExtensionRegistry; | 1773 using extensions::ExtensionRegistry; |
| 1775 ExtensionRegistry* registry = ExtensionRegistry::Get( | 1774 ExtensionRegistry* registry = ExtensionRegistry::Get( |
| 1776 Profile::FromWebUI(web_ui())); | 1775 Profile::FromWebUI(web_ui())); |
| 1777 extension = registry->GetExtensionById(ntp_url.host(), | 1776 extension = registry->GetExtensionById(ntp_url.host(), |
| 1778 ExtensionRegistry::ENABLED); | 1777 ExtensionRegistry::ENABLED); |
| 1779 } | 1778 } |
| 1780 AppendExtensionData("newTabPage", extension, &extension_controlled); | 1779 AppendExtensionData("newTabPage", extension, &extension_controlled); |
| 1781 | 1780 |
| 1782 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1781 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
| 1783 extension_controlled); | 1782 extension_controlled); |
| 1784 #endif // defined(OS_WIN) | 1783 #endif // defined(OS_WIN) |
| 1785 } | 1784 } |
| 1786 | 1785 |
| 1787 } // namespace options | 1786 } // namespace options |
| OLD | NEW |