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/extensions/extension_uninstall_dialog.h" | 5 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/extensions/image_loader.h" | 10 #include "chrome/browser/extensions/image_loader.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 ExtensionUninstallDialog::~ExtensionUninstallDialog() { | 73 ExtensionUninstallDialog::~ExtensionUninstallDialog() { |
74 } | 74 } |
75 | 75 |
76 void ExtensionUninstallDialog::ConfirmUninstall( | 76 void ExtensionUninstallDialog::ConfirmUninstall( |
77 const extensions::Extension* extension) { | 77 const extensions::Extension* extension) { |
78 DCHECK(ui_loop_ == MessageLoop::current()); | 78 DCHECK(ui_loop_ == MessageLoop::current()); |
79 extension_ = extension; | 79 extension_ = extension; |
80 | 80 |
81 #if defined(ENABLE_MANAGED_USERS) | 81 #if defined(ENABLE_MANAGED_USERS) && !defined(OS_CHROMEOS) |
82 // If the profile belongs to a managed user, and the profile is not in | 82 // If the profile belongs to a managed user, and the profile is not in |
83 // elevated state, a passphrase dialog is shown, and if the custodian | 83 // elevated state, a passphrase dialog is shown, and if the custodian |
84 // authorizes by entering his passphrase, the uninstall is continued by | 84 // authorizes by entering his passphrase, the uninstall is continued by |
85 // calling |ExtensionUninstallAccepted| on the delegate. | 85 // calling |ExtensionUninstallAccepted| on the delegate. |
86 if (ShowAuthorizationDialog()) | 86 if (ShowAuthorizationDialog()) |
87 return; | 87 return; |
88 #endif | 88 #endif |
89 | 89 |
90 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( | 90 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( |
91 extension_, | 91 extension_, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 ManagedUserService* service = ManagedUserServiceFactory::GetForProfile( | 171 ManagedUserService* service = ManagedUserServiceFactory::GetForProfile( |
172 profile_); | 172 profile_); |
173 DCHECK(service); | 173 DCHECK(service); |
174 service->AddElevationForExtension(extension_->id()); | 174 service->AddElevationForExtension(extension_->id()); |
175 delegate_->ExtensionUninstallAccepted(); | 175 delegate_->ExtensionUninstallAccepted(); |
176 } else { | 176 } else { |
177 delegate_->ExtensionUninstallCanceled(); | 177 delegate_->ExtensionUninstallCanceled(); |
178 } | 178 } |
179 } | 179 } |
180 #endif | 180 #endif |
OLD | NEW |