| 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_disabled_ui.h" | 5 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 AddRef(); // Balanced in Proceed or Abort. | 99 AddRef(); // Balanced in Proceed or Abort. |
| 100 | 100 |
| 101 install_ui_.reset(new ExtensionInstallPrompt(browser)); | 101 install_ui_.reset(new ExtensionInstallPrompt(browser)); |
| 102 install_ui_->ConfirmReEnable(this, extension_); | 102 install_ui_->ConfirmReEnable(this, extension_); |
| 103 } | 103 } |
| 104 | 104 |
| 105 ExtensionDisabledDialogDelegate::~ExtensionDisabledDialogDelegate() { | 105 ExtensionDisabledDialogDelegate::~ExtensionDisabledDialogDelegate() { |
| 106 } | 106 } |
| 107 | 107 |
| 108 void ExtensionDisabledDialogDelegate::InstallUIProceed() { | 108 void ExtensionDisabledDialogDelegate::InstallUIProceed() { |
| 109 service_->GrantPermissionsAndEnableExtension( | 109 service_->GrantPermissionsAndEnableExtension(extension_); |
| 110 extension_, install_ui_->record_oauth2_grant()); | |
| 111 Release(); | 110 Release(); |
| 112 } | 111 } |
| 113 | 112 |
| 114 void ExtensionDisabledDialogDelegate::InstallUIAbort(bool user_initiated) { | 113 void ExtensionDisabledDialogDelegate::InstallUIAbort(bool user_initiated) { |
| 115 std::string histogram_name = user_initiated ? | 114 std::string histogram_name = user_initiated ? |
| 116 "Extensions.Permissions_ReEnableCancel" : | 115 "Extensions.Permissions_ReEnableCancel" : |
| 117 "Extensions.Permissions_ReEnableAbort"; | 116 "Extensions.Permissions_ReEnableAbort"; |
| 118 ExtensionService::RecordPermissionMessagesHistogram( | 117 ExtensionService::RecordPermissionMessagesHistogram( |
| 119 extension_, histogram_name.c_str()); | 118 extension_, histogram_name.c_str()); |
| 120 | 119 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 AddGlobalError(new ExtensionDisabledGlobalError(service, extension)); | 317 AddGlobalError(new ExtensionDisabledGlobalError(service, extension)); |
| 319 } | 318 } |
| 320 | 319 |
| 321 void ShowExtensionDisabledDialog(ExtensionService* service, Browser* browser, | 320 void ShowExtensionDisabledDialog(ExtensionService* service, Browser* browser, |
| 322 const Extension* extension) { | 321 const Extension* extension) { |
| 323 // This object manages its own lifetime. | 322 // This object manages its own lifetime. |
| 324 new ExtensionDisabledDialogDelegate(browser, service, extension); | 323 new ExtensionDisabledDialogDelegate(browser, service, extension); |
| 325 } | 324 } |
| 326 | 325 |
| 327 } // namespace extensions | 326 } // namespace extensions |
| OLD | NEW |