| 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_global_error.h" | 5 #include "chrome/browser/extensions/extension_global_error.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 message += l10n_util::GetStringFUTF16(template_message_id, | 79 message += l10n_util::GetStringFUTF16(template_message_id, |
| 80 string16(ASCIIToUTF16(e->name()))); | 80 string16(ASCIIToUTF16(e->name()))); |
| 81 } | 81 } |
| 82 return message; | 82 return message; |
| 83 } | 83 } |
| 84 | 84 |
| 85 string16 ExtensionGlobalError::GenerateMessage() { | 85 string16 ExtensionGlobalError::GenerateMessage() { |
| 86 return GenerateMessageSection(external_extension_ids_.get(), | 86 return GenerateMessageSection(external_extension_ids_.get(), |
| 87 IDS_EXTENSION_ALERT_ITEM_EXTERNAL) + | 87 IDS_EXTENSION_ALERT_ITEM_EXTERNAL) + |
| 88 GenerateMessageSection(blacklisted_extension_ids_.get(), | 88 GenerateMessageSection(blacklisted_extension_ids_.get(), |
| 89 IDS_EXTENSION_ALERT_ITEM_EXTERNAL) + | 89 IDS_EXTENSION_ALERT_ITEM_BLACKLISTED) + |
| 90 GenerateMessageSection(orphaned_extension_ids_.get(), | 90 GenerateMessageSection(orphaned_extension_ids_.get(), |
| 91 IDS_EXTENSION_ALERT_ITEM_EXTERNAL); | 91 IDS_EXTENSION_ALERT_ITEM_ORPHANED); |
| 92 } | 92 } |
| 93 | 93 |
| 94 string16 ExtensionGlobalError::GetBubbleViewMessage() { | 94 string16 ExtensionGlobalError::GetBubbleViewMessage() { |
| 95 if (message_.empty()) { | 95 if (message_.empty()) { |
| 96 message_ = GenerateMessage(); | 96 message_ = GenerateMessage(); |
| 97 } | 97 } |
| 98 return message_; | 98 return message_; |
| 99 } | 99 } |
| 100 | 100 |
| 101 string16 ExtensionGlobalError::GetBubbleViewAcceptButtonLabel() { | 101 string16 ExtensionGlobalError::GetBubbleViewAcceptButtonLabel() { |
| 102 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_OK); | 102 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_OK); |
| 103 } | 103 } |
| 104 | 104 |
| 105 string16 ExtensionGlobalError::GetBubbleViewCancelButtonLabel() { | 105 string16 ExtensionGlobalError::GetBubbleViewCancelButtonLabel() { |
| 106 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_DETAILS); | 106 return l10n_util::GetStringUTF16(IDS_EXTENSION_ALERT_ITEM_DETAILS); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void ExtensionGlobalError::OnBubbleViewDidClose(Browser* browser) { | 109 void ExtensionGlobalError::OnBubbleViewDidClose(Browser* browser) { |
| 110 extension_service_->HandleExtensionAlertClosed(); | 110 extension_service_->HandleExtensionAlertClosed(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void ExtensionGlobalError::BubbleViewAcceptButtonPressed(Browser* browser) { | 113 void ExtensionGlobalError::BubbleViewAcceptButtonPressed(Browser* browser) { |
| 114 extension_service_->HandleExtensionAlertAccept(); | 114 extension_service_->HandleExtensionAlertAccept(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ExtensionGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { | 117 void ExtensionGlobalError::BubbleViewCancelButtonPressed(Browser* browser) { |
| 118 extension_service_->HandleExtensionAlertDetails(browser); | 118 extension_service_->HandleExtensionAlertDetails(browser); |
| 119 } | 119 } |
| OLD | NEW |