OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/bookmarks/bookmark_context_menu_controller.h" | 5 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 271 |
272 case IDC_PASTE: | 272 case IDC_PASTE: |
273 // Paste to selection from the Bookmark Bar, to parent_ everywhere else | 273 // Paste to selection from the Bookmark Bar, to parent_ everywhere else |
274 return (!selection_.empty() && | 274 return (!selection_.empty() && |
275 bookmark_utils::CanPasteFromClipboard(selection_[0])) || | 275 bookmark_utils::CanPasteFromClipboard(selection_[0])) || |
276 bookmark_utils::CanPasteFromClipboard(parent_); | 276 bookmark_utils::CanPasteFromClipboard(parent_); |
277 } | 277 } |
278 return true; | 278 return true; |
279 } | 279 } |
280 | 280 |
| 281 bool BookmarkContextMenuController::GetAcceleratorForCommandId( |
| 282 int command_id, |
| 283 menus::Accelerator* accelerator) { |
| 284 return false; |
| 285 } |
| 286 |
281 void BookmarkContextMenuController::BookmarkModelChanged() { | 287 void BookmarkContextMenuController::BookmarkModelChanged() { |
282 if (delegate_) | 288 if (delegate_) |
283 delegate_->CloseMenu(); | 289 delegate_->CloseMenu(); |
284 } | 290 } |
285 | 291 |
286 bool BookmarkContextMenuController::HasURLs() const { | 292 bool BookmarkContextMenuController::HasURLs() const { |
287 for (size_t i = 0; i < selection_.size(); ++i) { | 293 for (size_t i = 0; i < selection_.size(); ++i) { |
288 if (bookmark_utils::NodeHasURLs(selection_[i])) | 294 if (bookmark_utils::NodeHasURLs(selection_[i])) |
289 return true; | 295 return true; |
290 } | 296 } |
291 return false; | 297 return false; |
292 } | 298 } |
OLD | NEW |