Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: chrome/browser/extensions/extension_disabled_infobar_delegate.cc

Issue 4687005: Track permissions granted to extensions in prefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 18 matching lines...) Expand all
29 const Extension* extension) 29 const Extension* extension)
30 : service_(service), extension_(extension) { 30 : service_(service), extension_(extension) {
31 AddRef(); // Balanced in Proceed or Abort. 31 AddRef(); // Balanced in Proceed or Abort.
32 32
33 install_ui_.reset(new ExtensionInstallUI(profile)); 33 install_ui_.reset(new ExtensionInstallUI(profile));
34 install_ui_->ConfirmInstall(this, extension_); 34 install_ui_->ConfirmInstall(this, extension_);
35 } 35 }
36 36
37 // Overridden from ExtensionInstallUI::Delegate: 37 // Overridden from ExtensionInstallUI::Delegate:
38 virtual void InstallUIProceed() { 38 virtual void InstallUIProceed() {
39 ExtensionPrefs* prefs = service_->extension_prefs(); 39 service_->GrantPermissionsAndEnableExtension(extension_);
40 prefs->SetDidExtensionEscalatePermissions(extension_, false);
41 service_->EnableExtension(extension_->id());
42 Release(); 40 Release();
43 } 41 }
44 virtual void InstallUIAbort() { 42 virtual void InstallUIAbort() {
45 // Do nothing. The extension will remain disabled. 43 // Do nothing. The extension will remain disabled.
46 Release(); 44 Release();
47 } 45 }
48 46
49 private: 47 private:
50 friend class base::RefCountedThreadSafe<ExtensionDisabledDialogDelegate>; 48 friend class base::RefCountedThreadSafe<ExtensionDisabledDialogDelegate>;
51 49
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 137
140 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate( 138 tab_contents->AddInfoBar(new ExtensionDisabledInfobarDelegate(
141 tab_contents, service, extension)); 139 tab_contents, service, extension));
142 } 140 }
143 141
144 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile, 142 void ShowExtensionDisabledDialog(ExtensionsService* service, Profile* profile,
145 const Extension* extension) { 143 const Extension* extension) {
146 // This object manages its own lifetime. 144 // This object manages its own lifetime.
147 new ExtensionDisabledDialogDelegate(profile, service, extension); 145 new ExtensionDisabledDialogDelegate(profile, service, extension);
148 } 146 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | chrome/browser/extensions/extension_prefs.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698