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

Unified Diff: chrome/browser/browser_about_handler.cc

Issue 10978015: Sort ChromePaths alphabetically for chrome://chrome-urls, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Init paths vector from kPaths array. Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_about_handler.cc
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 8ea02a9c1565a3bd2f496bc456b2a4e92d3b74a5..248a53ae59dc113a8f2dc5638b7627e13a28dd57 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/browser_about_handler.h"
+#include <algorithm>
#include <string>
#include "base/command_line.h"
@@ -19,7 +20,7 @@ namespace {
// Add paths here to be included in chrome://chrome-urls (about:about).
// These paths will also be suggested by BuiltinProvider.
-const char* const kChromePaths[] = {
+const char* const kPaths[] = {
chrome::kChromeUIAppCacheInternalsHost,
chrome::kChromeUIBlobInternalsHost,
chrome::kChromeUIBookmarksHost,
@@ -164,9 +165,7 @@ bool HandleNonNavigationAboutURL(const GURL& url) {
}
std::vector<std::string> ChromePaths() {
- std::vector<std::string> paths;
- paths.reserve(arraysize(kChromePaths));
- for (size_t i = 0; i < arraysize(kChromePaths); i++)
- paths.push_back(kChromePaths[i]);
+ std::vector<std::string> paths(kPaths, kPaths + arraysize(kPaths));
+ std::sort(paths.begin(), paths.end());
return paths;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698