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

Side by Side Diff: chrome/browser/ui/panels/panel_settings_menu_model.cc

Issue 7920023: Fix crashes related to the extension uninstall dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make Show() pure virtual Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/panels/panel_settings_menu_model.h" 5 #include "chrome/browser/ui/panels/panel_settings_menu_model.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 browser->GetProfile()->GetExtensionProcessManager()->OpenOptionsPage( 84 browser->GetProfile()->GetExtensionProcessManager()->OpenOptionsPage(
85 extension, browser); 85 extension, browser);
86 break; 86 break;
87 case COMMAND_DISABLE: 87 case COMMAND_DISABLE:
88 browser->GetProfile()->GetExtensionService()->DisableExtension( 88 browser->GetProfile()->GetExtensionService()->DisableExtension(
89 extension->id()); 89 extension->id());
90 break; 90 break;
91 case COMMAND_UNINSTALL: 91 case COMMAND_UNINSTALL:
92 // TODO(jianli): Need to handle the case that the extension API requests 92 // TODO(jianli): Need to handle the case that the extension API requests
93 // the panel to be closed when the uninstall dialog is still showing. 93 // the panel to be closed when the uninstall dialog is still showing.
94 extension_uninstall_dialog_.reset(new ExtensionUninstallDialog( 94 extension_uninstall_dialog_.reset(
95 browser->GetProfile())); 95 ExtensionUninstallDialog::Create(browser->GetProfile(), this));
96 extension_uninstall_dialog_->ConfirmUninstall(this, extension); 96 extension_uninstall_dialog_->ConfirmUninstall(extension);
97 break; 97 break;
98 case COMMAND_MANAGE: 98 case COMMAND_MANAGE:
99 browser->ShowOptionsTab(chrome::kExtensionsSubPage); 99 browser->ShowOptionsTab(chrome::kExtensionsSubPage);
100 break; 100 break;
101 default: 101 default:
102 NOTREACHED(); 102 NOTREACHED();
103 break; 103 break;
104 } 104 }
105 } 105 }
106 106
107 void PanelSettingsMenuModel::ExtensionDialogAccepted() { 107 void PanelSettingsMenuModel::ExtensionUninstallAccepted() {
108 const Extension* extension = panel_->GetExtension(); 108 const Extension* extension = panel_->GetExtension();
109 DCHECK(extension); 109 DCHECK(extension);
110 110
111 panel_->browser()->GetProfile()->GetExtensionService()-> 111 panel_->browser()->GetProfile()->GetExtensionService()->
112 UninstallExtension(extension->id(), false, NULL); 112 UninstallExtension(extension->id(), false, NULL);
113 } 113 }
114 114
115 void PanelSettingsMenuModel::ExtensionDialogCanceled() { 115 void PanelSettingsMenuModel::ExtensionUninstallCanceled() {
116 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698