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

Side by Side Diff: chrome/browser/ui/webui/fileicon_source.cc

Issue 11301007: Load the resources for max scale factor first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/webui/favicon_source.cc ('k') | chrome/browser/ui/webui/web_ui_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/webui/fileicon_source.h" 5 #include "chrome/browser/ui/webui/fileicon_source.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // Simple parser for data on the query. 69 // Simple parser for data on the query.
70 void ParseQueryParams(const std::string& query, 70 void ParseQueryParams(const std::string& query,
71 ui::ScaleFactor* scale_factor, 71 ui::ScaleFactor* scale_factor,
72 IconLoader::IconSize* icon_size) { 72 IconLoader::IconSize* icon_size) {
73 typedef std::pair<std::string, std::string> KVPair; 73 typedef std::pair<std::string, std::string> KVPair;
74 std::vector<KVPair> parameters; 74 std::vector<KVPair> parameters;
75 if (icon_size) 75 if (icon_size)
76 *icon_size = IconLoader::NORMAL; 76 *icon_size = IconLoader::NORMAL;
77 if (scale_factor) 77 if (scale_factor)
78 *scale_factor = ui::SCALE_FACTOR_NONE; 78 *scale_factor = ui::SCALE_FACTOR_100P;
79 base::SplitStringIntoKeyValuePairs(query, '=', '&', &parameters); 79 base::SplitStringIntoKeyValuePairs(query, '=', '&', &parameters);
80 for (std::vector<KVPair>::const_iterator iter = parameters.begin(); 80 for (std::vector<KVPair>::const_iterator iter = parameters.begin();
81 iter != parameters.end(); ++iter) { 81 iter != parameters.end(); ++iter) {
82 if (icon_size && iter->first == kIconSize) 82 if (icon_size && iter->first == kIconSize)
83 *icon_size = SizeStringToIconSize(iter->second); 83 *icon_size = SizeStringToIconSize(iter->second);
84 else if (scale_factor && iter->first == kScaleFactor) 84 else if (scale_factor && iter->first == kScaleFactor)
85 web_ui_util::ParseScaleFactor(iter->second, scale_factor); 85 web_ui_util::ParseScaleFactor(iter->second, scale_factor);
86 } 86 }
87 } 87 }
88 88
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 icon->ToImageSkia()->GetRepresentation( 152 icon->ToImageSkia()->GetRepresentation(
153 details.scale_factor).sk_bitmap(), 153 details.scale_factor).sk_bitmap(),
154 false, &icon_data->data()); 154 false, &icon_data->data());
155 155
156 SendResponse(details.request_id, icon_data); 156 SendResponse(details.request_id, icon_data);
157 } else { 157 } else {
158 // TODO(glen): send a dummy icon. 158 // TODO(glen): send a dummy icon.
159 SendResponse(details.request_id, NULL); 159 SendResponse(details.request_id, NULL);
160 } 160 }
161 } 161 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/favicon_source.cc ('k') | chrome/browser/ui/webui/web_ui_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698