| 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/api/permissions/permissions_api.h" | 5 #include "chrome/browser/extensions/api/permissions/permissions_api.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h" | 8 #include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/permissions_updater.h" | 10 #include "chrome/browser/extensions/permissions_updater.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // we're skipping the confirmation UI. All extension types but INTERNAL | 201 // we're skipping the confirmation UI. All extension types but INTERNAL |
| 202 // are allowed to silently increase their permission level. | 202 // are allowed to silently increase their permission level. |
| 203 if (auto_confirm_for_tests == PROCEED || | 203 if (auto_confirm_for_tests == PROCEED || |
| 204 requested_permissions_->GetWarningMessages().size() == 0) { | 204 requested_permissions_->GetWarningMessages().size() == 0) { |
| 205 InstallUIProceed(); | 205 InstallUIProceed(); |
| 206 } else if (auto_confirm_for_tests == ABORT) { | 206 } else if (auto_confirm_for_tests == ABORT) { |
| 207 // Pretend the user clicked cancel. | 207 // Pretend the user clicked cancel. |
| 208 InstallUIAbort(true); | 208 InstallUIAbort(true); |
| 209 } else { | 209 } else { |
| 210 CHECK_EQ(DO_NOT_SKIP, auto_confirm_for_tests); | 210 CHECK_EQ(DO_NOT_SKIP, auto_confirm_for_tests); |
| 211 install_ui_.reset(new ExtensionInstallPrompt(GetCurrentBrowser())); | 211 install_ui_.reset( |
| 212 chrome::CreateExtensionInstallPromptWithBrowser(GetCurrentBrowser())); |
| 212 install_ui_->ConfirmPermissions( | 213 install_ui_->ConfirmPermissions( |
| 213 this, GetExtension(), requested_permissions_.get()); | 214 this, GetExtension(), requested_permissions_.get()); |
| 214 } | 215 } |
| 215 | 216 |
| 216 return true; | 217 return true; |
| 217 } | 218 } |
| OLD | NEW |