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 <bitset> | 7 #include <bitset> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 ExtensionDisabledDialogDelegate::~ExtensionDisabledDialogDelegate() { | 122 ExtensionDisabledDialogDelegate::~ExtensionDisabledDialogDelegate() { |
123 } | 123 } |
124 | 124 |
125 void ExtensionDisabledDialogDelegate::InstallUIProceed() { | 125 void ExtensionDisabledDialogDelegate::InstallUIProceed() { |
126 service_->GrantPermissionsAndEnableExtension(extension_); | 126 service_->GrantPermissionsAndEnableExtension(extension_); |
127 Release(); | 127 Release(); |
128 } | 128 } |
129 | 129 |
130 void ExtensionDisabledDialogDelegate::InstallUIAbort(bool user_initiated) { | 130 void ExtensionDisabledDialogDelegate::InstallUIAbort(bool user_initiated) { |
131 std::string histogram_name = user_initiated | 131 std::string histogram_name = user_initiated ? "ReEnableCancel" |
132 ? "Extensions.Permissions_ReEnableCancel2" | 132 : "ReEnableAbort"; |
133 : "Extensions.Permissions_ReEnableAbort2"; | |
134 ExtensionService::RecordPermissionMessagesHistogram( | 133 ExtensionService::RecordPermissionMessagesHistogram( |
135 extension_, histogram_name.c_str()); | 134 extension_, histogram_name.c_str()); |
136 | 135 |
137 // Do nothing. The extension will remain disabled. | 136 // Do nothing. The extension will remain disabled. |
138 Release(); | 137 Release(); |
139 } | 138 } |
140 | 139 |
141 // ExtensionDisabledGlobalError ----------------------------------------------- | 140 // ExtensionDisabledGlobalError ----------------------------------------------- |
142 | 141 |
143 class ExtensionDisabledGlobalError | 142 class ExtensionDisabledGlobalError |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 void ShowExtensionDisabledDialog(ExtensionService* service, | 454 void ShowExtensionDisabledDialog(ExtensionService* service, |
456 content::WebContents* web_contents, | 455 content::WebContents* web_contents, |
457 const Extension* extension) { | 456 const Extension* extension) { |
458 scoped_ptr<ExtensionInstallPrompt> install_ui( | 457 scoped_ptr<ExtensionInstallPrompt> install_ui( |
459 new ExtensionInstallPrompt(web_contents)); | 458 new ExtensionInstallPrompt(web_contents)); |
460 // This object manages its own lifetime. | 459 // This object manages its own lifetime. |
461 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); | 460 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); |
462 } | 461 } |
463 | 462 |
464 } // namespace extensions | 463 } // namespace extensions |
OLD | NEW |