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

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

Issue 27446002: Move permission warning message handling from PermissionSet to PermissionMessageProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 2 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 | Annotate | Revision Log
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/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 18 matching lines...) Expand all
29 #include "chrome/common/extensions/feature_switch.h" 29 #include "chrome/common/extensions/feature_switch.h"
30 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" 30 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
31 #include "chrome/common/extensions/permissions/permission_set.h" 31 #include "chrome/common/extensions/permissions/permission_set.h"
32 #include "chrome/common/extensions/permissions/permissions_data.h" 32 #include "chrome/common/extensions/permissions/permissions_data.h"
33 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
34 #include "content/public/browser/web_contents.h" 34 #include "content/public/browser/web_contents.h"
35 #include "content/public/browser/web_contents_view.h" 35 #include "content/public/browser/web_contents_view.h"
36 #include "extensions/common/extension_resource.h" 36 #include "extensions/common/extension_resource.h"
37 #include "extensions/common/manifest.h" 37 #include "extensions/common/manifest.h"
38 #include "extensions/common/manifest_constants.h" 38 #include "extensions/common/manifest_constants.h"
39 #include "extensions/common/permissions/permission_message_provider.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"
45 #include "ui/gfx/image/image.h" 46 #include "ui/gfx/image/image.h"
46 47
47 using extensions::BundleInstaller; 48 using extensions::BundleInstaller;
48 using extensions::Extension; 49 using extensions::Extension;
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 } 795 }
795 796
796 void ExtensionInstallPrompt::ShowConfirmation() { 797 void ExtensionInstallPrompt::ShowConfirmation() {
797 if (permissions_.get() && 798 if (permissions_.get() &&
798 (!extension_ || 799 (!extension_ ||
799 !extensions::PermissionsData::ShouldSkipPermissionWarnings( 800 !extensions::PermissionsData::ShouldSkipPermissionWarnings(
800 extension_))) { 801 extension_))) {
801 Manifest::Type extension_type = extension_ ? 802 Manifest::Type extension_type = extension_ ?
802 extension_->GetType() : Manifest::TYPE_UNKNOWN; 803 extension_->GetType() : Manifest::TYPE_UNKNOWN;
803 prompt_.SetPermissions( 804 prompt_.SetPermissions(
804 permissions_->GetWarningMessages(extension_type)); 805 extensions::PermissionMessageProvider::Get()->
806 GetWarningMessages(permissions_, extension_type));
805 prompt_.SetPermissionsDetails( 807 prompt_.SetPermissionsDetails(
806 permissions_->GetWarningMessagesDetails(extension_type)); 808 extensions::PermissionMessageProvider::Get()->
809 GetWarningMessagesDetails(permissions_, extension_type));
807 } 810 }
808 811
809 switch (prompt_.type()) { 812 switch (prompt_.type()) {
810 case PERMISSIONS_PROMPT: 813 case PERMISSIONS_PROMPT:
811 case RE_ENABLE_PROMPT: 814 case RE_ENABLE_PROMPT:
812 case DEFAULT_INSTALL_FIRST_RUN_PROMPT: 815 case DEFAULT_INSTALL_FIRST_RUN_PROMPT:
813 case INLINE_INSTALL_PROMPT: 816 case INLINE_INSTALL_PROMPT:
814 case EXTERNAL_INSTALL_PROMPT: 817 case EXTERNAL_INSTALL_PROMPT:
815 case INSTALL_PROMPT: 818 case INSTALL_PROMPT:
816 case POST_INSTALL_PERMISSIONS_PROMPT: { 819 case POST_INSTALL_PERMISSIONS_PROMPT: {
(...skipping 11 matching lines...) Expand all
828 } 831 }
829 832
830 if (AutoConfirmPrompt(delegate_)) 833 if (AutoConfirmPrompt(delegate_))
831 return; 834 return;
832 835
833 if (show_dialog_callback_.is_null()) 836 if (show_dialog_callback_.is_null())
834 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); 837 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_);
835 else 838 else
836 show_dialog_callback_.Run(show_params_, delegate_, prompt_); 839 show_dialog_callback_.Run(show_params_, delegate_, prompt_);
837 } 840 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_disabled_ui.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698