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 #import "chrome/browser/cocoa/bookmark_bar_controller.h" | 5 #import "chrome/browser/cocoa/bookmark_bar_controller.h" |
6 #include "app/l10n_util_mac.h" | 6 #include "app/l10n_util_mac.h" |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 // this point (which just jumps back to objc) other than consistency | 1247 // this point (which just jumps back to objc) other than consistency |
1248 // across platforms. | 1248 // across platforms. |
1249 // | 1249 // |
1250 // TODO(jrg): identify when we NO_TREE. I can see it in the code | 1250 // TODO(jrg): identify when we NO_TREE. I can see it in the code |
1251 // for the other platforms but can't find a way to trigger it in the | 1251 // for the other platforms but can't find a way to trigger it in the |
1252 // UI. | 1252 // UI. |
1253 BookmarkEditor::Show([[self view] window], | 1253 BookmarkEditor::Show([[self view] window], |
1254 browser_->profile(), | 1254 browser_->profile(), |
1255 node->GetParent(), | 1255 node->GetParent(), |
1256 BookmarkEditor::EditDetails(node), | 1256 BookmarkEditor::EditDetails(node), |
1257 BookmarkEditor::SHOW_TREE, | 1257 BookmarkEditor::SHOW_TREE); |
1258 nil); | |
1259 } | 1258 } |
1260 | 1259 |
1261 - (IBAction)cutBookmark:(id)sender { | 1260 - (IBAction)cutBookmark:(id)sender { |
1262 const BookmarkNode* node = [self nodeFromMenuItem:sender]; | 1261 const BookmarkNode* node = [self nodeFromMenuItem:sender]; |
1263 if (node) { | 1262 if (node) { |
1264 std::vector<const BookmarkNode*> nodes; | 1263 std::vector<const BookmarkNode*> nodes; |
1265 nodes.push_back(node); | 1264 nodes.push_back(node); |
1266 bookmark_utils::CopyToClipboard(bookmarkModel_, nodes, true); | 1265 bookmark_utils::CopyToClipboard(bookmarkModel_, nodes, true); |
1267 } | 1266 } |
1268 } | 1267 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 // May be called from the bar or from a folder button. | 1358 // May be called from the bar or from a folder button. |
1360 // If called from a button, that button becomes the parent. | 1359 // If called from a button, that button becomes the parent. |
1361 - (IBAction)addPage:(id)sender { | 1360 - (IBAction)addPage:(id)sender { |
1362 const BookmarkNode* parent = [self nodeFromMenuItem:sender]; | 1361 const BookmarkNode* parent = [self nodeFromMenuItem:sender]; |
1363 if (!parent) | 1362 if (!parent) |
1364 parent = bookmarkModel_->GetBookmarkBarNode(); | 1363 parent = bookmarkModel_->GetBookmarkBarNode(); |
1365 BookmarkEditor::Show([[self view] window], | 1364 BookmarkEditor::Show([[self view] window], |
1366 browser_->profile(), | 1365 browser_->profile(), |
1367 parent, | 1366 parent, |
1368 BookmarkEditor::EditDetails(), | 1367 BookmarkEditor::EditDetails(), |
1369 BookmarkEditor::SHOW_TREE, | 1368 BookmarkEditor::SHOW_TREE); |
1370 nil); | |
1371 } | 1369 } |
1372 | 1370 |
1373 // Might be called from the context menu over the bar OR over a | 1371 // Might be called from the context menu over the bar OR over a |
1374 // button. If called from a button, that button becomes a sibling of | 1372 // button. If called from a button, that button becomes a sibling of |
1375 // the new node. If called from the bar, add to the end of the bar. | 1373 // the new node. If called from the bar, add to the end of the bar. |
1376 - (IBAction)addFolder:(id)sender { | 1374 - (IBAction)addFolder:(id)sender { |
1377 const BookmarkNode* senderNode = [self nodeFromMenuItem:sender]; | 1375 const BookmarkNode* senderNode = [self nodeFromMenuItem:sender]; |
1378 const BookmarkNode* parent = NULL; | 1376 const BookmarkNode* parent = NULL; |
1379 int newIndex = 0; | 1377 int newIndex = 0; |
1380 // If triggered from the bar, folder or "others" folder - add as a child to | 1378 // If triggered from the bar, folder or "others" folder - add as a child to |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1912 return 0; | 1910 return 0; |
1913 } | 1911 } |
1914 | 1912 |
1915 // (BookmarkButtonDelegate protocol) | 1913 // (BookmarkButtonDelegate protocol) |
1916 - (void)fillPasteboard:(NSPasteboard*)pboard | 1914 - (void)fillPasteboard:(NSPasteboard*)pboard |
1917 forDragOfButton:(BookmarkButton*)button { | 1915 forDragOfButton:(BookmarkButton*)button { |
1918 [[self folderTarget] fillPasteboard:pboard forDragOfButton:button]; | 1916 [[self folderTarget] fillPasteboard:pboard forDragOfButton:button]; |
1919 } | 1917 } |
1920 | 1918 |
1921 @end | 1919 @end |
OLD | NEW |