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

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

Issue 8539035: Fix 3 panel related bugs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 case COMMAND_CONFIGURE: 82 case COMMAND_CONFIGURE:
83 DCHECK(!extension->options_url().is_empty()); 83 DCHECK(!extension->options_url().is_empty());
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 // When the owning panel is being closed by the extension API, the
93 // the panel to be closed when the uninstall dialog is still showing. 93 // currently showing uninstall dialog will also be dismissed.
94 // http://crbug.com/102742
95 extension_uninstall_dialog_.reset( 94 extension_uninstall_dialog_.reset(
96 ExtensionUninstallDialog::Create(browser->GetProfile(), this)); 95 ExtensionUninstallDialog::Create(browser->GetProfile(), this));
97 extension_uninstall_dialog_->ConfirmUninstall(extension); 96 extension_uninstall_dialog_->ConfirmUninstall(extension);
98 break; 97 break;
99 case COMMAND_MANAGE: 98 case COMMAND_MANAGE:
100 browser->ShowOptionsTab(chrome::kExtensionsSubPage); 99 browser->ShowOptionsTab(chrome::kExtensionsSubPage);
101 break; 100 break;
102 default: 101 default:
103 NOTREACHED(); 102 NOTREACHED();
104 break; 103 break;
105 } 104 }
106 } 105 }
107 106
108 void PanelSettingsMenuModel::ExtensionUninstallAccepted() { 107 void PanelSettingsMenuModel::ExtensionUninstallAccepted() {
109 const Extension* extension = panel_->GetExtension(); 108 const Extension* extension = panel_->GetExtension();
110 DCHECK(extension); 109 DCHECK(extension);
111 110
112 panel_->browser()->GetProfile()->GetExtensionService()-> 111 panel_->browser()->GetProfile()->GetExtensionService()->
113 UninstallExtension(extension->id(), false, NULL); 112 UninstallExtension(extension->id(), false, NULL);
114 } 113 }
115 114
116 void PanelSettingsMenuModel::ExtensionUninstallCanceled() { 115 void PanelSettingsMenuModel::ExtensionUninstallCanceled() {
117 } 116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698