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

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

Issue 8872009: Revert 113568 - extensions: remove install/uninstall terminology (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
11 #include "chrome/browser/ui/global_error.h" 11 #include "chrome/browser/ui/global_error.h"
12 #include "grit/chromium_strings.h"
13 #include "grit/generated_resources.h" 12 #include "grit/generated_resources.h"
14 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
15 14
16 ExtensionGlobalError::ExtensionGlobalError( 15 ExtensionGlobalError::ExtensionGlobalError(
17 base::WeakPtr<ExtensionService> extension_service) 16 base::WeakPtr<ExtensionService> extension_service)
18 : current_browser_(NULL), 17 : current_browser_(NULL),
19 should_delete_self_on_close_(true), 18 should_delete_self_on_close_(true),
20 extension_service_(extension_service), 19 extension_service_(extension_service),
21 external_extension_ids_(new ExtensionIdSet), 20 external_extension_ids_(new ExtensionIdSet),
22 blacklisted_extension_ids_(new ExtensionIdSet), 21 blacklisted_extension_ids_(new ExtensionIdSet),
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 string16 ExtensionGlobalError::GenerateMessageSection( 90 string16 ExtensionGlobalError::GenerateMessageSection(
92 const ExtensionIdSet* extensions, 91 const ExtensionIdSet* extensions,
93 int template_message_id) { 92 int template_message_id) {
94 CHECK(extensions); 93 CHECK(extensions);
95 CHECK(template_message_id); 94 CHECK(template_message_id);
96 string16 message; 95 string16 message;
97 96
98 for (ExtensionIdSet::const_iterator iter = extensions->begin(); 97 for (ExtensionIdSet::const_iterator iter = extensions->begin();
99 iter != extensions->end(); ++iter) { 98 iter != extensions->end(); ++iter) {
100 const Extension* e = extension_service_->GetExtensionById(*iter, true); 99 const Extension* e = extension_service_->GetExtensionById(*iter, true);
101 message += l10n_util::GetStringFUTF16( 100 message += l10n_util::GetStringFUTF16(template_message_id,
102 template_message_id, 101 string16(ASCIIToUTF16(e->name())));
103 string16(ASCIIToUTF16(e->name())),
104 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME));
105 } 102 }
106 return message; 103 return message;
107 } 104 }
108 105
109 string16 ExtensionGlobalError::GenerateMessage() { 106 string16 ExtensionGlobalError::GenerateMessage() {
110 if (extension_service_.get()) { 107 if (extension_service_.get()) {
111 return 108 return
112 GenerateMessageSection(external_extension_ids_.get(), 109 GenerateMessageSection(external_extension_ids_.get(),
113 IDS_EXTENSION_ALERT_ITEM_EXTERNAL) + 110 IDS_EXTENSION_ALERT_ITEM_EXTERNAL) +
114 GenerateMessageSection(blacklisted_extension_ids_.get(), 111 GenerateMessageSection(blacklisted_extension_ids_.get(),
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if (!accept_callback_.is_null()) { 145 if (!accept_callback_.is_null()) {
149 accept_callback_.Run(*this, current_browser_); 146 accept_callback_.Run(*this, current_browser_);
150 } 147 }
151 } 148 }
152 149
153 void ExtensionGlobalError::BubbleViewCancelButtonPressed() { 150 void ExtensionGlobalError::BubbleViewCancelButtonPressed() {
154 if (!cancel_callback_.is_null()) { 151 if (!cancel_callback_.is_null()) {
155 cancel_callback_.Run(*this, current_browser_); 152 cancel_callback_.Run(*this, current_browser_);
156 } 153 }
157 } 154 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_model.cc ('k') | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698