| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/bookmarks/bookmark_edit_view_controller.h" | 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 350 |
| 351 self.nameItem = | 351 self.nameItem = |
| 352 [[[BookmarkTextFieldItem alloc] initWithType:ItemTypeName] autorelease]; | 352 [[[BookmarkTextFieldItem alloc] initWithType:ItemTypeName] autorelease]; |
| 353 self.nameItem.accessibilityIdentifier = @"Title Field"; | 353 self.nameItem.accessibilityIdentifier = @"Title Field"; |
| 354 self.nameItem.placeholder = | 354 self.nameItem.placeholder = |
| 355 l10n_util::GetNSString(IDS_IOS_BOOKMARK_NAME_FIELD_HEADER); | 355 l10n_util::GetNSString(IDS_IOS_BOOKMARK_NAME_FIELD_HEADER); |
| 356 self.nameItem.text = bookmark_utils_ios::TitleForBookmarkNode(self.bookmark); | 356 self.nameItem.text = bookmark_utils_ios::TitleForBookmarkNode(self.bookmark); |
| 357 self.nameItem.delegate = self; | 357 self.nameItem.delegate = self; |
| 358 [model addItem:self.nameItem toSectionWithIdentifier:SectionIdentifierInfo]; | 358 [model addItem:self.nameItem toSectionWithIdentifier:SectionIdentifierInfo]; |
| 359 | 359 |
| 360 self.folderItem = | 360 self.folderItem = [[[BookmarkParentFolderItem alloc] |
| 361 [[BookmarkParentFolderItem alloc] initWithType:ItemTypeFolder]; | 361 initWithType:ItemTypeFolder] autorelease]; |
| 362 self.folderItem.title = bookmark_utils_ios::TitleForBookmarkNode(self.folder); | 362 self.folderItem.title = bookmark_utils_ios::TitleForBookmarkNode(self.folder); |
| 363 [model addItem:self.folderItem toSectionWithIdentifier:SectionIdentifierInfo]; | 363 [model addItem:self.folderItem toSectionWithIdentifier:SectionIdentifierInfo]; |
| 364 | 364 |
| 365 self.URLItem = | 365 self.URLItem = |
| 366 [[[BookmarkTextFieldItem alloc] initWithType:ItemTypeURL] autorelease]; | 366 [[[BookmarkTextFieldItem alloc] initWithType:ItemTypeURL] autorelease]; |
| 367 self.URLItem.accessibilityIdentifier = @"URL Field"; | 367 self.URLItem.accessibilityIdentifier = @"URL Field"; |
| 368 self.URLItem.placeholder = | 368 self.URLItem.placeholder = |
| 369 l10n_util::GetNSString(IDS_IOS_BOOKMARK_URL_FIELD_HEADER); | 369 l10n_util::GetNSString(IDS_IOS_BOOKMARK_URL_FIELD_HEADER); |
| 370 self.URLItem.text = base::SysUTF8ToNSString(self.bookmark->url().spec()); | 370 self.URLItem.text = base::SysUTF8ToNSString(self.bookmark->url().spec()); |
| 371 self.URLItem.delegate = self; | 371 self.URLItem.delegate = self; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 base::WeakNSObject<BookmarkEditViewController> weakSelf(self); | 586 base::WeakNSObject<BookmarkEditViewController> weakSelf(self); |
| 587 return @[ [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape | 587 return @[ [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape |
| 588 modifierFlags:Cr_UIKeyModifierNone | 588 modifierFlags:Cr_UIKeyModifierNone |
| 589 title:nil | 589 title:nil |
| 590 action:^{ | 590 action:^{ |
| 591 [weakSelf dismiss]; | 591 [weakSelf dismiss]; |
| 592 }] ]; | 592 }] ]; |
| 593 } | 593 } |
| 594 | 594 |
| 595 @end | 595 @end |
| OLD | NEW |