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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/user_image_source.cc

Issue 1152373003: url: Fix the TODO in url_parse.h header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « chrome/browser/prerender/prerender_util.cc ('k') | chrome/test/perf/url_parse_perftest.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/options/chromeos/user_image_source.h" 5 #include "chrome/browser/ui/webui/options/chromeos/user_image_source.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
11 #include "components/user_manager/user_image/default_user_images.h" 11 #include "components/user_manager/user_image/default_user_images.h"
12 #include "components/user_manager/user_manager.h" 12 #include "components/user_manager/user_manager.h"
13 #include "grit/theme_resources.h" 13 #include "grit/theme_resources.h"
14 #include "grit/ui_chromeos_resources.h" 14 #include "grit/ui_chromeos_resources.h"
15 #include "net/base/escape.h" 15 #include "net/base/escape.h"
16 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/gfx/codec/png_codec.h" 17 #include "ui/gfx/codec/png_codec.h"
18 #include "url/url_parse.h" 18 #include "url/third_party/mozilla/url_parse.h"
19 19
20 namespace { 20 namespace {
21 21
22 // Parses the user image URL, which looks like 22 // Parses the user image URL, which looks like
23 // "chrome://userimage/user@host?key1=value1&...&key_n=value_n", 23 // "chrome://userimage/user@host?key1=value1&...&key_n=value_n",
24 // to user email. 24 // to user email.
25 void ParseRequest(const GURL& url, 25 void ParseRequest(const GURL& url,
26 std::string* email) { 26 std::string* email) {
27 DCHECK(url.is_valid()); 27 DCHECK(url.is_valid());
28 *email = net::UnescapeURLComponent(url.path().substr(1), 28 *email = net::UnescapeURLComponent(url.path().substr(1),
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 std::string UserImageSource::GetMimeType(const std::string& path) const { 84 std::string UserImageSource::GetMimeType(const std::string& path) const {
85 // We need to explicitly return a mime type, otherwise if the user tries to 85 // We need to explicitly return a mime type, otherwise if the user tries to
86 // drag the image they get no extension. 86 // drag the image they get no extension.
87 return "image/png"; 87 return "image/png";
88 } 88 }
89 89
90 } // namespace options 90 } // namespace options
91 } // namespace chromeos 91 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_util.cc ('k') | chrome/test/perf/url_parse_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698