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

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

Issue 121033002: Update uses of UTF conversions in content/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
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 "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 contentsView_ = nil; 140 contentsView_ = nil;
141 } 141 }
142 142
143 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { 143 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal {
144 return dragOperationMask_; 144 return dragOperationMask_;
145 } 145 }
146 146
147 - (void)lazyWriteToPasteboard:(NSPasteboard*)pboard forType:(NSString*)type { 147 - (void)lazyWriteToPasteboard:(NSPasteboard*)pboard forType:(NSString*)type {
148 // NSHTMLPboardType requires the character set to be declared. Otherwise, it 148 // NSHTMLPboardType requires the character set to be declared. Otherwise, it
149 // assumes US-ASCII. Awesome. 149 // assumes US-ASCII. Awesome.
150 const base::string16 kHtmlHeader = ASCIIToUTF16( 150 const base::string16 kHtmlHeader = base::ASCIIToUTF16(
151 "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"); 151 "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">");
152 152
153 // Be extra paranoid; avoid crashing. 153 // Be extra paranoid; avoid crashing.
154 if (!dropData_) { 154 if (!dropData_) {
155 NOTREACHED(); 155 NOTREACHED();
156 return; 156 return;
157 } 157 }
158 158
159 // HTML. 159 // HTML.
160 if ([type isEqualToString:NSHTMLPboardType] || 160 if ([type isEqualToString:NSHTMLPboardType] ||
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 base::FilePath fileName; 390 base::FilePath fileName;
391 if (content::ParseDownloadMetadata( 391 if (content::ParseDownloadMetadata(
392 dropData_->download_metadata, 392 dropData_->download_metadata,
393 &mimeType16, 393 &mimeType16,
394 &fileName, 394 &fileName,
395 &downloadURL_)) { 395 &downloadURL_)) {
396 // Generate the file name based on both mime type and proposed file 396 // Generate the file name based on both mime type and proposed file
397 // name. 397 // name.
398 std::string defaultName = 398 std::string defaultName =
399 content::GetContentClient()->browser()->GetDefaultDownloadName(); 399 content::GetContentClient()->browser()->GetDefaultDownloadName();
400 mimeType = UTF16ToUTF8(mimeType16); 400 mimeType = base::UTF16ToUTF8(mimeType16);
401 downloadFileName_ = 401 downloadFileName_ =
402 net::GenerateFileName(downloadURL_, 402 net::GenerateFileName(downloadURL_,
403 std::string(), 403 std::string(),
404 std::string(), 404 std::string(),
405 fileName.value(), 405 fileName.value(),
406 mimeType, 406 mimeType,
407 defaultName); 407 defaultName);
408 } 408 }
409 } 409 }
410 410
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 - (NSImage*)dragImage { 480 - (NSImage*)dragImage {
481 if (dragImage_) 481 if (dragImage_)
482 return dragImage_; 482 return dragImage_;
483 483
484 // Default to returning a generic image. 484 // Default to returning a generic image.
485 return content::GetContentClient()->GetNativeImageNamed( 485 return content::GetContentClient()->GetNativeImageNamed(
486 IDR_DEFAULT_FAVICON).ToNSImage(); 486 IDR_DEFAULT_FAVICON).ToNSImage();
487 } 487 }
488 488
489 @end // @implementation WebDragSource (Private) 489 @end // @implementation WebDragSource (Private)
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_drag_source_gtk.cc ('k') | content/browser/webui/web_ui_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698