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

Side by Side Diff: content/browser/web_contents/web_drag_source_mac.mm

Issue 1820333003: Remove most uses of UnescapeRule::URL_SPECIAL_CHARS outside net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oops...format Created 4 years, 9 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
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 #import "content/browser/web_contents/web_drag_source_mac.h" 5 #import "content/browser/web_contents/web_drag_source_mac.h"
6 6
7 #include <sys/param.h> 7 #include <sys/param.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 forType:type]; 167 forType:type];
168 168
169 // URL. 169 // URL.
170 } else if ([type isEqualToString:NSURLPboardType]) { 170 } else if ([type isEqualToString:NSURLPboardType]) {
171 DCHECK(dropData_->url.is_valid()); 171 DCHECK(dropData_->url.is_valid());
172 NSURL* url = [NSURL URLWithString:SysUTF8ToNSString(dropData_->url.spec())]; 172 NSURL* url = [NSURL URLWithString:SysUTF8ToNSString(dropData_->url.spec())];
173 // If NSURL creation failed, check for a badly-escaped JavaScript URL. 173 // If NSURL creation failed, check for a badly-escaped JavaScript URL.
174 // Strip out any existing escapes and then re-escape uniformly. 174 // Strip out any existing escapes and then re-escape uniformly.
175 if (!url && dropData_->url.SchemeIs(url::kJavaScriptScheme)) { 175 if (!url && dropData_->url.SchemeIs(url::kJavaScriptScheme)) {
176 net::UnescapeRule::Type unescapeRules = 176 net::UnescapeRule::Type unescapeRules =
177 net::UnescapeRule::SPACES | 177 net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS |
178 net::UnescapeRule::URL_SPECIAL_CHARS | 178 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS |
179 net::UnescapeRule::SPOOFING_AND_CONTROL_CHARS; 179 net::UnescapeRule::SPOOFING_AND_CONTROL_CHARS;
180 std::string unescapedUrlString = 180 std::string unescapedUrlString =
181 net::UnescapeURLComponent(dropData_->url.spec(), unescapeRules); 181 net::UnescapeURLComponent(dropData_->url.spec(), unescapeRules);
182 std::string escapedUrlString = 182 std::string escapedUrlString =
183 net::EscapeUrlEncodedData(unescapedUrlString, false); 183 net::EscapeUrlEncodedData(unescapedUrlString, false);
184 url = [NSURL URLWithString:SysUTF8ToNSString(escapedUrlString)]; 184 url = [NSURL URLWithString:SysUTF8ToNSString(escapedUrlString)];
185 } 185 }
186 [url writeToPasteboard:pboard]; 186 [url writeToPasteboard:pboard];
187 // URL title. 187 // URL title.
188 } else if ([type isEqualToString:kNSURLTitlePboardType]) { 188 } else if ([type isEqualToString:kNSURLTitlePboardType]) {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 - (NSImage*)dragImage { 464 - (NSImage*)dragImage {
465 if (dragImage_) 465 if (dragImage_)
466 return dragImage_; 466 return dragImage_;
467 467
468 // Default to returning a generic image. 468 // Default to returning a generic image.
469 return content::GetContentClient()->GetNativeImageNamed( 469 return content::GetContentClient()->GetNativeImageNamed(
470 IDR_DEFAULT_FAVICON).ToNSImage(); 470 IDR_DEFAULT_FAVICON).ToNSImage();
471 } 471 }
472 472
473 @end // @implementation WebDragSource (Private) 473 @end // @implementation WebDragSource (Private)
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_browsertest.cc ('k') | content/test/mock_google_streaming_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698