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

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: Latest master 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/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h" 25 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
26 #include "chrome/common/extensions/extension.h" 26 #include "chrome/common/extensions/extension.h"
27 #include "chrome/common/extensions/extension_constants.h" 27 #include "chrome/common/extensions/extension_constants.h"
28 #include "chrome/common/extensions/extension_icon_set.h" 28 #include "chrome/common/extensions/extension_icon_set.h"
29 #include "chrome/common/extensions/extension_manifest_constants.h" 29 #include "chrome/common/extensions/extension_manifest_constants.h"
30 #include "chrome/common/extensions/feature_switch.h" 30 #include "chrome/common/extensions/feature_switch.h"
31 #include "chrome/common/extensions/manifest.h" 31 #include "chrome/common/extensions/manifest.h"
32 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" 32 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
33 #include "chrome/common/extensions/permissions/permission_set.h" 33 #include "chrome/common/extensions/permissions/permission_set.h"
34 #include "chrome/common/extensions/permissions/permissions_data.h"
34 #include "chrome/common/pref_names.h" 35 #include "chrome/common/pref_names.h"
35 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
36 #include "content/public/browser/web_contents_view.h" 37 #include "content/public/browser/web_contents_view.h"
37 #include "extensions/common/extension_resource.h" 38 #include "extensions/common/extension_resource.h"
38 #include "extensions/common/url_pattern.h" 39 #include "extensions/common/url_pattern.h"
39 #include "grit/chromium_strings.h" 40 #include "grit/chromium_strings.h"
40 #include "grit/generated_resources.h" 41 #include "grit/generated_resources.h"
41 #include "grit/theme_resources.h" 42 #include "grit/theme_resources.h"
42 #include "ui/base/l10n/l10n_util.h" 43 #include "ui/base/l10n/l10n_util.h"
43 #include "ui/base/resource/resource_bundle.h" 44 #include "ui/base/resource/resource_bundle.h"
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 ShowConfirmation(); 672 ShowConfirmation();
672 } 673 }
673 674
674 void ExtensionInstallPrompt::OnMintTokenFailure( 675 void ExtensionInstallPrompt::OnMintTokenFailure(
675 const GoogleServiceAuthError& error) { 676 const GoogleServiceAuthError& error) {
676 ShowConfirmation(); 677 ShowConfirmation();
677 } 678 }
678 679
679 void ExtensionInstallPrompt::ShowConfirmation() { 680 void ExtensionInstallPrompt::ShowConfirmation() {
680 if (permissions_ && 681 if (permissions_ &&
681 (!extension_ || !extension_->ShouldSkipPermissionWarnings())) { 682 (!extension_ ||
683 !extensions::PermissionsData::ShouldSkipPermissionWarnings(
684 extension_))) {
682 Manifest::Type extension_type = extension_ ? 685 Manifest::Type extension_type = extension_ ?
683 extension_->GetType() : Manifest::TYPE_UNKNOWN; 686 extension_->GetType() : Manifest::TYPE_UNKNOWN;
684 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_type)); 687 prompt_.SetPermissions(permissions_->GetWarningMessages(extension_type));
685 } 688 }
686 689
687 switch (prompt_.type()) { 690 switch (prompt_.type()) {
688 case PERMISSIONS_PROMPT: 691 case PERMISSIONS_PROMPT:
689 case RE_ENABLE_PROMPT: 692 case RE_ENABLE_PROMPT:
690 case INLINE_INSTALL_PROMPT: 693 case INLINE_INSTALL_PROMPT:
691 case EXTERNAL_INSTALL_PROMPT: 694 case EXTERNAL_INSTALL_PROMPT:
(...skipping 13 matching lines...) Expand all
705 } 708 }
706 709
707 if (AutoConfirmPrompt(delegate_)) 710 if (AutoConfirmPrompt(delegate_))
708 return; 711 return;
709 712
710 if (show_dialog_callback_.is_null()) 713 if (show_dialog_callback_.is_null())
711 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); 714 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_);
712 else 715 else
713 show_dialog_callback_.Run(show_params_, delegate_, prompt_); 716 show_dialog_callback_.Run(show_params_, delegate_, prompt_);
714 } 717 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_permissions.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698