OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_infobar_delegate.h" | 5 #include "chrome/browser/extensions/extension_disabled_infobar_delegate.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
9 #include "chrome/browser/extensions/extension_install_ui.h" | 9 #include "chrome/browser/extensions/extension_install_ui.h" |
10 #include "chrome/browser/extensions/extensions_service.h" | 10 #include "chrome/browser/extensions/extensions_service.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE); | 32 extension_->GetIconPath(Extension::EXTENSION_ICON_LARGE); |
33 | 33 |
34 ChromeThread::PostTask( | 34 ChromeThread::PostTask( |
35 ChromeThread::FILE, FROM_HERE, | 35 ChromeThread::FILE, FROM_HERE, |
36 NewRunnableMethod(this, &ExtensionDisabledDialogDelegate::Start)); | 36 NewRunnableMethod(this, &ExtensionDisabledDialogDelegate::Start)); |
37 } | 37 } |
38 | 38 |
39 // ExtensionInstallUI::Delegate | 39 // ExtensionInstallUI::Delegate |
40 virtual void InstallUIProceed(bool create_app_shortcut) { | 40 virtual void InstallUIProceed(bool create_app_shortcut) { |
41 ExtensionPrefs* prefs = service_->extension_prefs(); | 41 ExtensionPrefs* prefs = service_->extension_prefs(); |
42 prefs->SetShowInstallWarningOnEnable(extension_, false); | 42 prefs->SetDidExtensionEscalatePermissions(extension_, false); |
43 service_->EnableExtension(extension_->id()); | 43 service_->EnableExtension(extension_->id()); |
44 Release(); | 44 Release(); |
45 } | 45 } |
46 virtual void InstallUIAbort() { | 46 virtual void InstallUIAbort() { |
47 // Do nothing. The extension will remain disabled. | 47 // Do nothing. The extension will remain disabled. |
48 Release(); | 48 Release(); |
49 } | 49 } |
50 | 50 |
51 private: | 51 private: |
52 friend class base::RefCountedThreadSafe<ExtensionDisabledDialogDelegate>; | 52 friend class base::RefCountedThreadSafe<ExtensionDisabledDialogDelegate>; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( | 159 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( |
160 tab_contents, service, extension)); | 160 tab_contents, service, extension)); |
161 } | 161 } |
162 | 162 |
163 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, | 163 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, |
164 Extension* extension) { | 164 Extension* extension) { |
165 // This object manages its own lifetime. | 165 // This object manages its own lifetime. |
166 new ExtensionDisabledDialogDelegate(profile, service, extension); | 166 new ExtensionDisabledDialogDelegate(profile, service, extension); |
167 } | 167 } |
OLD | NEW |