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

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

Issue 14651017: Move RuntimeData and related permissions out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_permissions
Patch Set: Created 7 years, 7 months 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
OLDNEW
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_install_prompt.h" 5 #include "chrome/browser/extensions/extension_install_prompt.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
26 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h" 26 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
27 #include "chrome/common/extensions/extension.h" 27 #include "chrome/common/extensions/extension.h"
28 #include "chrome/common/extensions/extension_constants.h" 28 #include "chrome/common/extensions/extension_constants.h"
29 #include "chrome/common/extensions/extension_icon_set.h" 29 #include "chrome/common/extensions/extension_icon_set.h"
30 #include "chrome/common/extensions/extension_manifest_constants.h" 30 #include "chrome/common/extensions/extension_manifest_constants.h"
31 #include "chrome/common/extensions/feature_switch.h" 31 #include "chrome/common/extensions/feature_switch.h"
32 #include "chrome/common/extensions/manifest.h" 32 #include "chrome/common/extensions/manifest.h"
33 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" 33 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
34 #include "chrome/common/extensions/permissions/permission_set.h" 34 #include "chrome/common/extensions/permissions/permission_set.h"
35 #include "chrome/common/extensions/permissions/permissions_data.h"
35 #include "chrome/common/pref_names.h" 36 #include "chrome/common/pref_names.h"
36 #include "content/public/browser/web_contents.h" 37 #include "content/public/browser/web_contents.h"
37 #include "content/public/browser/web_contents_view.h" 38 #include "content/public/browser/web_contents_view.h"
38 #include "extensions/common/extension_resource.h" 39 #include "extensions/common/extension_resource.h"
39 #include "extensions/common/url_pattern.h" 40 #include "extensions/common/url_pattern.h"
40 #include "grit/chromium_strings.h" 41 #include "grit/chromium_strings.h"
41 #include "grit/generated_resources.h" 42 #include "grit/generated_resources.h"
42 #include "grit/theme_resources.h" 43 #include "grit/theme_resources.h"
43 #include "ui/base/l10n/l10n_util.h" 44 #include "ui/base/l10n/l10n_util.h"
44 #include "ui/base/resource/resource_bundle.h" 45 #include "ui/base/resource/resource_bundle.h"
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 ShowConfirmation(); 673 ShowConfirmation();
673 } 674 }
674 675
675 void ExtensionInstallPrompt::OnMintTokenFailure( 676 void ExtensionInstallPrompt::OnMintTokenFailure(
676 const GoogleServiceAuthError& error) { 677 const GoogleServiceAuthError& error) {
677 ShowConfirmation(); 678 ShowConfirmation();
678 } 679 }
679 680
680 void ExtensionInstallPrompt::ShowConfirmation() { 681 void ExtensionInstallPrompt::ShowConfirmation() {
681 if (permissions_ && 682 if (permissions_ &&
682 (!extension_ || !extension_->ShouldSkipPermissionWarnings())) { 683 (!extension_ ||
684 !extensions::PermissionsData::ShouldSkipPermissionWarnings(
685 extension_))) {
683 Manifest::Type extension_type = extension_ ? 686 Manifest::Type extension_type = extension_ ?
684 extension_->GetType() : Manifest::TYPE_UNKNOWN; 687 extension_->GetType() : Manifest::TYPE_UNKNOWN;
685 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_type)); 688 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_type));
686 } 689 }
687 690
688 switch (prompt_.type()) { 691 switch (prompt_.type()) {
689 case PERMISSIONS_PROMPT: 692 case PERMISSIONS_PROMPT:
690 case RE_ENABLE_PROMPT: 693 case RE_ENABLE_PROMPT:
691 case INLINE_INSTALL_PROMPT: 694 case INLINE_INSTALL_PROMPT:
692 case EXTERNAL_INSTALL_PROMPT: 695 case EXTERNAL_INSTALL_PROMPT:
(...skipping 13 matching lines...) Expand all
706 } 709 }
707 710
708 if (AutoConfirmPrompt(delegate_)) 711 if (AutoConfirmPrompt(delegate_))
709 return; 712 return;
710 713
711 if (show_dialog_callback_.is_null()) 714 if (show_dialog_callback_.is_null())
712 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); 715 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_);
713 else 716 else
714 show_dialog_callback_.Run(show_params_, delegate_, prompt_); 717 show_dialog_callback_.Run(show_params_, delegate_, prompt_);
715 } 718 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698