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

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

Issue 216513002: Replace DCHECK(BrowserThread::CurrentlyOn) with DCHECK_CURRENTLY_ON in extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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_warning_set.h" 5 #include "chrome/browser/extensions/extension_warning_set.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 winning_filename.LossyDisplayName())); 172 winning_filename.LossyDisplayName()));
173 return ExtensionWarning( 173 return ExtensionWarning(
174 kDownloadFilenameConflict, 174 kDownloadFilenameConflict,
175 losing_extension_id, 175 losing_extension_id,
176 IDS_EXTENSION_WARNINGS_DOWNLOAD_FILENAME_CONFLICT, 176 IDS_EXTENSION_WARNINGS_DOWNLOAD_FILENAME_CONFLICT,
177 message_parameters); 177 message_parameters);
178 } 178 }
179 179
180 std::string ExtensionWarning::GetLocalizedMessage( 180 std::string ExtensionWarning::GetLocalizedMessage(
181 const ExtensionSet* extensions) const { 181 const ExtensionSet* extensions) const {
182 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 182 DCHECK_CURRENTLY_ON(BrowserThread::UI);
183 183
184 // These parameters may be unsafe (URLs and Extension names) and need 184 // These parameters may be unsafe (URLs and Extension names) and need
185 // to be HTML-escaped before being embedded in the UI. Also extension IDs 185 // to be HTML-escaped before being embedded in the UI. Also extension IDs
186 // are translated to full extension names. 186 // are translated to full extension names.
187 std::vector<base::string16> final_parameters; 187 std::vector<base::string16> final_parameters;
188 for (size_t i = 0; i < message_parameters_.size(); ++i) { 188 for (size_t i = 0; i < message_parameters_.size(); ++i) {
189 std::string message = message_parameters_[i]; 189 std::string message = message_parameters_[i];
190 if (StartsWithASCII(message, kTranslate, true)) { 190 if (StartsWithASCII(message, kTranslate, true)) {
191 std::string extension_id = message.substr(sizeof(kTranslate) - 1); 191 std::string extension_id = message.substr(sizeof(kTranslate) - 1);
192 const extensions::Extension* extension = 192 const extensions::Extension* extension =
(...skipping 24 matching lines...) Expand all
217 } 217 }
218 } 218 }
219 219
220 bool operator<(const ExtensionWarning& a, const ExtensionWarning& b) { 220 bool operator<(const ExtensionWarning& a, const ExtensionWarning& b) {
221 if (a.extension_id() != b.extension_id()) 221 if (a.extension_id() != b.extension_id())
222 return a.extension_id() < b.extension_id(); 222 return a.extension_id() < b.extension_id();
223 return a.warning_type() < b.warning_type(); 223 return a.warning_type() < b.warning_type();
224 } 224 }
225 225
226 } // namespace extensions 226 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_warning_service.cc ('k') | chrome/browser/extensions/image_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698