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

Unified Diff: chrome/browser/ui/webui/ntp/favicon_webui_handler.cc

Issue 10909236: Add support for favicon scale factor in WebUI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix HandleGetFaviconDominantColor. 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 | « chrome/browser/ui/webui/favicon_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
index 5e4481522fe18d5e01995222be59317c9fa5450a..0d2f2e9756da56dd4cb7cae01b25ef7d491c9afa 100644
--- a/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
+++ b/chrome/browser/ui/webui/ntp/favicon_webui_handler.cc
@@ -83,9 +83,10 @@ void FaviconWebUIHandler::RegisterMessages() {
void FaviconWebUIHandler::HandleGetFaviconDominantColor(const ListValue* args) {
std::string path;
CHECK(args->GetString(0, &path));
- DCHECK(StartsWithASCII(path, "chrome://favicon/size/16/", false)) <<
- "path is " << path;
- path = path.substr(arraysize("chrome://favicon/size/16/") - 1);
+ std::string prefix = "chrome://favicon/size/";
+ DCHECK(StartsWithASCII(path, prefix, false)) << "path is " << path;
+ size_t slash = path.find("/", prefix.length());
+ path = path.substr(slash + 1);
std::string dom_id;
CHECK(args->GetString(1, &dom_id));
« no previous file with comments | « chrome/browser/ui/webui/favicon_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698