| 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/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/extension_settings_handler.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "base/version.h" | 16 #include "base/version.h" |
| 17 #include "chrome/browser/debugger/devtools_window.h" | 17 #include "chrome/browser/debugger/devtools_window.h" |
| 18 #include "chrome/browser/extensions/crx_installer.h" | 18 #include "chrome/browser/extensions/crx_installer.h" |
| 19 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" | 19 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 20 #include "chrome/browser/extensions/extension_service.h" | 20 #include "chrome/browser/extensions/extension_service.h" |
| 21 #include "chrome/browser/extensions/extension_warning_set.h" | 21 #include "chrome/browser/extensions/extension_warning_set.h" |
| 22 #include "chrome/browser/extensions/unpacked_installer.h" | 22 #include "chrome/browser/extensions/unpacked_installer.h" |
| 23 #include "chrome/browser/extensions/updater/extension_updater.h" | 23 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 24 #include "chrome/browser/google/google_util.h" | 24 #include "chrome/browser/google/google_util.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/tab_contents/background_contents.h" | 26 #include "chrome/browser/tab_contents/background_contents.h" |
| 27 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 27 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 extension_service_->GetExtensionById(extension_id, true); | 306 extension_service_->GetExtensionById(extension_id, true); |
| 307 if (!Extension::UserMayDisable(extension->location())) { | 307 if (!Extension::UserMayDisable(extension->location())) { |
| 308 LOG(ERROR) << "Attempt to enable an extension that is non-usermanagable was" | 308 LOG(ERROR) << "Attempt to enable an extension that is non-usermanagable was" |
| 309 << "made. Extension id: " << extension->id(); | 309 << "made. Extension id: " << extension->id(); |
| 310 return; | 310 return; |
| 311 } | 311 } |
| 312 | 312 |
| 313 if (enable_str == "true") { | 313 if (enable_str == "true") { |
| 314 ExtensionPrefs* prefs = extension_service_->extension_prefs(); | 314 ExtensionPrefs* prefs = extension_service_->extension_prefs(); |
| 315 if (prefs->DidExtensionEscalatePermissions(extension_id)) { | 315 if (prefs->DidExtensionEscalatePermissions(extension_id)) { |
| 316 ShowExtensionDisabledDialog(extension_service_, | 316 extensions::ShowExtensionDisabledDialog( |
| 317 Profile::FromWebUI(web_ui()), extension); | 317 extension_service_, Profile::FromWebUI(web_ui()), extension); |
| 318 } else { | 318 } else { |
| 319 extension_service_->EnableExtension(extension_id); | 319 extension_service_->EnableExtension(extension_id); |
| 320 } | 320 } |
| 321 } else { | 321 } else { |
| 322 extension_service_->DisableExtension(extension_id); | 322 extension_service_->DisableExtension(extension_id); |
| 323 } | 323 } |
| 324 } | 324 } |
| 325 | 325 |
| 326 void ExtensionSettingsHandler::HandleEnableIncognitoMessage( | 326 void ExtensionSettingsHandler::HandleEnableIncognitoMessage( |
| 327 const ListValue* args) { | 327 const ListValue* args) { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) | 782 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) |
| 783 continue; | 783 continue; |
| 784 | 784 |
| 785 GURL url = host->GetDelegate()->GetURL(); | 785 GURL url = host->GetDelegate()->GetURL(); |
| 786 content::RenderProcessHost* process = host->GetProcess(); | 786 content::RenderProcessHost* process = host->GetProcess(); |
| 787 result->push_back( | 787 result->push_back( |
| 788 ExtensionPage(url, process->GetID(), host->GetRoutingID(), | 788 ExtensionPage(url, process->GetID(), host->GetRoutingID(), |
| 789 process->GetBrowserContext()->IsOffTheRecord())); | 789 process->GetBrowserContext()->IsOffTheRecord())); |
| 790 } | 790 } |
| 791 } | 791 } |
| OLD | NEW |