| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util_mac.h" | 5 #include "app/l10n_util_mac.h" |
| 6 #include "app/resource_bundle.h" | 6 #include "app/resource_bundle.h" |
| 7 #include "base/mac_util.h" | 7 #include "base/mac_util.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_editor.h" | 9 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // There is no real need to jump to a platform-common routine at | 428 // There is no real need to jump to a platform-common routine at |
| 429 // this point (which just jumps back to objc) other than consistency | 429 // this point (which just jumps back to objc) other than consistency |
| 430 // across platforms. | 430 // across platforms. |
| 431 // | 431 // |
| 432 // TODO(jrg): identify when we NO_TREE. I can see it in the code | 432 // TODO(jrg): identify when we NO_TREE. I can see it in the code |
| 433 // for the other platforms but can't find a way to trigger it in the | 433 // for the other platforms but can't find a way to trigger it in the |
| 434 // UI. | 434 // UI. |
| 435 BookmarkEditor::Show([[self view] window], | 435 BookmarkEditor::Show([[self view] window], |
| 436 browser_->profile(), | 436 browser_->profile(), |
| 437 node->GetParent(), | 437 node->GetParent(), |
| 438 node, | 438 BookmarkEditor::EditDetails(node), |
| 439 BookmarkEditor::SHOW_TREE, | 439 BookmarkEditor::SHOW_TREE, |
| 440 nil); | 440 nil); |
| 441 } | 441 } |
| 442 | 442 |
| 443 - (IBAction)copyBookmark:(id)sender { | 443 - (IBAction)copyBookmark:(id)sender { |
| 444 BookmarkNode* node = [self nodeFromMenuItem:sender]; | 444 BookmarkNode* node = [self nodeFromMenuItem:sender]; |
| 445 const std::string spec = node->GetURL().spec(); | 445 const std::string spec = node->GetURL().spec(); |
| 446 NSString* url = base::SysUTF8ToNSString(spec); | 446 NSString* url = base::SysUTF8ToNSString(spec); |
| 447 NSString* title = base::SysWideToNSString(node->GetTitle()); | 447 NSString* title = base::SysWideToNSString(node->GetTitle()); |
| 448 NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; | 448 NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 479 | 479 |
| 480 // May be called from the bar or from a folder button. | 480 // May be called from the bar or from a folder button. |
| 481 // If called from a button, that button becomes the parent. | 481 // If called from a button, that button becomes the parent. |
| 482 - (IBAction)addPage:(id)sender { | 482 - (IBAction)addPage:(id)sender { |
| 483 const BookmarkNode* parent = [self nodeFromMenuItem:sender]; | 483 const BookmarkNode* parent = [self nodeFromMenuItem:sender]; |
| 484 if (!parent) | 484 if (!parent) |
| 485 parent = bookmarkModel_->GetBookmarkBarNode(); | 485 parent = bookmarkModel_->GetBookmarkBarNode(); |
| 486 BookmarkEditor::Show([[self view] window], | 486 BookmarkEditor::Show([[self view] window], |
| 487 browser_->profile(), | 487 browser_->profile(), |
| 488 parent, | 488 parent, |
| 489 nil, | 489 BookmarkEditor::EditDetails(), |
| 490 BookmarkEditor::SHOW_TREE, | 490 BookmarkEditor::SHOW_TREE, |
| 491 nil); | 491 nil); |
| 492 } | 492 } |
| 493 | 493 |
| 494 // Might be from the context menu over the bar OR over a button. | 494 // Might be from the context menu over the bar OR over a button. |
| 495 - (IBAction)addOrRenameFolder:(id)sender { | 495 - (IBAction)addOrRenameFolder:(id)sender { |
| 496 // node is NULL if we were invoked from the bar, and that's fine. | 496 // node is NULL if we were invoked from the bar, and that's fine. |
| 497 BookmarkNode* node = [self nodeFromMenuItem:sender]; | 497 BookmarkNode* node = [self nodeFromMenuItem:sender]; |
| 498 BookmarkNameFolderController* controller = | 498 BookmarkNameFolderController* controller = |
| 499 [[BookmarkNameFolderController alloc] | 499 [[BookmarkNameFolderController alloc] |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 | 740 |
| 741 - (void)setUrlDelegate:(id<BookmarkURLOpener>)urlDelegate { | 741 - (void)setUrlDelegate:(id<BookmarkURLOpener>)urlDelegate { |
| 742 urlDelegate_ = urlDelegate; | 742 urlDelegate_ = urlDelegate; |
| 743 } | 743 } |
| 744 | 744 |
| 745 - (NSArray*)buttons { | 745 - (NSArray*)buttons { |
| 746 return buttons_.get(); | 746 return buttons_.get(); |
| 747 } | 747 } |
| 748 | 748 |
| 749 @end | 749 @end |
| OLD | NEW |