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

Side by Side Diff: ios/chrome/browser/share_extension/share_extension_item_receiver.mm

Issue 2590973002: Fix DCHECK when adding non ASCII bookmark from share extension. (Closed)
Patch Set: UTF8ToUTF16 Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ios/chrome/browser/share_extension/share_extension_item_receiver.h" 5 #import "ios/chrome/browser/share_extension/share_extension_item_receiver.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include "base/ios/block_types.h" 9 #include "base/ios/block_types.h"
10 #include "base/mac/bind_objc_block.h" 10 #include "base/mac/bind_objc_block.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 [entryType integerValue]); 213 [entryType integerValue]);
214 if (type == app_group::READING_LIST_ITEM) { 214 if (type == app_group::READING_LIST_ITEM) {
215 LogHistogramReceivedItem(READINGLIST_ENTRY); 215 LogHistogramReceivedItem(READINGLIST_ENTRY);
216 _readingListModel->AddEntry(entryURL, 216 _readingListModel->AddEntry(entryURL,
217 entryTitle); 217 entryTitle);
218 } 218 }
219 if (type == app_group::BOOKMARK_ITEM) { 219 if (type == app_group::BOOKMARK_ITEM) {
220 LogHistogramReceivedItem(BOOKMARK_ENTRY); 220 LogHistogramReceivedItem(BOOKMARK_ENTRY);
221 _bookmarkModel->AddURL( 221 _bookmarkModel->AddURL(
222 _bookmarkModel->mobile_node(), 0, 222 _bookmarkModel->mobile_node(), 0,
223 base::ASCIIToUTF16(entryTitle), entryURL); 223 base::UTF8ToUTF16(entryTitle), entryURL);
224 } 224 }
225 if (completion) { 225 if (completion) {
226 web::WebThread::PostTask(web::WebThread::FILE, 226 web::WebThread::PostTask(web::WebThread::FILE,
227 FROM_HERE, 227 FROM_HERE,
228 base::BindBlockArc(^() { 228 base::BindBlockArc(^() {
229 completion(); 229 completion();
230 })); 230 }));
231 } 231 }
232 })); 232 }));
233 return YES; 233 return YES;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 - (NSOperationQueue*)presentedItemOperationQueue { 343 - (NSOperationQueue*)presentedItemOperationQueue {
344 return [NSOperationQueue mainQueue]; 344 return [NSOperationQueue mainQueue];
345 } 345 }
346 346
347 - (NSURL*)presentedItemURL { 347 - (NSURL*)presentedItemURL {
348 return app_group::ShareExtensionItemsFolder(); 348 return app_group::ShareExtensionItemsFolder();
349 } 349 }
350 350
351 @end 351 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698