Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/ui/webui/options/extension_settings_handler.cc

Issue 9718008: Replace extension disabled infobar with a global error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2 Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_updater.h" 21 #include "chrome/browser/extensions/extension_updater.h"
22 #include "chrome/browser/extensions/extension_warning_set.h" 22 #include "chrome/browser/extensions/extension_warning_set.h"
23 #include "chrome/browser/extensions/unpacked_installer.h" 23 #include "chrome/browser/extensions/unpacked_installer.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
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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) 785 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type)
786 continue; 786 continue;
787 787
788 GURL url = host->GetDelegate()->GetURL(); 788 GURL url = host->GetDelegate()->GetURL();
789 content::RenderProcessHost* process = host->GetProcess(); 789 content::RenderProcessHost* process = host->GetProcess();
790 result->push_back( 790 result->push_back(
791 ExtensionPage(url, process->GetID(), host->GetRoutingID(), 791 ExtensionPage(url, process->GetID(), host->GetRoutingID(),
792 process->GetBrowserContext()->IsOffTheRecord())); 792 process->GetBrowserContext()->IsOffTheRecord()));
793 } 793 }
794 } 794 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698