| OLD | NEW |
| 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_disabled_ui.h" | 5 #include "chrome/browser/extensions/extension_disabled_ui.h" |
| 6 | 6 |
| 7 #include <bitset> | 7 #include <bitset> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "content/public/browser/notification_observer.h" | 32 #include "content/public/browser/notification_observer.h" |
| 33 #include "content/public/browser/notification_registrar.h" | 33 #include "content/public/browser/notification_registrar.h" |
| 34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
| 35 #include "extensions/browser/extension_util.h" | 35 #include "extensions/browser/extension_util.h" |
| 36 #include "extensions/common/constants.h" | 36 #include "extensions/common/constants.h" |
| 37 #include "extensions/common/extension.h" | 37 #include "extensions/common/extension.h" |
| 38 #include "extensions/common/extension_icon_set.h" | 38 #include "extensions/common/extension_icon_set.h" |
| 39 #include "extensions/common/manifest_handlers/icons_handler.h" | 39 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 40 #include "extensions/common/permissions/permission_message_provider.h" | 40 #include "extensions/common/permissions/permission_message_provider.h" |
| 41 #include "extensions/common/permissions/permission_set.h" | 41 #include "extensions/common/permissions/permission_set.h" |
| 42 #include "extensions/common/permissions/permissions_data.h" |
| 42 #include "grit/chromium_strings.h" | 43 #include "grit/chromium_strings.h" |
| 43 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
| 44 #include "grit/theme_resources.h" | 45 #include "grit/theme_resources.h" |
| 45 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
| 46 #include "ui/gfx/image/image.h" | 47 #include "ui/gfx/image/image.h" |
| 47 #include "ui/gfx/image/image_skia_operations.h" | 48 #include "ui/gfx/image/image_skia_operations.h" |
| 48 #include "ui/gfx/size.h" | 49 #include "ui/gfx/size.h" |
| 49 | 50 |
| 50 using extensions::Extension; | 51 using extensions::Extension; |
| 51 | 52 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 return l10n_util::GetStringFUTF16(IDS_EXTENSION_DISABLED_ERROR_TITLE, | 284 return l10n_util::GetStringFUTF16(IDS_EXTENSION_DISABLED_ERROR_TITLE, |
| 284 base::UTF8ToUTF16(extension_->name())); | 285 base::UTF8ToUTF16(extension_->name())); |
| 285 } | 286 } |
| 286 } | 287 } |
| 287 | 288 |
| 288 std::vector<base::string16> | 289 std::vector<base::string16> |
| 289 ExtensionDisabledGlobalError::GetBubbleViewMessages() { | 290 ExtensionDisabledGlobalError::GetBubbleViewMessages() { |
| 290 std::vector<base::string16> messages; | 291 std::vector<base::string16> messages; |
| 291 std::vector<base::string16> permission_warnings = | 292 std::vector<base::string16> permission_warnings = |
| 292 extensions::PermissionMessageProvider::Get()->GetWarningMessages( | 293 extensions::PermissionMessageProvider::Get()->GetWarningMessages( |
| 293 extension_->GetActivePermissions(), extension_->GetType()); | 294 extension_->permissions_data()->active_permissions(), |
| 295 extension_->GetType()); |
| 294 if (is_remote_install_) { | 296 if (is_remote_install_) { |
| 295 messages.push_back(l10n_util::GetStringFUTF16( | 297 messages.push_back(l10n_util::GetStringFUTF16( |
| 296 extension_->is_app() | 298 extension_->is_app() |
| 297 ? IDS_APP_DISABLED_REMOTE_INSTALL_ERROR_LABEL | 299 ? IDS_APP_DISABLED_REMOTE_INSTALL_ERROR_LABEL |
| 298 : IDS_EXTENSION_DISABLED_REMOTE_INSTALL_ERROR_LABEL, | 300 : IDS_EXTENSION_DISABLED_REMOTE_INSTALL_ERROR_LABEL, |
| 299 base::UTF8ToUTF16(extension_->name()))); | 301 base::UTF8ToUTF16(extension_->name()))); |
| 300 if (!permission_warnings.empty()) | 302 if (!permission_warnings.empty()) |
| 301 messages.push_back( | 303 messages.push_back( |
| 302 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO)); | 304 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO)); |
| 303 } else { | 305 } else { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 void ShowExtensionDisabledDialog(ExtensionService* service, | 426 void ShowExtensionDisabledDialog(ExtensionService* service, |
| 425 content::WebContents* web_contents, | 427 content::WebContents* web_contents, |
| 426 const Extension* extension) { | 428 const Extension* extension) { |
| 427 scoped_ptr<ExtensionInstallPrompt> install_ui( | 429 scoped_ptr<ExtensionInstallPrompt> install_ui( |
| 428 new ExtensionInstallPrompt(web_contents)); | 430 new ExtensionInstallPrompt(web_contents)); |
| 429 // This object manages its own lifetime. | 431 // This object manages its own lifetime. |
| 430 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); | 432 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); |
| 431 } | 433 } |
| 432 | 434 |
| 433 } // namespace extensions | 435 } // namespace extensions |
| OLD | NEW |