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

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

Issue 10837270: webui: Change slightly how the scale-factor gets parsed from a URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: indent Created 8 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options2/chromeos/user_image_source.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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_NONE;
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 *scale_factor = web_ui_util::ParseScaleFactor(iter->second); 85 web_ui_util::ParseScaleFactor(iter->second, scale_factor);
86 } 86 }
87 } 87 }
88 88
89 } // namespace 89 } // namespace
90 90
91 FileIconSource::FileIconSource() 91 FileIconSource::FileIconSource()
92 : DataSource(kFileIconPath, MessageLoop::current()) {} 92 : DataSource(kFileIconPath, MessageLoop::current()) {}
93 93
94 FileIconSource::~FileIconSource() { 94 FileIconSource::~FileIconSource() {
95 cancelable_consumer_.CancelAllRequests(); 95 cancelable_consumer_.CancelAllRequests();
(...skipping 56 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 | « no previous file | chrome/browser/ui/webui/options2/chromeos/user_image_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698